diff options
-rw-r--r-- | scumm/saveload.cpp | 2 | ||||
-rw-r--r-- | scumm/scumm.cpp | 6 | ||||
-rw-r--r-- | scumm/scumm.h | 3 |
3 files changed, 5 insertions, 6 deletions
diff --git a/scumm/saveload.cpp b/scumm/saveload.cpp index 364af53bc1..5d071f1594 100644 --- a/scumm/saveload.cpp +++ b/scumm/saveload.cpp @@ -449,7 +449,7 @@ void ScummEngine::saveOrLoad(Serializer *s, uint32 savegameVersion) { MKLINE(ScummEngine, _roomResource, sleByte, VER(8)), MKLINE(ScummEngine, _numObjectsInRoom, sleByte, VER(8)), MKLINE(ScummEngine, _currentScript, sleByte, VER(8)), - MKARRAY(ScummEngine, _localScriptList[0], sleUint32, NUM_LOCALSCRIPT, VER(8)), + MKARRAY(ScummEngine, _localScriptList[0], sleUint32, _numLocalScripts, VER(8)), // vm.localvar grew from 25 to 40 script entries and then from diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp index c98967b4cc..bc3c1fd949 100644 --- a/scumm/scumm.cpp +++ b/scumm/scumm.cpp @@ -537,7 +537,7 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS _numActors = 0; _numCostumes = 0; _numImages = 0; - _numLocalScripts = 0; + _numLocalScripts = 60; _numSprites = 0; _numTalkies = 0; _audioNames = NULL; @@ -2224,11 +2224,11 @@ void ScummEngine::initRoomSubBlocks() { if (_version == 8) { id = READ_LE_UINT32(ptr); - checkRange(NUM_LOCALSCRIPT + _numGlobalScripts, _numGlobalScripts, id, "Invalid local script %d"); + checkRange(_numLocalScripts + _numGlobalScripts, _numGlobalScripts, id, "Invalid local script %d"); _localScriptList[id - _numGlobalScripts] = ptr + 4 - roomResPtr; } else if (_version == 7) { id = READ_LE_UINT16(ptr); - checkRange(NUM_LOCALSCRIPT + _numGlobalScripts, _numGlobalScripts, id, "Invalid local script %d"); + checkRange(_numLocalScripts + _numGlobalScripts, _numGlobalScripts, id, "Invalid local script %d"); _localScriptList[id - _numGlobalScripts] = ptr + 2 - roomResPtr; } else { id = ptr[0]; diff --git a/scumm/scumm.h b/scumm/scumm.h index a948b17d23..cfcb0d3b3f 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -88,7 +88,6 @@ extern ScummEngine *g_scumm; /* System Wide Constants */ enum { - NUM_LOCALSCRIPT = 60, NUM_SENTENCE = 6, NUM_SHADOW_PALETTE = 8, KEY_ALL_SKIP = 3457 // WinCE @@ -570,7 +569,7 @@ protected: uint32 _maxHeapThreshold, _minHeapThreshold; /* Script VM - should be in Script class */ - uint32 _localScriptList[NUM_LOCALSCRIPT]; + uint32 _localScriptList[256]; const byte *_scriptPointer, *_scriptOrgPointer; byte _opcode, _currentScript; uint16 _curExecScript; |