diff options
-rw-r--r-- | scumm/object.cpp | 6 | ||||
-rw-r--r-- | scumm/resource.cpp | 16 | ||||
-rw-r--r-- | scumm/script.cpp | 8 | ||||
-rw-r--r-- | scumm/script_v6.cpp | 2 | ||||
-rw-r--r-- | scumm/script_v72he.cpp | 2 | ||||
-rw-r--r-- | scumm/scumm.h | 8 |
6 files changed, 17 insertions, 25 deletions
diff --git a/scumm/object.cpp b/scumm/object.cpp index cc1d85f740..0cad4b021b 100644 --- a/scumm/object.cpp +++ b/scumm/object.cpp @@ -898,8 +898,8 @@ void ScummEngine::clearOwnerOf(int obj) { if (!a[0] && a[1]) { a[0] = a[1]; a[1] = 0; - _baseInventoryItems[i] = _baseInventoryItems[i + 1]; - _baseInventoryItems[i + 1] = NULL; + res.address[rtInventory][i] = res.address[rtInventory][i + 1]; + res.address[rtInventory][i + 1] = NULL; } } return; @@ -1597,7 +1597,7 @@ int ScummEngine::findLocalObjectSlot() { int ScummEngine::findFlObjectSlot() { int i; for (i = 1; i < _numFlObject; i++) { - if (_baseFLObject[i] == NULL) + if (res.address[rtFlObject][i] == NULL) return i; } error("findFlObjectSlot: Out of FLObject slots"); diff --git a/scumm/resource.cpp b/scumm/resource.cpp index 45e08eb28c..d954f61d28 100644 --- a/scumm/resource.cpp +++ b/scumm/resource.cpp @@ -229,13 +229,13 @@ void ScummEngine::openRoom(int room) { if (_features & GF_EXTERNAL_CHARSET && room >= roomlimit) room_offs = 0; else - room_offs = room ? _roomFileOffsets[room] : 0; + room_offs = room ? res.roomoffs[rtRoom][room] : 0; if (room_offs == -1) break; if (room_offs != 0 && room != 0) { - _fileOffset = _roomFileOffsets[room]; + _fileOffset = res.roomoffs[rtRoom][room]; return; } if (!(_features & GF_SMALL_HEADER)) { @@ -296,7 +296,7 @@ void ScummEngine::openRoom(int room) { if (_features & GF_EXTERNAL_CHARSET && room >= roomlimit) return; readRoomsOffsets(); - _fileOffset = _roomFileOffsets[room]; + _fileOffset = res.roomoffs[rtRoom][room]; if (_fileOffset != 8) return; @@ -333,8 +333,8 @@ void ScummEngine::deleteRoomOffsets() { return; for (int i = 0; i < _numRooms; i++) { - if (_roomFileOffsets[i] != 0xFFFFFFFF) - _roomFileOffsets[i] = 0; + if (res.roomoffs[rtRoom][i] != 0xFFFFFFFF) + res.roomoffs[rtRoom][i] = 0; } } @@ -353,7 +353,7 @@ void ScummEngine::readRoomsOffsets() { num = READ_LE_UINT16(_heV7RoomOffsets); ptr = _heV7RoomOffsets + 2; for (i = 0; i < num; i++) { - _roomFileOffsets[i] = READ_LE_UINT32(ptr); + res.roomoffs[rtRoom][i] = READ_LE_UINT32(ptr); ptr += 4; } return; @@ -371,8 +371,8 @@ void ScummEngine::readRoomsOffsets() { num = _fileHandle.readByte(); while (num--) { room = _fileHandle.readByte(); - if (_roomFileOffsets[room] != 0xFFFFFFFF) { - _roomFileOffsets[room] = _fileHandle.readUint32LE(); + if (res.roomoffs[rtRoom][room] != 0xFFFFFFFF) { + res.roomoffs[rtRoom][room] = _fileHandle.readUint32LE(); } else { _fileHandle.readUint32LE(); } diff --git a/scumm/script.cpp b/scumm/script.cpp index 9646cce2a3..040ccf9591 100644 --- a/scumm/script.cpp +++ b/scumm/script.cpp @@ -382,7 +382,7 @@ void ScummEngine::getScriptBaseAddress() { break; _scriptOrgPointer = getResourceAddress(rtInventory, idx); assert(idx < _numInventory); - _lastCodePtr = &_baseInventoryItems[idx]; + _lastCodePtr = &res.address[rtInventory][idx]; break; case WIO_LOCAL: @@ -394,14 +394,14 @@ void ScummEngine::getScriptBaseAddress() { } else { _scriptOrgPointer = getResourceAddress(rtRoom, _roomResource); assert(_roomResource < _numRooms); - _lastCodePtr = &_baseRooms[_roomResource]; + _lastCodePtr = &res.address[rtRoom][_roomResource]; } break; case WIO_GLOBAL: /* global script */ _scriptOrgPointer = getResourceAddress(rtScript, ss->number); assert(ss->number < _numScripts); - _lastCodePtr = &_baseScripts[ss->number]; + _lastCodePtr = &res.address[rtScript][ss->number]; break; case WIO_FLOBJECT: /* flobject script */ @@ -410,7 +410,7 @@ void ScummEngine::getScriptBaseAddress() { idx = _objs[idx].fl_object_index; _scriptOrgPointer = getResourceAddress(rtFlObject, idx); assert(idx < _numFlObject); - _lastCodePtr = &_baseFLObject[idx]; + _lastCodePtr = &res.address[rtFlObject][idx]; break; default: error("Bad type while getting base address"); diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp index ebe31323f4..f20864200b 100644 --- a/scumm/script_v6.cpp +++ b/scumm/script_v6.cpp @@ -474,7 +474,7 @@ void ScummEngine_v6::nukeArray(int a) { } int ScummEngine_v6::findFreeArrayId() { - byte **addr = _baseArrays; + byte **addr = res.address[rtString]; int i; for (i = 1; i < _numArray; i++) { diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp index d5a12743ea..e95ff4e24e 100644 --- a/scumm/script_v72he.cpp +++ b/scumm/script_v72he.cpp @@ -875,7 +875,7 @@ void ScummEngine_v72he::o72_getArrayDimSize() { } void ScummEngine_v72he::o72_getNumFreeArrays() { - byte **addr = _baseArrays; + byte **addr = res.address[rtString]; int i, num = 0; for (i = 1; i < _numArray; i++) { diff --git a/scumm/scumm.h b/scumm/scumm.h index f4b34a570d..9e7e2955b9 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -260,14 +260,6 @@ enum ScummGameId { GID_FREDDI4 }; -#define _baseRooms res.address[rtRoom] -#define _baseScripts res.address[rtScript] -#define _baseInventoryItems res.address[rtInventory] -#define _baseFLObject res.address[rtFlObject] -#define _baseArrays res.address[rtString] - -#define _roomFileOffsets res.roomoffs[rtRoom] - struct SentenceTab { byte verb; byte preposition; |