From 1419f0d5ef32d8ae811b567616070cf916792320 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 3 Apr 2005 22:10:10 +0000 Subject: Split readResTypeList into a normal and a GF_OLD_BUNDLE version; added comments to many of the GF_ feature flags; removed GF_DRAWOBJ_OTHER_ORDER (it was only use by Sam&Max, I switched that to a direct check for Sam&Max) svn-id: r17362 --- scumm/resource_v3.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'scumm/resource_v3.cpp') diff --git a/scumm/resource_v3.cpp b/scumm/resource_v3.cpp index 31a1f7a4e7..7f19ac0352 100644 --- a/scumm/resource_v3.cpp +++ b/scumm/resource_v3.cpp @@ -26,6 +26,36 @@ namespace Scumm { +extern const char *resTypeFromId(int id); + + +void ScummEngine_v3old::readResTypeList(int id, uint32 tag, const char *name) { + int num; + int i; + + debug(9, "readResTypeList(%s,%s,%s)", resTypeFromId(id), tag2str(TO_BE_32(tag)), name); + + num = _fileHandle->readByte(); + + if (num >= 0xFF) { + error("Too many %ss (%d) in directory", name, num); + } + + if (id == rtRoom) { + for (i = 0; i < num; i++) + res.roomno[id][i] = i; + _fileHandle->seek(num, SEEK_CUR); + } else { + for (i = 0; i < num; i++) + res.roomno[id][i] = _fileHandle->readByte(); + } + for (i = 0; i < num; i++) { + res.roomoffs[id][i] = _fileHandle->readUint16LE(); + if (res.roomoffs[id][i] == 0xFFFF) + res.roomoffs[id][i] = 0xFFFFFFFF; + } +} + void ScummEngine_v3old::readIndexFile() { int magic = 0; debug(9, "readIndexFile()"); -- cgit v1.2.3