Skip to content

Commit

Permalink
ACCESS: Add a check to work around a difference in hardcoded data bet…
Browse files Browse the repository at this point in the history
…ween the CD and the floppy version
  • Loading branch information
Strangerke committed Aug 30, 2014
1 parent aa755b9 commit 2cc6d92
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
18 changes: 11 additions & 7 deletions engines/access/room.cpp
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion engines/access/room.h
Expand Up @@ -191,7 +191,7 @@ class RoomInfo {
Common::Array<ExtraCell> _extraCells;
Common::Array<SoundIdent> _sounds;
public:
RoomInfo(const byte *data, int gameType);
RoomInfo(const byte *data, int gameType, bool isCD);
};

} // End of namespace Access
Expand Down

0 comments on commit 2cc6d92

Please sign in to comment.