aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMax Horn2007-02-24 19:20:15 +0000
committerMax Horn2007-02-24 19:20:15 +0000
commit04a18dd7c4d381f9d7fdb92793b0b0608c462c6c (patch)
tree60764d2d906af04faaff2cbeeb4d5dc2f857c1ac /engines
parentdcc6e2c0bbda92403aef5849d41d4fe7d521fed7 (diff)
downloadscummvm-rg350-04a18dd7c4d381f9d7fdb92793b0b0608c462c6c.tar.gz
scummvm-rg350-04a18dd7c4d381f9d7fdb92793b0b0608c462c6c.tar.bz2
scummvm-rg350-04a18dd7c4d381f9d7fdb92793b0b0608c462c6c.zip
SCUMM: cleanup (moved small header specific code from ScummEngine::readResTypeList to ScummEngine_v4::readResTypeList)
svn-id: r25827
Diffstat (limited to 'engines')
-rw-r--r--engines/scumm/intern.h1
-rw-r--r--engines/scumm/resource.cpp29
-rw-r--r--engines/scumm/resource_v4.cpp20
3 files changed, 32 insertions, 18 deletions
diff --git a/engines/scumm/intern.h b/engines/scumm/intern.h
index 6e20af2927..0b88969b3c 100644
--- a/engines/scumm/intern.h
+++ b/engines/scumm/intern.h
@@ -214,6 +214,7 @@ public:
virtual void resetScumm();
protected:
+ virtual void readResTypeList(int id, const char *name);
virtual void readIndexFile();
virtual void loadCharset(int no);
virtual void resetRoomObjects();
diff --git a/engines/scumm/resource.cpp b/engines/scumm/resource.cpp
index 8cc54dced2..8d008ad045 100644
--- a/engines/scumm/resource.cpp
+++ b/engines/scumm/resource.cpp
@@ -512,26 +512,19 @@ void ScummEngine::readResTypeList(int id, const char *name) {
error("Invalid number of %ss (%d) in directory", name, num);
}
- if (_game.features & GF_SMALL_HEADER) {
- for (i = 0; i < num; i++) {
- _res->roomno[id][i] = _fileHandle->readByte();
- _res->roomoffs[id][i] = _fileHandle->readUint32LE();
- }
- } else {
- for (i = 0; i < num; i++) {
- _res->roomno[id][i] = _fileHandle->readByte();
- }
- for (i = 0; i < num; i++) {
- _res->roomoffs[id][i] = _fileHandle->readUint32LE();
+ for (i = 0; i < num; i++) {
+ _res->roomno[id][i] = _fileHandle->readByte();
+ }
+ for (i = 0; i < num; i++) {
+ _res->roomoffs[id][i] = _fileHandle->readUint32LE();
- if (id == rtRoom && _game.heversion >= 70)
- _heV7RoomIntOffsets[i] = _res->roomoffs[id][i];
- }
+ if (id == rtRoom && _game.heversion >= 70)
+ _heV7RoomIntOffsets[i] = _res->roomoffs[id][i];
+ }
- if (_game.heversion >= 70) {
- for (i = 0; i < num; i++) {
- _res->globsize[id][i] = _fileHandle->readUint32LE();
- }
+ if (_game.heversion >= 70) {
+ for (i = 0; i < num; i++) {
+ _res->globsize[id][i] = _fileHandle->readUint32LE();
}
}
}
diff --git a/engines/scumm/resource_v4.cpp b/engines/scumm/resource_v4.cpp
index c8c2eb562d..c4dbc5039f 100644
--- a/engines/scumm/resource_v4.cpp
+++ b/engines/scumm/resource_v4.cpp
@@ -30,6 +30,26 @@
namespace Scumm {
+extern const char *resTypeFromId(int id);
+
+void ScummEngine_v4::readResTypeList(int id, const char *name) {
+ int num;
+ int i;
+
+ debug(9, "readResTypeList(%s,%s)", resTypeFromId(id), name);
+
+ num = _fileHandle->readUint16LE();
+
+ if (num != _res->num[id]) {
+ error("Invalid number of %ss (%d) in directory", name, num);
+ }
+
+ for (i = 0; i < num; i++) {
+ _res->roomno[id][i] = _fileHandle->readByte();
+ _res->roomoffs[id][i] = _fileHandle->readUint32LE();
+ }
+}
+
void ScummEngine_v4::readIndexFile() {
uint16 blocktype;
uint32 itemsize;