[Scummvm-cvs-logs] CVS: scummvm/scumm actor.cpp,1.116,1.117 actor.h,1.28,1.29 script_v5.cpp,1.103,1.104 script_v6.cpp,1.138,1.139 script_v8.cpp,2.170,2.171 scumm.h,1.221,1.222 scummvm.cpp,2.188,2.189

Max Horn fingolfin at users.sourceforge.net
Thu May 29 17:56:05 CEST 2003


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv20649

Modified Files:
	actor.cpp actor.h script_v5.cpp script_v6.cpp script_v8.cpp 
	scumm.h scummvm.cpp 
Log Message:
rewrote Actor::needBgReset related code (this could cause regressions...)

Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.cpp,v
retrieving revision 1.116
retrieving revision 1.117
diff -u -d -r1.116 -r1.117
--- actor.cpp	29 May 2003 17:14:47 -0000	1.116
+++ actor.cpp	30 May 2003 00:55:17 -0000	1.117
@@ -326,7 +326,6 @@
 	int direction;
 
 	needRedraw = true;
-	needBgReset = true;
 
 	direction = updateActorDirection(true);
 	if (!(moving & MF_IN_LEG) || facing != direction) {
@@ -452,7 +451,6 @@
 		if (costume != 0) {
 			animProgress = 0;
 			needRedraw = true;
-			needBgReset = true;
 			if (f == initFrame)
 				cost.reset();
 			_vm->akos_decodeData(this, f, (uint) - 1);
@@ -488,8 +486,6 @@
 				cost.reset();
 			_vm->cost_decodeData(this, f, (uint) - 1);
 		}
-
-		needBgReset = true;
 	}
 }
 
@@ -559,7 +555,6 @@
 	}
 
 	needRedraw = true;
-	needBgReset = true;
 }
 
 void Actor::putActor(int dstX, int dstY, byte newRoom) {
@@ -571,7 +566,6 @@
 	y = dstY;
 	room = newRoom;
 	needRedraw = true;
-	needBgReset = true;
 
 	if (_vm->VAR(_vm->VAR_EGO) == number) {
 		_vm->_egoPositioned = true;
@@ -947,7 +941,6 @@
 		// games, either. So maybe this code isn't the correct way to do what
 		// it does (which is to fix actor draw problems, see also patch #699980).
 		// Would be nice to figure out what the original code does...
-		needBgReset = true;
 		needRedraw = true;
 	}
 
@@ -975,14 +968,12 @@
 			assert(akos);
 			if (_vm->akos_increaseAnims(akos, this)) {
 				needRedraw = true;
-				needBgReset = true;
 			}
 		} else {
 			LoadedCostume lc(_vm);
 			lc.loadCostume(costume);
 			if (lc.increaseAnims(this)) {
 				needRedraw = true;
-				needBgReset = true;
 			}
 		}
 	}
@@ -1023,13 +1014,12 @@
 	}
 }
 
-void Scumm::setActorRedrawFlags(bool fg, bool bg) {
+void Scumm::setActorRedrawFlags() {
 	int i, j;
 
 	if (_fullRedraw) {
 		for (j = 1; j < _numActors; j++) {
-			_actors[j].needRedraw |= fg;
-			_actors[j].needBgReset |= bg;
+			_actors[j].needRedraw = true;
 		}
 	} else {
 		for (i = 0; i < gdi._numStrips; i++) {
@@ -1037,8 +1027,7 @@
 			if (testGfxAnyUsageBits(strip)) {
 				for (j = 1; j < _numActors; j++) {
 					if (testGfxUsageBit(strip, j) && testGfxOtherUsageBits(strip, j)) {
-						_actors[j].needRedraw |= fg;
-						_actors[j].needBgReset |= bg;
+						_actors[j].needRedraw = true;
 					}
 				}
 			}
@@ -1489,7 +1478,8 @@
 	for (i = 0; i < gdi._numStrips; i++) {
 		int strip = _screenStartStrip + i;
 		for (j = 1; j < _numActors; j++) {
-			if (testGfxUsageBit(strip, j) && _actors[j].top != 0xFF && _actors[j].needBgReset) {
+			if (testGfxUsageBit(strip, j) &&
+				((_actors[j].top != 0xFF || _actors[j].needRedraw) || _actors[j].needBgReset)) {
 				clearGfxUsageBit(strip, j);
 				if ((_actors[j].bottom - _actors[j].top) >= 0)
 					gdi.resetBackground(_actors[j].top, _actors[j].bottom, i);

Index: actor.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- actor.h	26 May 2003 14:20:05 -0000	1.28
+++ actor.h	30 May 2003 00:55:18 -0000	1.29
@@ -93,7 +93,7 @@
 	bool ignoreBoxes;
 	byte forceClip;
 	byte initFrame, walkFrame, standFrame, talkStartFrame, talkStopFrame;
-	bool needRedraw, needBgReset, costumeNeedsInit, visible;
+	bool needRedraw, needBgReset, visible;
 	byte shadow_mode;
 	bool flip;
 	uint speedx, speedy;
@@ -108,6 +108,7 @@
 	CostumeData cost;
 	byte palette[256];
 protected:
+	bool costumeNeedsInit;
 	ActorWalkData walkdata;
 	int16 animVariable[16];
 

Index: script_v5.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v5.cpp,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -d -r1.103 -r1.104
--- script_v5.cpp	26 May 2003 14:43:02 -0000	1.103
+++ script_v5.cpp	30 May 2003 00:55:18 -0000	1.104
@@ -454,7 +454,6 @@
 		case 9:										/* elevation */
 			a->elevation = getVarOrDirectWord(0x80);
 			a->needRedraw = true;
-			a->needBgReset = true;
 			break;
 		case 10:										/* defaultanims */
 			a->initFrame = 1;
@@ -505,7 +504,6 @@
 			}
 
 			a->needRedraw = true;
-			a->needBgReset = true;
 			break;
 		case 18:										/* neverzclip */
 			a->forceClip = 0;

Index: script_v6.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v6.cpp,v
retrieving revision 1.138
retrieving revision 1.139
diff -u -d -r1.138 -r1.139
--- script_v6.cpp	28 May 2003 19:55:05 -0000	1.138
+++ script_v6.cpp	30 May 2003 00:55:18 -0000	1.139
@@ -1655,7 +1655,6 @@
 	case 84:											/* actor-elevation */
 		a->elevation = pop();
 		a->needRedraw = true;
-		a->needBgReset = true;
 		break;
 	case 85:											/* actor-defaultanims */
 		a->initFrame = 1;
@@ -1686,7 +1685,6 @@
 	case 92:
 		a->scalex = a->scaley = pop();
 		a->needRedraw = true;
-		a->needBgReset = true;
 		break;
 	case 93:
 		a->forceClip = 0;
@@ -2530,7 +2528,6 @@
 		case 107:
 			a = derefActor(args[1], "o6_kernelSetFunctions: 107");
 			a->scalex = (unsigned char)args[2];
-			a->needBgReset = true;
 			a->needRedraw = true;
 			break;
 		case 108:
@@ -2572,7 +2569,7 @@
 		case 6:
 			_fullRedraw = 1;
 			redrawBGAreas();
-			setActorRedrawFlags(true, false);
+			setActorRedrawFlags();
 			processActors();
 			fadeIn(args[1]);
 			break;
@@ -2588,7 +2585,6 @@
 		case 107:									/* set actor scale */
 			a = derefActor(args[1], "o6_kernelSetFunctions: 107");
 			a->scalex = (unsigned char)args[2];
-			a->needBgReset = true;
 			a->needRedraw = true;
 			break;
 		case 108:									/* create proc_special_palette */

Index: script_v8.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v8.cpp,v
retrieving revision 2.170
retrieving revision 2.171
diff -u -d -r2.170 -r2.171
--- script_v8.cpp	28 May 2003 14:01:54 -0000	2.170
+++ script_v8.cpp	30 May 2003 00:55:20 -0000	2.171
@@ -1069,7 +1069,6 @@
 	case 0x6E:		// SO_ACTOR_ELEVATION
 		a->elevation = pop();
 		a->needRedraw = true;
-		a->needBgReset = true;
 		break;
 	case 0x6F:		// SO_ACTOR_PALETTE Set actor palette
 		j = pop();
@@ -1090,7 +1089,6 @@
 	case 0x73:		// SO_ACTOR_SCALE Set scaling of actor
 		a->scalex = a->scaley = pop();
 		a->needRedraw = true;
-		a->needBgReset = true;
 		break;
 	case 0x74:		// SO_ACTOR_NEVER_ZCLIP ?
 		a->forceClip = 0;

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.221
retrieving revision 1.222
diff -u -d -r1.221 -r1.222
--- scumm.h	29 May 2003 23:44:24 -0000	1.221
+++ scumm.h	30 May 2003 00:55:21 -0000	1.222
@@ -730,7 +730,7 @@
 protected:
 	void walkActors();
 	void playActorSounds();
-	void setActorRedrawFlags(bool fg, bool bg);
+	void setActorRedrawFlags();
 	void showActors();
 	void resetActorBgs();
 	void processActors();

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 2.188
retrieving revision 2.189
diff -u -d -r2.188 -r2.189
--- scummvm.cpp	29 May 2003 21:45:25 -0000	2.188
+++ scummvm.cpp	30 May 2003 00:55:21 -0000	2.189
@@ -1041,14 +1041,14 @@
 			redrawVerbs();
 		}
 		
-		setActorRedrawFlags(true, true);
+		setActorRedrawFlags();
 		resetActorBgs();
 
 		if (!(_features & GF_AFTER_V7) &&
 		    !(VAR(VAR_CURRENT_LIGHTS) & LIGHTMODE_screen) &&
 		      VAR(VAR_CURRENT_LIGHTS) & LIGHTMODE_flashlight) {
 			drawFlashlight();
-			setActorRedrawFlags(true, false);
+			setActorRedrawFlags();
 		}
 
 		processActors();





More information about the Scummvm-git-logs mailing list