aboutsummaryrefslogtreecommitdiff
path: root/scumm/resource.cpp
diff options
context:
space:
mode:
authorTravis Howell2005-02-14 03:12:41 +0000
committerTravis Howell2005-02-14 03:12:41 +0000
commit40768ac29dc8c02bb5815e331f2fb72167657ea9 (patch)
tree96fbb9eb25c212b4b3719d08afd9ec720fc1399c /scumm/resource.cpp
parent142a646da0dc44a40a54c6a7a92a0117c6c96d10 (diff)
downloadscummvm-rg350-40768ac29dc8c02bb5815e331f2fb72167657ea9.tar.gz
scummvm-rg350-40768ac29dc8c02bb5815e331f2fb72167657ea9.tar.bz2
scummvm-rg350-40768ac29dc8c02bb5815e331f2fb72167657ea9.zip
Add basic support for DISK index block in later HE games.
svn-id: r16784
Diffstat (limited to 'scumm/resource.cpp')
-rw-r--r--scumm/resource.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/scumm/resource.cpp b/scumm/resource.cpp
index f21b0c6cef..ed92ef0056 100644
--- a/scumm/resource.cpp
+++ b/scumm/resource.cpp
@@ -75,16 +75,27 @@ void ScummEngine::openRoom(int room) {
if (room_offs == -1)
break;
- if (room_offs != 0 && room != 0) {
+ if (room_offs != 0 && room != 0 && _heversion < 98) {
_fileOffset = res.roomoffs[rtRoom][room];
- return;
}
if (!(_features & GF_SMALL_HEADER)) {
if (_heversion >= 70) { // Windows titles
if (_heversion >= 98) {
- sprintf(buf, "%s.%s", _gameName.c_str(), room == 0 ? "he0" : "(a)");
- sprintf(buf2, "%s.(b)", _gameName.c_str());
+ int disk = 0;
+ if (_heV7DiskOffsets)
+ disk = _heV7DiskOffsets[room];
+
+ switch(disk) {
+ case 2:
+ sprintf(buf, "%s.%s", _gameName.c_str(), "(b)");
+ break;
+ case 1:
+ sprintf(buf, "%s.%s", _gameName.c_str(), "(a)");
+ break;
+ default:
+ sprintf(buf, "%s.%s", _gameName.c_str(), "he0");
+ }
} else
sprintf(buf, "%s.he%.1d", _gameName.c_str(), room == 0 ? 0 : 1);
} else if (_version >= 7) {
@@ -424,8 +435,9 @@ void ScummEngine::readIndexFile() {
break;
case MKID('DISK'):
- _fileHandle.seek(itemsize - 8, SEEK_CUR);
- debug(2, "DISK index block not yet handled, skipping");
+ i = _fileHandle.readUint16LE();
+ _heV7DiskOffsets = (byte *)calloc(i, 1);
+ _fileHandle.read(_heV7DiskOffsets, i);
break;
case MKID('INIB'):