[Scummvm-cvs-logs] CVS: scummvm/scumm scumm.cpp,1.166,1.167 scumm.h,1.467,1.468 vars.cpp,1.96,1.97

Travis Howell kirben at users.sourceforge.net
Sat Sep 4 16:36:01 CEST 2004


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

Modified Files:
	scumm.cpp scumm.h vars.cpp 
Log Message:

HE 72+ games set VARS with amount of each type of resource.
Often used by their scripts.


Index: scumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.cpp,v
retrieving revision 1.166
retrieving revision 1.167
diff -u -d -r1.166 -r1.167
--- scumm.cpp	4 Sep 2004 10:29:06 -0000	1.166
+++ scumm.cpp	4 Sep 2004 23:35:14 -0000	1.167
@@ -802,10 +802,17 @@
 
 	VAR_BLAST_ABOVE_TEXT = 0xFF;
 	VAR_VOICE_MODE = 0xFF;
-	VAR_NUM_GLOBAL_OBJS = 0xFF;
 	VAR_MUSIC_BUNDLE_LOADED = 0xFF;
 	VAR_VOICE_BUNDLE_LOADED = 0xFF;
 
+	VAR_NUM_ROOMS = 0xFF;
+	VAR_NUM_SCRIPTS = 0xFF;
+	VAR_NUM_SOUNDS = 0xFF;
+	VAR_NUM_COSTUMES = 0xFF;
+	VAR_NUM_IMAGES = 0xFF;
+	VAR_NUM_CHARSETS = 0xFF;
+	VAR_NUM_GLOBAL_OBJS = 0xFF;
+
 	// Use g_scumm from error() ONLY
 	g_scumm = this;
 
@@ -1392,6 +1399,15 @@
 
 		// Set amount of sound channels
 		VAR(9) = 8;
+		if (_heversion >= 72) {
+			VAR(VAR_NUM_ROOMS) = _numRooms - 1;
+			VAR(VAR_NUM_SCRIPTS) = _numScripts - 1;
+			VAR(VAR_NUM_SOUNDS) = _numSounds - 1;
+			VAR(VAR_NUM_COSTUMES) = _numCostumes - 1;
+			VAR(VAR_NUM_IMAGES) = _numImages - 1;
+			VAR(VAR_NUM_CHARSETS) = _numCharsets - 1;
+			VAR(VAR_NUM_GLOBAL_OBJS) = _numGlobalObjects - 1;
+		}
 	} else {
 		VAR(VAR_CURRENTDRIVE) = 0;
 		switch (_midiDriver) {

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.467
retrieving revision 1.468
diff -u -d -r1.467 -r1.468
--- scumm.h	4 Sep 2004 10:29:06 -0000	1.467
+++ scumm.h	4 Sep 2004 23:35:14 -0000	1.468
@@ -477,11 +477,11 @@
 	/* Global resource tables */
 	int _numVariables, _numBitVariables, _numLocalObjects;
 	int _numGlobalObjects, _numArray, _numVerbs, _numFlObject;
-	int _numInventory, _numRooms, _numScripts;
+	int _numInventory;
 	int _numNewNames, _numGlobalScripts;
-	int _numActors, _numImages, _numRoomVariables;
+	int _numActors, _numRoomVariables;
 public:
-	int _numSounds;
+	int _numImages, _numRooms, _numScripts, _numSounds;	// Used by VARS in HE games
 	int _numCostumes;	// FIXME - should be protected, used by Actor::remapActorPalette
 	int _numCharsets;	// FIXME - should be protected, used by CharsetRenderer
 
@@ -1293,9 +1293,16 @@
 
 	byte VAR_BLAST_ABOVE_TEXT;
 	byte VAR_VOICE_MODE;
-	byte VAR_NUM_GLOBAL_OBJS;
 	byte VAR_MUSIC_BUNDLE_LOADED;
 	byte VAR_VOICE_BUNDLE_LOADED;
+
+	byte VAR_NUM_ROOMS;
+	byte VAR_NUM_SCRIPTS;
+	byte VAR_NUM_SOUNDS;
+	byte VAR_NUM_COSTUMES;
+	byte VAR_NUM_IMAGES;
+	byte VAR_NUM_CHARSETS;
+	byte VAR_NUM_GLOBAL_OBJS;
 };
 
 // This is a constant lookup table of reverse bit masks

Index: vars.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/vars.cpp,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -d -r1.96 -r1.97
--- vars.cpp	24 Aug 2004 11:24:51 -0000	1.96
+++ vars.cpp	4 Sep 2004 23:35:14 -0000	1.97
@@ -241,6 +241,14 @@
 	VAR_TIMEDATE_MONTH = 66;
 	VAR_TIMEDATE_YEAR = 67;
 
+	VAR_NUM_ROOMS = 68;
+	VAR_NUM_SCRIPTS = 69;
+	VAR_NUM_SOUNDS = 70;
+	VAR_NUM_COSTUMES = 71;
+	VAR_NUM_IMAGES = 72;
+	VAR_NUM_CHARSETS = 73;
+	VAR_NUM_GLOBAL_OBJS = 74;
+
 }
 
 void ScummEngine_v7::setupScummVars() {





More information about the Scummvm-git-logs mailing list