diff options
author | Eugene Sandulenko | 2004-09-18 23:48:48 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2004-09-18 23:48:48 +0000 |
commit | 4869c2f9c1fe850b57e520b7001e6eebd5a3bd14 (patch) | |
tree | d9ab4bce2466c4808f83244bd8ae4840f0468c70 | |
parent | c7ba97b18231ecbf440338bd5286385ab100dc04 (diff) | |
download | scummvm-rg350-4869c2f9c1fe850b57e520b7001e6eebd5a3bd14.tar.gz scummvm-rg350-4869c2f9c1fe850b57e520b7001e6eebd5a3bd14.tar.bz2 scummvm-rg350-4869c2f9c1fe850b57e520b7001e6eebd5a3bd14.zip |
Revert last commit by Fingolfin "removed _heV7RoomIntOffsets".
res.roomoffs[rtRoom] has a nick _roomFileOffsets (by means of #define), and
it gets overwritten in ScummEngine::readRoomsOffsets(). HE games actually
stored those offsets in additional array. Removing it breaks all
HE72+ games badly.
svn-id: r15178
-rw-r--r-- | scumm/resource.cpp | 9 | ||||
-rw-r--r-- | scumm/scumm.h | 1 |
2 files changed, 9 insertions, 1 deletions
diff --git a/scumm/resource.cpp b/scumm/resource.cpp index 3bcc41abdf..45e08eb28c 100644 --- a/scumm/resource.cpp +++ b/scumm/resource.cpp @@ -699,6 +699,9 @@ void ScummEngine::readResTypeList(int id, uint32 tag, const char *name) { } for (i = 0; i < num; i++) { res.roomoffs[id][i] = _fileHandle.readUint32LE(); + + if (id == rtRoom && _heversion >= 70) + _heV7RoomIntOffsets[i] = res.roomoffs[id][i]; } if (_heversion >= 70) { @@ -730,6 +733,9 @@ void ScummEngine::allocResTypeData(int id, uint32 tag, int num, const char *name if (_heversion >= 70) { res.globsize[id] = (uint32 *)calloc(num, sizeof(uint32)); + + if (id == rtRoom) + _heV7RoomIntOffsets = (uint32 *)calloc(num, sizeof(uint32)); } } @@ -826,7 +832,7 @@ int ScummEngine::loadResource(int type, int idx) { if (_version == 8) fileOffs = 8; else if (_heversion >= 70) - fileOffs = res.roomoffs[type][idx]; + fileOffs = _heV7RoomIntOffsets[idx]; else fileOffs = 0; } else { @@ -2180,6 +2186,7 @@ void ScummEngine::freeResources() { free(res.globsize[i]); } if (_heversion >= 70) { + free(_heV7RoomIntOffsets); free(_heV7RoomOffsets); } } diff --git a/scumm/scumm.h b/scumm/scumm.h index 79a5a01419..f4b34a570d 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -665,6 +665,7 @@ protected: uint32 _allocatedSize; byte _expire_counter; byte *_heV7RoomOffsets; + uint32 *_heV7RoomIntOffsets; const byte *_resourceLastSearchBuf; // FIXME: need to put it to savefile? uint32 _resourceLastSearchSize; // FIXME: need to put it to savefile? int _wizNumPolygons; |