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
This commit is contained in:
Eugene Sandulenko 2004-09-18 23:48:48 +00:00
parent c7ba97b182
commit 4869c2f9c1
2 changed files with 9 additions and 1 deletions

View file

@ -699,6 +699,9 @@ void ScummEngine::readResTypeList(int id, uint32 tag, const char *name) {
} }
for (i = 0; i < num; i++) { for (i = 0; i < num; i++) {
res.roomoffs[id][i] = _fileHandle.readUint32LE(); res.roomoffs[id][i] = _fileHandle.readUint32LE();
if (id == rtRoom && _heversion >= 70)
_heV7RoomIntOffsets[i] = res.roomoffs[id][i];
} }
if (_heversion >= 70) { if (_heversion >= 70) {
@ -730,6 +733,9 @@ void ScummEngine::allocResTypeData(int id, uint32 tag, int num, const char *name
if (_heversion >= 70) { if (_heversion >= 70) {
res.globsize[id] = (uint32 *)calloc(num, sizeof(uint32)); 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) if (_version == 8)
fileOffs = 8; fileOffs = 8;
else if (_heversion >= 70) else if (_heversion >= 70)
fileOffs = res.roomoffs[type][idx]; fileOffs = _heV7RoomIntOffsets[idx];
else else
fileOffs = 0; fileOffs = 0;
} else { } else {
@ -2180,6 +2186,7 @@ void ScummEngine::freeResources() {
free(res.globsize[i]); free(res.globsize[i]);
} }
if (_heversion >= 70) { if (_heversion >= 70) {
free(_heV7RoomIntOffsets);
free(_heV7RoomOffsets); free(_heV7RoomOffsets);
} }
} }

View file

@ -665,6 +665,7 @@ protected:
uint32 _allocatedSize; uint32 _allocatedSize;
byte _expire_counter; byte _expire_counter;
byte *_heV7RoomOffsets; byte *_heV7RoomOffsets;
uint32 *_heV7RoomIntOffsets;
const byte *_resourceLastSearchBuf; // FIXME: need to put it to savefile? const byte *_resourceLastSearchBuf; // FIXME: need to put it to savefile?
uint32 _resourceLastSearchSize; // FIXME: need to put it to savefile? uint32 _resourceLastSearchSize; // FIXME: need to put it to savefile?
int _wizNumPolygons; int _wizNumPolygons;