diff options
author | Max Horn | 2005-04-10 00:33:31 +0000 |
---|---|---|
committer | Max Horn | 2005-04-10 00:33:31 +0000 |
commit | 78f2f279c40b9ff34b2afcd728a15399b823f57f (patch) | |
tree | e457df95d32e50726657009aa0f9073b2f9dd3c4 /scumm | |
parent | 03616ad2c89fffcb7eb49124be060f978ae176f2 (diff) | |
download | scummvm-rg350-78f2f279c40b9ff34b2afcd728a15399b823f57f.tar.gz scummvm-rg350-78f2f279c40b9ff34b2afcd728a15399b823f57f.tar.bz2 scummvm-rg350-78f2f279c40b9ff34b2afcd728a15399b823f57f.zip |
Got rid of _dynamicRoomOffsets
svn-id: r17494
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/resource.cpp | 21 | ||||
-rw-r--r-- | scumm/resource_v4.cpp | 3 | ||||
-rw-r--r-- | scumm/resource_v7he.cpp | 3 | ||||
-rw-r--r-- | scumm/scumm.cpp | 1 | ||||
-rw-r--r-- | scumm/scumm.h | 1 |
5 files changed, 9 insertions, 20 deletions
diff --git a/scumm/resource.cpp b/scumm/resource.cpp index a884f4609f..0eacd914e8 100644 --- a/scumm/resource.cpp +++ b/scumm/resource.cpp @@ -187,9 +187,6 @@ void ScummEngine::closeRoom() { /** Delete the currently loaded room offsets. */ void ScummEngine::deleteRoomOffsets() { - if (!(_features & GF_SMALL_HEADER) && !_dynamicRoomOffsets) - return; - for (int i = 0; i < _numRooms; i++) { if (res.roomoffs[rtRoom][i] != 0xFFFFFFFF) res.roomoffs[rtRoom][i] = 0; @@ -202,13 +199,10 @@ void ScummEngine::readRoomsOffsets() { debug(9, "readRoomOffsets()"); - if (!(_features & GF_SMALL_HEADER)) { - if (!_dynamicRoomOffsets) - return; - - _fileHandle->seek(16, SEEK_SET); - } else { + if (_features & GF_SMALL_HEADER) { _fileHandle->seek(12, SEEK_SET); // Directly searching for the room offset block would be more generic... + } else { + _fileHandle->seek(16, SEEK_SET); } num = _fileHandle->readByte(); @@ -289,7 +283,7 @@ void ScummEngine::readIndexFile() { openRoom(0); if (_version <= 5) { - /* Figure out the sizes of various resources */ + // Figure out the sizes of various resources while (!_fileHandle->eof()) { blocktype = fileReadDword(); itemsize = _fileHandle->readUint32BE(); @@ -347,7 +341,8 @@ void ScummEngine::readIndexFile() { break; case MKID('RNAM'): - // Names of rooms + // Names of rooms. Maybe we should read them and put them + // into a table, for use by the debugger? _fileHandle->seek(itemsize - 8, SEEK_CUR); debug(9, "found RNAM block, skipping"); break; @@ -991,7 +986,6 @@ void ScummEngine_v5::readMAXS(int blockSize) { _shadowPalette = (byte *)calloc(_shadowPaletteSize, 1); allocateArrays(); - _dynamicRoomOffsets = true; } void ScummEngine_v8::readMAXS(int blockSize) { @@ -1023,7 +1017,6 @@ void ScummEngine_v8::readMAXS(int blockSize) { _shadowPalette = (byte *)calloc(_shadowPaletteSize, 1); allocateArrays(); - _dynamicRoomOffsets = true; } void ScummEngine_v7::readMAXS(int blockSize) { @@ -1058,7 +1051,6 @@ void ScummEngine_v7::readMAXS(int blockSize) { _shadowPalette = (byte *)calloc(_shadowPaletteSize, 1); allocateArrays(); - _dynamicRoomOffsets = true; } void ScummEngine_v6::readMAXS(int blockSize) { @@ -1092,7 +1084,6 @@ void ScummEngine_v6::readMAXS(int blockSize) { _shadowPalette = (byte *)calloc(_shadowPaletteSize, 1); allocateArrays(); - _dynamicRoomOffsets = true; } void ScummEngine::readGlobalObjects() { diff --git a/scumm/resource_v4.cpp b/scumm/resource_v4.cpp index f7cc007d2a..d73ac93acf 100644 --- a/scumm/resource_v4.cpp +++ b/scumm/resource_v4.cpp @@ -38,6 +38,7 @@ void ScummEngine_v4::readIndexFile() { openRoom(0); while (!_fileHandle->eof()) { + // Figure out the sizes of various resources itemsize = _fileHandle->readUint32LE(); blocktype = _fileHandle->readUint16LE(); if (_fileHandle->ioFailed()) @@ -89,6 +90,8 @@ void ScummEngine_v4::readIndexFile() { switch (blocktype) { case 0x4E52: // 'NR' + // Names of rooms. Maybe we should read them and put them + // into a table, for use by the debugger? _fileHandle->seek(itemsize - 6, SEEK_CUR); break; diff --git a/scumm/resource_v7he.cpp b/scumm/resource_v7he.cpp index ced6b0758a..fd092ba90f 100644 --- a/scumm/resource_v7he.cpp +++ b/scumm/resource_v7he.cpp @@ -1688,7 +1688,6 @@ void ScummEngine_v99he::readMAXS(int blockSize) { _numGlobalScripts = 2048; allocateArrays(); - _dynamicRoomOffsets = true; } void ScummEngine_v90he::readMAXS(int blockSize) { @@ -1722,7 +1721,6 @@ void ScummEngine_v90he::readMAXS(int blockSize) { _numGlobalScripts = 200; allocateArrays(); - _dynamicRoomOffsets = true; } void ScummEngine_v72he::readMAXS(int blockSize) { @@ -1750,7 +1748,6 @@ void ScummEngine_v72he::readMAXS(int blockSize) { _numGlobalScripts = 200; allocateArrays(); - _dynamicRoomOffsets = true; } byte *ScummEngine_v72he::getStringAddress(int i) { diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp index ad45b72486..8c675c871f 100644 --- a/scumm/scumm.cpp +++ b/scumm/scumm.cpp @@ -774,7 +774,6 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS _keyScriptKey = 0; _keyScriptNo = 0; _fileOffset = 0; - _dynamicRoomOffsets = false; memset(_resourceMapper, 0, sizeof(_resourceMapper)); _lastLoadedRoom = 0; _roomResource = 0; diff --git a/scumm/scumm.h b/scumm/scumm.h index 729e7d4266..7ac7002bf4 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -683,7 +683,6 @@ protected: int _resourceHeaderSize; Common::String _gameName; // This is the name we use for opening resource files Common::String _targetName; // This is the game the user calls it, so use for saving - bool _dynamicRoomOffsets; byte _resourceMapper[128]; byte *_heV7DiskOffsets; byte *_heV7RoomOffsets; |