[Scummvm-cvs-logs] CVS: scummvm script_v1.cpp,1.119,1.120 scummvm.cpp,1.171,1.172 gfx.cpp,1.99,1.100 saveload.cpp,1.54,1.55 scumm.h,1.179,1.180 script_v2.cpp,1.72,1.73

Max Horn fingolfin at users.sourceforge.net
Sat Jul 13 07:08:02 CEST 2002


Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv29290

Modified Files:
	script_v1.cpp scummvm.cpp gfx.cpp saveload.cpp scumm.h 
	script_v2.cpp 
Log Message:
renamed fadeToBlackEffect to fadeOut; renamed screenEffect to fadeIn; implemented oldRoomEffect (fixes room transitions in MonkeyVGA and Indy3)

Index: script_v1.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/script_v1.cpp,v
retrieving revision 1.119
retrieving revision 1.120
diff -u -d -r1.119 -r1.120
--- script_v1.cpp	12 Jul 2002 22:04:24 -0000	1.119
+++ script_v1.cpp	13 Jul 2002 14:07:36 -0000	1.120
@@ -1547,11 +1547,14 @@
 	b = fetchScriptByte();
 	c = fetchScriptByte();
 
-/*	if (c==0)
-		_vars[VAR_V5_DRAWFLAGS] = a;
-	else if (c==1) {*/
-	warning("o5_lights: lights not implemented");
-//  }
+	warning("o5_lights(%d,%d,%d): lights not implemented", a, b, c);
+
+	if (c==0)
+		_vars[VAR_CURRENT_LIGHTS] = a;
+	else if (c==1) {
+		//LightDx = a;
+		//LightDy = b;
+	}
 	_fullRedraw = 1;
 }
 
@@ -1967,10 +1970,10 @@
 	case 10:											/* ? */
 		a = getVarOrDirectWord(0x80);
 		if (a) {
-			_switchRoomEffect = (byte)(a);
+			_switchRoomEffect = (byte)a;
 			_switchRoomEffect2 = (byte)(a >> 8);
 		} else {
-			screenEffect(_newEffect);
+			fadeIn(_newEffect);
 		}
 		break;
 	case 11:											/* ? */
@@ -2754,13 +2757,11 @@
 	_opcode = fetchScriptByte();
 	if ((_opcode & 0x1F) == 3) {
 		a = getVarOrDirectWord(0x80);
-		switch (a) {
-		case 4:
-			_fullRedraw = true;
-			break;
-		default:
-			warning("Unsupported oldRoomEffect %d", a);
-			break;
+		if (a) {
+			_switchRoomEffect = (byte)a;
+			_switchRoomEffect2 = (byte)(a >> 8);
+		} else {
+			fadeIn(_newEffect);
 		}
 	}
 }

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scummvm.cpp,v
retrieving revision 1.171
retrieving revision 1.172
diff -u -d -r1.171 -r1.172
--- scummvm.cpp	12 Jul 2002 22:10:24 -0000	1.171
+++ scummvm.cpp	13 Jul 2002 14:07:36 -0000	1.172
@@ -119,6 +119,8 @@
 	if (!(_features & GF_AFTER_V7)) {
 		_vars[VAR_V5_DRAWFLAGS] = 11;
 		_vars[VAR_59] = 3;
+
+		_vars[VAR_CURRENT_LIGHTS] = LIGHTMODE_actor_base | LIGHTMODE_actor_color | LIGHTMODE_screen;
 	}
 
 	mouse.x = 104;
@@ -330,9 +332,10 @@
 		setActorRedrawFlags();
 		resetActorBgs();
 
-//    if (!(_vars[VAR_V5_DRAWFLAGS]&2) && _vars[VAR_V5_DRAWFLAGS]&4) {
-//      error("Flashlight not implemented in this version");
-//    }
+		if (!(_vars[VAR_CURRENT_LIGHTS] & LIGHTMODE_screen) &&
+		      _vars[VAR_CURRENT_LIGHTS] & LIGHTMODE_flashlight) {
+			error("Flashlight not implemented in this version");
+		}
 
 		processActors();
 		clear_fullRedraw();
@@ -341,7 +344,7 @@
 
 		if (_doEffect) {
 			_doEffect = false;
-			screenEffect(_newEffect);
+			fadeIn(_newEffect);
 			clearClickedStatus();
 		}
 
@@ -383,7 +386,7 @@
 
 	clearMsgQueue();
 
-	fadeToBlackEffect(_switchRoomEffect2);
+	fadeOut(_switchRoomEffect2);
 	_newEffect = _switchRoomEffect;
 
 	if (_currentScript != 0xFF) {

Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gfx.cpp,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -d -r1.99 -r1.100
--- gfx.cpp	7 Jul 2002 20:32:26 -0000	1.99
+++ gfx.cpp	13 Jul 2002 14:07:36 -0000	1.100
@@ -552,7 +552,44 @@
 	}
 }
 
-void Scumm::fadeToBlackEffect(int a)
+void Scumm::fadeIn(int effect)
+{
+	switch (effect) {
+	case 1:
+	case 2:
+	case 3:
+		transitionEffect(effect - 1);
+		break;
+	case 128:
+		unkScreenEffect6();
+		break;
+	case 130:
+		unkScreenEffect1();
+		break;
+	case 131:
+		unkScreenEffect2();
+		break;
+	case 132:
+		unkScreenEffect3();
+		break;
+	case 133:
+		unkScreenEffect4();
+		break;
+	case 134:
+		unkScreenEffect5(0);
+		break;
+	case 135:
+		unkScreenEffect5(1);
+		break;
+	case 129:
+		break;
+	default:
+		warning("Unknown screen effect, %d", effect);
+	}
+	_screenEffectFlag = true;
+}
+
+void Scumm::fadeOut(int a)
 {
 	VirtScreen *vs;
 
@@ -594,7 +631,7 @@
 		unkScreenEffect5(1);
 		break;
 	default:
-		warning("fadeToBlackEffect: default case %d", a);
+		warning("fadeOut: default case %d", a);
 	}
 }
 
@@ -2164,43 +2201,6 @@
 	setDirtyColors(a, b);
 }
 
-void Scumm::screenEffect(int effect)
-{
-	switch (effect) {
-	case 1:
-	case 2:
-	case 3:
-		transitionEffect(effect - 1);
-		break;
-	case 128:
-		unkScreenEffect6();
-		break;
-	case 130:
-		unkScreenEffect1();
-		break;
-	case 131:
-		unkScreenEffect2();
-		break;
-	case 132:
-		unkScreenEffect3();
-		break;
-	case 133:
-		unkScreenEffect4();
-		break;
-	case 134:
-		unkScreenEffect5(0);
-		break;
-	case 135:
-		unkScreenEffect5(1);
-		break;
-	case 129:
-		break;
-	default:
-		warning("Unknown screen effect, %d", effect);
-	}
-	_screenEffectFlag = true;
-}
-
 void Gdi::resetBackground(int top, int bottom, int strip)
 {
 	VirtScreen *vs = &_vm->virtscr[0];
@@ -2219,7 +2219,8 @@
 
 	_numLinesToProcess = bottom - top;
 	if (_numLinesToProcess) {
-		if (1 /*_vm->_vars[VAR_V5_DRAWFLAGS]&2*/ ) {
+		if ((_vm->_features & GF_AFTER_V7) || (_vm->_vars[_vm->VAR_CURRENT_LIGHTS] & LIGHTMODE_screen)) {
+//		if (1 /*_vm->_vars[VAR_V5_DRAWFLAGS]&2*/ ) {
 			if (_vm->hasCharsetMask(strip << 3, top, (strip + 1) << 3, bottom))
 				draw8ColWithMasking();
 			else

Index: saveload.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saveload.cpp,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- saveload.cpp	7 Jul 2002 20:25:23 -0000	1.54
+++ saveload.cpp	13 Jul 2002 14:07:36 -0000	1.55
@@ -134,7 +134,7 @@
 	// Force a fade to black
 	int old_screenEffectFlag = _screenEffectFlag;
 	_screenEffectFlag = true;
-	fadeToBlackEffect(129);
+	fadeOut(129);
 	_screenEffectFlag = old_screenEffectFlag;
 
 	initScreens(0, sb, 320, sh);

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm.h,v
retrieving revision 1.179
retrieving revision 1.180
diff -u -d -r1.179 -r1.180
--- scumm.h	13 Jul 2002 11:56:04 -0000	1.179
+++ scumm.h	13 Jul 2002 14:07:36 -0000	1.180
@@ -255,6 +255,14 @@
 };
 
 enum {
+	LIGHTMODE_dark			= 0,
+	LIGHTMODE_actor_base	= 1,
+	LIGHTMODE_screen		= 2,
+	LIGHTMODE_flashlight	= 4,
+	LIGHTMODE_actor_color	= 8
+};
+
+enum {
 	OF_OWNER_MASK = 0x0F,
 	OF_STATE_MASK = 0xF0,
 	
@@ -1112,10 +1120,10 @@
 	void updateDirtyScreen(int slot);
 
 	VirtScreen *findVirtScreen(int y);
-	void fadeToBlackEffect(int a);
+	void fadeOut(int a);
 	static void setVirtscreenDirty(VirtScreen *vs, int left, int top, int right, int bottom);
 
-	void screenEffect(int effect);
+	void fadeIn(int effect);
 	void unkScreenEffect1();
 	void unkScreenEffect2();
 	void unkScreenEffect3();

Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/script_v2.cpp,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- script_v2.cpp	10 Jul 2002 06:18:32 -0000	1.72
+++ script_v2.cpp	13 Jul 2002 14:07:37 -0000	1.73
@@ -1843,7 +1843,7 @@
 			_switchRoomEffect = (byte)(a);
 			_switchRoomEffect2 = (byte)(a >> 8);
 		} else {
-			screenEffect(_newEffect);
+			fadeIn(_newEffect);
 		}
 		break;
 
@@ -2785,7 +2785,7 @@
 			grabCursor(args[1], args[2], args[3], args[4]);
 			break;
 		case 5:
-			fadeToBlackEffect(args[1]);
+			fadeOut(args[1]);
 			break;
 		case 6:
 			_fullRedraw = 1;
@@ -2793,7 +2793,7 @@
 			for (i = 0; i < NUM_ACTORS; i++)
 				derefActor(i)->needRedraw = true;
 			processActors();
-			screenEffect(args[1]);
+			fadeIn(args[1]);
 			break;
 		case 8:
 			startManiac();





More information about the Scummvm-git-logs mailing list