diff options
author | Max Horn | 2003-04-28 13:35:36 +0000 |
---|---|---|
committer | Max Horn | 2003-04-28 13:35:36 +0000 |
commit | 6ae1ed74171ec1fa0a925a7e8c5cad0078f8e8a7 (patch) | |
tree | 392b70b517c91a00e99124207e0a725726ab2a37 /scumm | |
parent | e13e117976dda789d806818add34773dbdd57bb7 (diff) | |
download | scummvm-rg350-6ae1ed74171ec1fa0a925a7e8c5cad0078f8e8a7.tar.gz scummvm-rg350-6ae1ed74171ec1fa0a925a7e8c5cad0078f8e8a7.tar.bz2 scummvm-rg350-6ae1ed74171ec1fa0a925a7e8c5cad0078f8e8a7.zip |
hack to fix entry script dumping in GF_OLD_BUNDLE (post V2) games
svn-id: r7178
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/scummvm.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp index c055eb302e..21a1c9d570 100644 --- a/scumm/scummvm.cpp +++ b/scumm/scummvm.cpp @@ -949,17 +949,26 @@ void Scumm::initRoomSubBlocks() { // // Look for an entry script // - if (_features & GF_AFTER_V2) + int ENCD_len = -1; + if (_features & GF_AFTER_V2) { _ENCD_offs = READ_LE_UINT16(roomptr + 0x1A); - else if (_features & GF_OLD_BUNDLE) + } else if (_features & GF_OLD_BUNDLE) { _ENCD_offs = READ_LE_UINT16(roomptr + 0x1B); - else { + // FIXME - the following is a hack which assumes that immediately after + // the entry script the first local script follows. + int num_objects = *(roomResPtr + 20); + int num_sounds = *(roomResPtr + 23); + int num_scripts = *(roomResPtr + 24); + ptr = roomptr + 29 + num_objects * 4 + num_sounds + num_scripts; + if (*ptr) + ENCD_len = READ_LE_UINT16(ptr + 1) - _ENCD_offs + _resourceHeaderSize; // HACK + } else { ptr = findResourceData(MKID('ENCD'), roomResPtr); if (ptr) _ENCD_offs = ptr - roomResPtr; } if (_dumpScripts && _ENCD_offs) - dumpResource("entry-", _roomResource, roomResPtr + _ENCD_offs - _resourceHeaderSize); + dumpResource("entry-", _roomResource, roomResPtr + _ENCD_offs - _resourceHeaderSize, ENCD_len); // // Load box data @@ -1070,9 +1079,7 @@ void Scumm::initRoomSubBlocks() { loadResource(rtSound, *ptr++); while (num_scripts--) loadResource(rtScript, *ptr++); - } - - if (_features & GF_AFTER_V3) { + } else if (_features & GF_AFTER_V3) { num_sounds = *(roomResPtr + 23); num_scripts = *(roomResPtr + 24); ptr = roomptr + 29 + num_objects * 4 + num_sounds + num_scripts; |