[Scummvm-cvs-logs] SF.net SVN: scummvm: [24612] scummvm/trunk/engines/scumm

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Nov 5 00:00:19 CET 2006


Revision: 24612
          http://svn.sourceforge.net/scummvm/?rev=24612&view=rev
Author:   fingolfin
Date:     2006-11-04 14:59:56 -0800 (Sat, 04 Nov 2006)

Log Message:
-----------
SCUMM cleanup

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/he/script_v100he.cpp
    scummvm/trunk/engines/scumm/he/script_v60he.cpp
    scummvm/trunk/engines/scumm/he/script_v72he.cpp
    scummvm/trunk/engines/scumm/intern.h
    scummvm/trunk/engines/scumm/palette.cpp
    scummvm/trunk/engines/scumm/room.cpp
    scummvm/trunk/engines/scumm/script_v6.cpp
    scummvm/trunk/engines/scumm/script_v8.cpp
    scummvm/trunk/engines/scumm/scumm.cpp
    scummvm/trunk/engines/scumm/scumm.h

Modified: scummvm/trunk/engines/scumm/he/script_v100he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/script_v100he.cpp	2006-11-04 21:51:43 UTC (rev 24611)
+++ scummvm/trunk/engines/scumm/he/script_v100he.cpp	2006-11-04 22:59:56 UTC (rev 24612)
@@ -1617,7 +1617,7 @@
 
 	case 134:		// SO_ROOM_NEW_PALETTE
 		a = pop();
-		setPalette(a);
+		setCurrentPalette(a);
 		break;
 
 	case 135:

Modified: scummvm/trunk/engines/scumm/he/script_v60he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/script_v60he.cpp	2006-11-04 21:51:43 UTC (rev 24611)
+++ scummvm/trunk/engines/scumm/he/script_v60he.cpp	2006-11-04 22:59:56 UTC (rev 24612)
@@ -560,7 +560,7 @@
 
 	case 213:		// SO_ROOM_NEW_PALETTE
 		a = pop();
-		setPalette(a);
+		setCurrentPalette(a);
 		break;
 	case 220:
 		a = pop();

Modified: scummvm/trunk/engines/scumm/he/script_v72he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/script_v72he.cpp	2006-11-04 21:51:43 UTC (rev 24611)
+++ scummvm/trunk/engines/scumm/he/script_v72he.cpp	2006-11-04 22:59:56 UTC (rev 24612)
@@ -1038,7 +1038,7 @@
 
 	case 213:		// SO_ROOM_NEW_PALETTE
 		a = pop();
-		setPalette(a);
+		setCurrentPalette(a);
 		break;
 
 	case 220:

Modified: scummvm/trunk/engines/scumm/intern.h
===================================================================
--- scummvm/trunk/engines/scumm/intern.h	2006-11-04 21:51:43 UTC (rev 24611)
+++ scummvm/trunk/engines/scumm/intern.h	2006-11-04 22:59:56 UTC (rev 24612)
@@ -276,6 +276,10 @@
 	
 	char _sentenceBuf[256];
 
+	int _activeInventory;
+	int _activeObject;
+	int _activeVerb;
+
 public:
 	ScummEngine_v2(OSystem *syst, const DetectorResult &dr);
 
@@ -596,6 +600,10 @@
 
 	Insane *_insane;
 
+	byte _curActor;
+	int _curVerb;
+	int _curVerbSlot;
+
 public:
 	/** This flag tells IMuseDigital that INSANE is running. */
 	bool _insaneRunning;	// Used by IMuseDigital::flushTracks()

Modified: scummvm/trunk/engines/scumm/palette.cpp
===================================================================
--- scummvm/trunk/engines/scumm/palette.cpp	2006-11-04 21:51:43 UTC (rev 24611)
+++ scummvm/trunk/engines/scumm/palette.cpp	2006-11-04 22:59:56 UTC (rev 24612)
@@ -905,7 +905,10 @@
 	setDirtyColors(idx, idx);
 }
 
-void ScummEngine::setPalette(int palindex) {
+void ScummEngine::setCurrentPalette(int palindex) {
+	// TODO: This method could almost be moved to ScummEngin_v6, the only
+	// problem is that it is called by ScummEngine::resetRoomSubBlocks().
+	// But it should be possible to get rid of that, too (with some care).
 	const byte *pals;
 
 	_curPalIndex = palindex;

Modified: scummvm/trunk/engines/scumm/room.cpp
===================================================================
--- scummvm/trunk/engines/scumm/room.cpp	2006-11-04 21:51:43 UTC (rev 24611)
+++ scummvm/trunk/engines/scumm/room.cpp	2006-11-04 22:59:56 UTC (rev 24612)
@@ -553,7 +553,7 @@
 #endif
 
 	if (_PALS_offs || _CLUT_offs)
-		setPalette(0);
+		setCurrentPalette(0);
 }
 
 

Modified: scummvm/trunk/engines/scumm/script_v6.cpp
===================================================================
--- scummvm/trunk/engines/scumm/script_v6.cpp	2006-11-04 21:51:43 UTC (rev 24611)
+++ scummvm/trunk/engines/scumm/script_v6.cpp	2006-11-04 22:59:56 UTC (rev 24612)
@@ -1768,7 +1768,7 @@
 		if (_game.id == GID_SAMNMAX && vm.slot[_currentScript].number == 64)
 			setDirtyColors(0, 255);
 		else
-			setPalette(a);
+			setCurrentPalette(a);
 		break;
 	default:
 		error("o6_roomOps: default case %d", subOp);

Modified: scummvm/trunk/engines/scumm/script_v8.cpp
===================================================================
--- scummvm/trunk/engines/scumm/script_v8.cpp	2006-11-04 21:51:43 UTC (rev 24611)
+++ scummvm/trunk/engines/scumm/script_v8.cpp	2006-11-04 22:59:56 UTC (rev 24612)
@@ -853,7 +853,7 @@
 		break;
 	case 0x5C:		// SO_ROOM_NEW_PALETTE New palette
 		a = pop();
-		setPalette(a);
+		setCurrentPalette(a);
 		break;
 	case 0x5D:		// SO_ROOM_SAVE_GAME Save game
 		_saveTemporaryState = true;

Modified: scummvm/trunk/engines/scumm/scumm.cpp
===================================================================
--- scummvm/trunk/engines/scumm/scumm.cpp	2006-11-04 21:51:43 UTC (rev 24611)
+++ scummvm/trunk/engines/scumm/scumm.cpp	2006-11-04 22:59:56 UTC (rev 24612)
@@ -149,9 +149,6 @@
 	_numTalkies = 0;
 	_numPalettes = 0;
 	_numUnk = 0;
-	_curActor = 0;
-	_curVerb = 0;
-	_curVerbSlot = 0;
 	_curPalIndex = 0;
 	_currentRoom = 0;
 	_egoPositioned = false;
@@ -170,9 +167,6 @@
 	_numObjectsInRoom = 0;
 	_userPut = 0;
 	_userState = 0;
-	_activeInventory = 0;
-	_activeObject = 0;
-	_activeVerb = 0;
 	_resourceHeaderSize = 8;
 	_saveLoadFlag = 0;
 	_saveLoadSlot = 0;
@@ -612,6 +606,10 @@
 ScummEngine_v2::ScummEngine_v2(OSystem *syst, const DetectorResult &dr)
 	: ScummEngine_v3old(syst, dr) {
 
+	_activeInventory = 0;
+	_activeObject = 0;
+	_activeVerb = 0;
+
 	VAR_SENTENCE_VERB = 0xFF;
 	VAR_SENTENCE_OBJECT1 = 0xFF;
 	VAR_SENTENCE_OBJECT2 = 0xFF;
@@ -639,6 +637,10 @@
 	memset(_akosQueue, 0, sizeof(_akosQueue));
 	_akosQueuePos = 0;
 
+	_curActor = 0;
+	_curVerb = 0;
+	_curVerbSlot = 0;
+
 	VAR_VIDEONAME = 0xFF;
 	VAR_RANDOM_NR = 0xFF;
 	VAR_STRING2DRAW = 0xFF;

Modified: scummvm/trunk/engines/scumm/scumm.h
===================================================================
--- scummvm/trunk/engines/scumm/scumm.h	2006-11-04 21:51:43 UTC (rev 24611)
+++ scummvm/trunk/engines/scumm/scumm.h	2006-11-04 22:59:56 UTC (rev 24612)
@@ -583,10 +583,6 @@
 	int _NESStartStrip;
 
 protected:
-	/* Current objects - can go in their respective classes */
-	byte _curActor;
-	int _curVerb;
-	int _curVerbSlot;
 	int _curPalIndex;
 
 public:
@@ -870,10 +866,6 @@
 	int8 _userPut;
 	uint16 _userState;
 
-	int _activeInventory;
-	int _activeObject;
-	int _activeVerb;
-
 	virtual void handleMouseOver(bool updateInventory);
 	virtual void redrawVerbs();
 	virtual void checkExecVerbs();
@@ -1013,7 +1005,7 @@
 
 	void resetPalette();
 
-	void setPalette(int pal);
+	void setCurrentPalette(int pal);
 	void setRoomPalette(int pal, int room);
 	virtual void setPaletteFromPtr(const byte *ptr, int numcolor = -1);
 	virtual void setPalColor(int index, int r, int g, int b);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list