diff options
author | Max Horn | 2005-04-03 22:56:02 +0000 |
---|---|---|
committer | Max Horn | 2005-04-03 22:56:02 +0000 |
commit | 3feadcac28466679ce6559877e9144f6410c6ddd (patch) | |
tree | 999d544d281fb91ba40ff24491778e5ddce39239 | |
parent | 1419f0d5ef32d8ae811b567616070cf916792320 (diff) | |
download | scummvm-rg350-3feadcac28466679ce6559877e9144f6410c6ddd.tar.gz scummvm-rg350-3feadcac28466679ce6559877e9144f6410c6ddd.tar.bz2 scummvm-rg350-3feadcac28466679ce6559877e9144f6410c6ddd.zip |
Turned readRoomsOffsets into a virtual method
svn-id: r17363
-rw-r--r-- | scumm/intern.h | 15 | ||||
-rw-r--r-- | scumm/resource.cpp | 18 | ||||
-rw-r--r-- | scumm/resource_v3.cpp | 3 | ||||
-rw-r--r-- | scumm/resource_v7he.cpp | 16 | ||||
-rw-r--r-- | scumm/scumm.h | 2 |
5 files changed, 37 insertions, 17 deletions
diff --git a/scumm/intern.h b/scumm/intern.h index f27b314e35..df813bb47c 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -187,6 +187,9 @@ protected: void o5_walkActorToObject(); }; +/** + * Engine for version 4 SCUMM games; GF_SMALL_HEADER is always set for these. + */ class ScummEngine_v4 : public ScummEngine_v5 { public: ScummEngine_v4(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16]); @@ -202,14 +205,21 @@ protected: void setupRoomObject(ObjectData *od, const byte *room, const byte *searchptr = NULL); }; +/** + * Engine for version 3 SCUMM games; GF_SMALL_NAMES is always set for these. + */ class ScummEngine_v3 : public ScummEngine_v4 { public: ScummEngine_v3(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16]); protected: + void readRoomsOffsets(); void loadCharset(int no); }; +/** + * Engine for old format version 3 SCUMM games; GF_OLD_BUNDLE is always set for these. + */ class ScummEngine_v3old : public ScummEngine_v3 { public: ScummEngine_v3old(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16]); @@ -221,6 +231,9 @@ protected: void loadRoomObjects(); }; +/** + * Engine for version 2 SCUMM games. + */ class ScummEngine_v2 : public ScummEngine_v3old { protected: void readIndexFile(); @@ -674,6 +687,8 @@ protected: virtual void executeOpcode(byte i); virtual const char *getOpcodeDesc(byte i); + void readRoomsOffsets(); + virtual void redrawBGAreas(); int getStringCharWidth(byte chr); diff --git a/scumm/resource.cpp b/scumm/resource.cpp index 489f5636a3..f5bbf7d04b 100644 --- a/scumm/resource.cpp +++ b/scumm/resource.cpp @@ -160,6 +160,7 @@ void ScummEngine::openRoom(int room) { return; if (_features & GF_EXTERNAL_CHARSET && room >= roomlimit) return; + deleteRoomOffsets(); readRoomsOffsets(); _fileOffset = res.roomoffs[rtRoom][room]; @@ -205,25 +206,10 @@ void ScummEngine::deleteRoomOffsets() { /** Read room offsets */ void ScummEngine::readRoomsOffsets() { - int num, room, i; - byte *ptr; + int num, room; debug(9, "readRoomOffsets()"); - deleteRoomOffsets(); - if (_features & GF_SMALL_NAMES) - return; - - if (_heversion >= 70) { // Windows titles - num = READ_LE_UINT16(_heV7RoomOffsets); - ptr = _heV7RoomOffsets + 2; - for (i = 0; i < num; i++) { - res.roomoffs[rtRoom][i] = READ_LE_UINT32(ptr); - ptr += 4; - } - return; - } - if (!(_features & GF_SMALL_HEADER)) { if (!_dynamicRoomOffsets) return; diff --git a/scumm/resource_v3.cpp b/scumm/resource_v3.cpp index 7f19ac0352..4211274a55 100644 --- a/scumm/resource_v3.cpp +++ b/scumm/resource_v3.cpp @@ -97,6 +97,9 @@ void ScummEngine_v3old::readIndexFile() { closeRoom(); } +void ScummEngine_v3::readRoomsOffsets() { +} + void ScummEngine_v3::loadCharset(int no) { uint32 size; memset(_charsetData, 0, sizeof(_charsetData)); diff --git a/scumm/resource_v7he.cpp b/scumm/resource_v7he.cpp index 6e6386d45b..7efcd1777f 100644 --- a/scumm/resource_v7he.cpp +++ b/scumm/resource_v7he.cpp @@ -1624,4 +1624,20 @@ void MacResExtractor::convertIcons(byte *data, int datasize, byte **cursor, int assert(datasize - dis.pos() == 0); } + + +void ScummEngine_v70he::readRoomsOffsets() { + int num, i; + byte *ptr; + + debug(9, "readRoomOffsets()"); + + num = READ_LE_UINT16(_heV7RoomOffsets); + ptr = _heV7RoomOffsets + 2; + for (i = 0; i < num; i++) { + res.roomoffs[rtRoom][i] = READ_LE_UINT32(ptr); + ptr += 4; + } +} + } // End of namespace Scumm diff --git a/scumm/scumm.h b/scumm/scumm.h index 65648c4e49..1d0606b96b 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -696,7 +696,7 @@ protected: void openRoom(int room); void closeRoom(); void deleteRoomOffsets(); - void readRoomsOffsets(); + virtual void readRoomsOffsets(); void askForDisk(const char *filename, int disknum); bool openResourceFile(const char *filename, byte encByte); |