[Scummvm-cvs-logs] CVS: scummvm/scumm actor.cpp,1.346,1.347 intern.h,2.466,2.467 scumm.cpp,1.468,1.469 scumm.h,1.606,1.607

Max Horn fingolfin at users.sourceforge.net
Wed Apr 27 17:49:30 CEST 2005


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16427

Modified Files:
	actor.cpp intern.h scumm.cpp scumm.h 
Log Message:
Refactor HE actor post/pre-processing code a bit (some more cleanup for HE90 could probably be done, but I'll leave that to the HE folks for now :-)

Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.cpp,v
retrieving revision 1.346
retrieving revision 1.347
diff -u -d -r1.346 -r1.347
--- actor.cpp	27 Apr 2005 13:55:53 -0000	1.346
+++ actor.cpp	28 Apr 2005 00:44:49 -0000	1.347
@@ -27,6 +27,7 @@
 #include "scumm/boxes.h"
 #include "scumm/charset.h"
 #include "scumm/costume.h"
+#include "scumm/intern.h"
 #include "scumm/object.h"
 #include "scumm/resource.h"
 #include "scumm/saveload.h"
@@ -976,9 +977,6 @@
 }
 
 void ScummEngine::processActors() {
-	if (_skipProcessActors)
-		return;
-
 	int numactors = 0;
 
 	// TODO : put this actors as a member array. It never has to grow or shrink
@@ -1018,6 +1016,30 @@
 		akos_processQueue();
 }
 
+void ScummEngine_v70he::processActors() {
+	// TODO: The HE 90 stuff should be moved to a new method, too,
+	// if possible (ScummEngine_v90he::processActors).
+	if (_heversion >= 71) {
+		preProcessAuxQueue();
+	}
+	if (_heversion >= 90) {
+		((ScummEngine_v90he *)this)->spritesMarkDirty(0);
+		((ScummEngine_v90he *)this)->spritesProcessWiz(true);
+	}
+
+	if (!_skipProcessActors)
+		ScummEngine::processActors();
+
+	if (_heversion >= 71) {
+		postProcessAuxQueue();
+	}
+	if (_heversion >= 90) {
+		((ScummEngine_v90he *)this)->spritesMarkDirty(1);
+		((ScummEngine_v90he *)this)->spritesProcessWiz(false);
+	}
+}
+
+
 // Used in Scumm v8, to allow the verb coin to be drawn over the inventory
 // chest. I'm assuming that draw order won't matter here.
 void ScummEngine::processUpperActors() {
@@ -1943,7 +1965,7 @@
 	return (_heCondMask & (1 << (slot - 1))) != 0;
 }
 
-void ScummEngine::preProcessAuxQueue() {
+void ScummEngine_v70he::preProcessAuxQueue() {
 	if (!_skipProcessActors) {
 		for (int i = 0; i < _auxBlocksNum; ++i) {
 			AuxBlock *ab = &_auxBlocks[i];
@@ -1956,7 +1978,7 @@
 	_auxBlocksNum = 0;
 }
 
-void ScummEngine::postProcessAuxQueue() {
+void ScummEngine_v70he::postProcessAuxQueue() {
 	if (!_skipProcessActors) {
 		for (int i = 0; i < _auxEntriesNum; ++i) {
 			AuxEntry *ae = &_auxEntries[i];

Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.466
retrieving revision 2.467
diff -u -d -r2.466 -r2.467
--- intern.h	27 Apr 2005 14:26:52 -0000	2.466
+++ intern.h	28 Apr 2005 00:44:49 -0000	2.467
@@ -694,6 +694,9 @@
 	byte *_heV7RoomOffsets;
 
 	int32 _heSndSoundId, _heSndOffset, _heSndChannel, _heSndFlags, _heSndSoundFreq;
+
+	bool _skipProcessActors;
+
 public:
 	ScummEngine_v70he(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16]);
 	~ScummEngine_v70he();
@@ -716,6 +719,10 @@
 
 	virtual void redrawBGAreas();
 
+	virtual void processActors();
+	void preProcessAuxQueue();
+	void postProcessAuxQueue();
+
 	int getStringCharWidth(byte chr);
 	virtual int setupStringArray(int size);
 	void appendSubstring(int dst, int src, int len2, int len);

Index: scumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.cpp,v
retrieving revision 1.468
retrieving revision 1.469
diff -u -d -r1.468 -r1.469
--- scumm.cpp	27 Apr 2005 14:30:21 -0000	1.468
+++ scumm.cpp	28 Apr 2005 00:45:05 -0000	1.469
@@ -918,7 +918,6 @@
 	_actorClipOverride.right = 640;
 
 	_skipDrawObject = 0;
-	_skipProcessActors = 0;
 	_auxBlocksNum = 0;
 	memset(_auxBlocks, 0, sizeof(_auxBlocks));
 	_auxEntriesNum = 0;
@@ -1269,6 +1268,8 @@
 	_heSndFlags = 0;
 	_heSndSoundFreq = 0;
 
+	_skipProcessActors = 0;
+
 	VAR_NUM_SOUND_CHANNELS = 0xFF;
 }
 
@@ -2120,26 +2121,11 @@
 			drawFlashlight();
 			setActorRedrawFlags();
 		}
-		if (_heversion >= 71) {
-			preProcessAuxQueue();
-		}
-		if (_heversion >= 90) {
-			((ScummEngine_v90he *)this)->spritesMarkDirty(0);
-			((ScummEngine_v90he *)this)->spritesProcessWiz(true);
-		}
 
 		processActors();
 		
 		_fullRedraw = false;
 
-		if (_heversion >= 71) {
-			postProcessAuxQueue();
-		}
-		if (_heversion >= 90) {
-			((ScummEngine_v90he *)this)->spritesMarkDirty(1);
-			((ScummEngine_v90he *)this)->spritesProcessWiz(false);
-		}
-
 		if (_version >= 4 && _heversion <= 61)
 			cyclePalette();
 		palManipulate();

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.606
retrieving revision 1.607
diff -u -d -r1.606 -r1.607
--- scumm.h	27 Apr 2005 14:30:32 -0000	1.606
+++ scumm.h	28 Apr 2005 00:45:06 -0000	1.607
@@ -825,7 +825,7 @@
 	void showActors();
 	void setupV1ActorTalkColor();
 	void resetActorBgs();
-	void processActors();
+	virtual void processActors();
 	void processUpperActors();
 	int getActorFromPos(int x, int y);
 	
@@ -836,8 +836,6 @@
 	AuxEntry _auxEntries[16];
 	uint16 _auxEntriesNum;
 
-	void preProcessAuxQueue();
-	void postProcessAuxQueue();
 	void queueAuxBlock(Actor *a);
 	void queueAuxEntry(int actorNum, int subIndex);
 
@@ -1068,7 +1066,7 @@
 	byte _HEV7ActorPalette[256];
 	byte _roomPalette[256];
 	byte *_shadowPalette;
-	bool _skipDrawObject, _skipProcessActors;
+	bool _skipDrawObject;
 	int _timers[4];
 	int _voiceMode;
 





More information about the Scummvm-git-logs mailing list