diff options
author | Eugene Sandulenko | 2004-08-26 23:30:28 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2004-08-26 23:30:28 +0000 |
commit | eb7671f0a76c98766c1629ce4fb8bc418dba28f8 (patch) | |
tree | 77c6050d1f58ceb7fb6e18203be16ab2564a3344 | |
parent | d71604c20cc563629892828b8affef5c4ab88f48 (diff) | |
download | scummvm-rg350-eb7671f0a76c98766c1629ce4fb8bc418dba28f8.tar.gz scummvm-rg350-eb7671f0a76c98766c1629ce4fb8bc418dba28f8.tar.bz2 scummvm-rg350-eb7671f0a76c98766c1629ce4fb8bc418dba28f8.zip |
Add another variable which improves readability.
svn-id: r14791
-rw-r--r-- | scumm/resource.cpp | 4 | ||||
-rw-r--r-- | scumm/script.cpp | 4 | ||||
-rw-r--r-- | scumm/scumm.cpp | 1 | ||||
-rw-r--r-- | scumm/scumm.h | 2 |
4 files changed, 6 insertions, 5 deletions
diff --git a/scumm/resource.cpp b/scumm/resource.cpp index cd2eab1725..0b542b9d91 100644 --- a/scumm/resource.cpp +++ b/scumm/resource.cpp @@ -2335,7 +2335,7 @@ void ScummEngine::readMAXS(int blockSize) { error("MAXS block of size %d not supported, please report", blockSize); _numVariables = _fileHandle.readUint16LE(); _fileHandle.readUint16LE(); - _numBitVariables = _fileHandle.readUint16LE(); + _numBitVariables = _numRoomVariables = _fileHandle.readUint16LE(); _numLocalObjects = _fileHandle.readUint16LE(); _numArray = _fileHandle.readUint16LE(); _fileHandle.readUint16LE(); @@ -2429,7 +2429,7 @@ void ScummEngine::allocateArrays() { _inventory = (uint16 *)calloc(_numInventory, sizeof(uint16)); _verbs = (VerbSlot *)calloc(_numVerbs, sizeof(VerbSlot)); _objs = (ObjectData *)calloc(_numLocalObjects, sizeof(ObjectData)); - _roomVars = (int32 *)calloc(_numBitVariables, sizeof(int32)); + _roomVars = (int32 *)calloc(_numRoomVariables, sizeof(int32)); _scummVars = (int32 *)calloc(_numVariables, sizeof(int32)); _bitVars = (byte *)calloc(_numBitVariables >> 3, 1); _images = (uint16 *)calloc(_numImages, sizeof(uint16)); diff --git a/scumm/script.cpp b/scumm/script.cpp index 759e248784..d33bfb5069 100644 --- a/scumm/script.cpp +++ b/scumm/script.cpp @@ -518,7 +518,7 @@ int ScummEngine::readVar(uint var) { if (var & 0x8000) { if (_gameId == GID_PAJAMA) { var &= 0xFFF; - checkRange(_numBitVariables, 0, var, "Room variable %d out of range(w)"); + checkRange(_numRoomVariables - 1, 0, var, "Room variable %d out of range(w)"); return _roomVars[var]; } else if ((_gameId == GID_ZAK256) || (_features & GF_OLD_BUNDLE) || @@ -601,7 +601,7 @@ void ScummEngine::writeVar(uint var, int value) { if (var & 0x8000) { if (_gameId == GID_PAJAMA) { var &= 0xFFF; - checkRange(_numBitVariables, 0, var, "Room variable %d out of range(w)"); + checkRange(_numRoomVariables - 1, 0, var, "Room variable %d out of range(w)"); _roomVars[var] = value; } else if ((_gameId == GID_ZAK256) || (_features & GF_OLD_BUNDLE) || diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp index 7803b53aab..0b032ae914 100644 --- a/scumm/scumm.cpp +++ b/scumm/scumm.cpp @@ -496,6 +496,7 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS _bitVars = NULL; _numVariables = 0; _numBitVariables = 0; + _numRoomVariables = 0; _numLocalObjects = 0; _numGlobalObjects = 0; _numArray = 0; diff --git a/scumm/scumm.h b/scumm/scumm.h index 1fa7ca9729..3bf455fa27 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -481,7 +481,7 @@ protected: int _numGlobalObjects, _numArray, _numVerbs, _numFlObject; int _numInventory, _numRooms, _numScripts, _numSounds; int _numNewNames, _numGlobalScripts; - int _numActors, _numImages; + int _numActors, _numImages, _numRoomVariables; public: int _numCostumes; // FIXME - should be protected, used by Actor::remapActorPalette int _numCharsets; // FIXME - should be protected, used by CharsetRenderer |