From 2cc6d9299ae6a7037704dd72eeebc44ab2c3c1b4 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sun, 31 Aug 2014 01:09:29 +0200 Subject: ACCESS: Add a check to work around a difference in hardcoded data between the CD and the floppy version --- engines/access/room.cpp | 18 +++++++++++------- engines/access/room.h | 2 +- 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'engines/access') diff --git a/engines/access/room.cpp b/engines/access/room.cpp index c26a811225..3696a4cadf 100644 --- a/engines/access/room.cpp +++ b/engines/access/room.cpp @@ -162,7 +162,7 @@ void Room::clearRoom() { } void Room::loadRoomData(const byte *roomData) { - RoomInfo roomInfo(roomData, _vm->getGameID()); + RoomInfo roomInfo(roomData, _vm->getGameID(), _vm->isCD()); _roomFlag = roomInfo._roomFlag; @@ -734,14 +734,19 @@ bool Room::checkCode(int v1, int v2) { /*------------------------------------------------------------------------*/ -RoomInfo::RoomInfo(const byte *data, int gameType) { +RoomInfo::RoomInfo(const byte *data, int gameType, bool isCD) { Common::MemoryReadStream stream(data, 999); _roomFlag = stream.readByte(); - if (gameType != GType_MartianMemorandum) - _estIndex = stream.readSint16LE(); - else + if (gameType == GType_Amazon) { + if (isCD) + _estIndex = stream.readSint16LE(); + else { + _estIndex = -1; + stream.readSint16LE(); + } + } else _estIndex = -1; _musicFile.load(stream); @@ -779,8 +784,7 @@ RoomInfo::RoomInfo(const byte *data, int gameType) { _extraCells.push_back(ec); } - for (int16 fileNum = stream.readSint16LE(); fileNum != -1; - fileNum = stream.readSint16LE()) { + for (int16 fileNum = stream.readSint16LE(); fileNum != -1; fileNum = stream.readSint16LE()) { SoundIdent fi; fi._fileNum = fileNum; fi._subfile = stream.readUint16LE(); diff --git a/engines/access/room.h b/engines/access/room.h index 321ace4fd1..fdeccc87c8 100644 --- a/engines/access/room.h +++ b/engines/access/room.h @@ -191,7 +191,7 @@ public: Common::Array _extraCells; Common::Array _sounds; public: - RoomInfo(const byte *data, int gameType); + RoomInfo(const byte *data, int gameType, bool isCD); }; } // End of namespace Access -- cgit v1.2.3