From e98555249e2cef4665dfb7f937f7fa08d1a40dd4 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Wed, 15 Feb 2006 23:04:48 +0000 Subject: Read correct index by block size in HE games again, to help track down unknown versions. svn-id: r20709 --- engines/scumm/resource.cpp | 56 ++++++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/engines/scumm/resource.cpp b/engines/scumm/resource.cpp index c916183b9e..42599dc3d0 100644 --- a/engines/scumm/resource.cpp +++ b/engines/scumm/resource.cpp @@ -1233,35 +1233,37 @@ void ScummEngine_v7::readMAXS(int blockSize) { #endif void ScummEngine_v6::readMAXS(int blockSize) { - debug(0, "ScummEngine_v6 readMAXS: MAXS has blocksize %d", blockSize); + if (blockSize == 38) { + debug(0, "ScummEngine_v6 readMAXS: MAXS has blocksize %d", blockSize); + + _numVariables = _fileHandle->readUint16LE(); + _fileHandle->readUint16LE(); + _numBitVariables = _fileHandle->readUint16LE(); + _numLocalObjects = _fileHandle->readUint16LE(); + _numArray = _fileHandle->readUint16LE(); + _fileHandle->readUint16LE(); + _numVerbs = _fileHandle->readUint16LE(); + _numFlObject = _fileHandle->readUint16LE(); + _numInventory = _fileHandle->readUint16LE(); + _numRooms = _fileHandle->readUint16LE(); + _numScripts = _fileHandle->readUint16LE(); + _numSounds = _fileHandle->readUint16LE(); + _numCharsets = _fileHandle->readUint16LE(); + _numCostumes = _fileHandle->readUint16LE(); + _numGlobalObjects = _fileHandle->readUint16LE(); + _numNewNames = 50; + + _objectRoomTable = NULL; + _numGlobalScripts = 200; - _numVariables = _fileHandle->readUint16LE(); - _fileHandle->readUint16LE(); - _numBitVariables = _fileHandle->readUint16LE(); - _numLocalObjects = _fileHandle->readUint16LE(); - _numArray = _fileHandle->readUint16LE(); - _fileHandle->readUint16LE(); - _numVerbs = _fileHandle->readUint16LE(); - _numFlObject = _fileHandle->readUint16LE(); - _numInventory = _fileHandle->readUint16LE(); - _numRooms = _fileHandle->readUint16LE(); - _numScripts = _fileHandle->readUint16LE(); - _numSounds = _fileHandle->readUint16LE(); - _numCharsets = _fileHandle->readUint16LE(); - _numCostumes = _fileHandle->readUint16LE(); - _numGlobalObjects = _fileHandle->readUint16LE(); - _numNewNames = 50; - - _objectRoomTable = NULL; - _numGlobalScripts = 200; - - if (_heversion >= 70) { - _objectRoomTable = (byte *)calloc(_numGlobalObjects, 1); - } + if (_heversion >= 70) { + _objectRoomTable = (byte *)calloc(_numGlobalObjects, 1); + } - if (_heversion <= 70) { - _shadowPaletteSize = 256; - _shadowPalette = (byte *)calloc(_shadowPaletteSize, 1); + if (_heversion <= 70) { + _shadowPaletteSize = 256; + _shadowPalette = (byte *)calloc(_shadowPaletteSize, 1); + } } } -- cgit v1.2.3