aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorTravis Howell2004-09-04 23:35:14 +0000
committerTravis Howell2004-09-04 23:35:14 +0000
commitac140c296350f3f8e70674d8da5054ba7e3043cf (patch)
tree5af7a5e320480bd4842de4e90b1c46a55226b2d7 /scumm
parent95a52bf4b44376110ec4d12d1b7900c99edd7bf0 (diff)
downloadscummvm-rg350-ac140c296350f3f8e70674d8da5054ba7e3043cf.tar.gz
scummvm-rg350-ac140c296350f3f8e70674d8da5054ba7e3043cf.tar.bz2
scummvm-rg350-ac140c296350f3f8e70674d8da5054ba7e3043cf.zip
HE 72+ games set VARS with amount of each type of resource.
Often used by their scripts. svn-id: r14899
Diffstat (limited to 'scumm')
-rw-r--r--scumm/scumm.cpp18
-rw-r--r--scumm/scumm.h15
-rw-r--r--scumm/vars.cpp8
3 files changed, 36 insertions, 5 deletions
diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp
index e71a8f90be..3fd9ea8a79 100644
--- a/scumm/scumm.cpp
+++ b/scumm/scumm.cpp
@@ -802,10 +802,17 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS
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 @@ void ScummEngine::initScummVars() {
// 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) {
diff --git a/scumm/scumm.h b/scumm/scumm.h
index 8af5594bf3..e70bea5247 100644
--- a/scumm/scumm.h
+++ b/scumm/scumm.h
@@ -477,11 +477,11 @@ protected:
/* 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 @@ public:
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
diff --git a/scumm/vars.cpp b/scumm/vars.cpp
index 65c0b7b1b0..44a7ba9462 100644
--- a/scumm/vars.cpp
+++ b/scumm/vars.cpp
@@ -241,6 +241,14 @@ void ScummEngine_v72he::setupScummVars() {
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() {