Skip to content

Commit

Permalink
ACCESS: Fix room data loading for MM
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Aug 21, 2014
1 parent afc41c7 commit 966515a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
12 changes: 6 additions & 6 deletions engines/access/martian/martian_resources.cpp
Expand Up @@ -32,12 +32,12 @@ const char *const FILENAMES[] = {
"R08.AP", "R09.AP", "R10.AP", "R11.AP", "R12.AP", "R13.AP", "R14.AP", "R15.AP",
"R16.AP", "R17.AP", "R18.AP", "R19.AP", "R20.AP", "R21.AP", "R22.AP", "R23.AP",
"R24.AP", "R25.AP", "R26.AP", "R27.AP", "R28.AP", "R29.AP", "R30.AP", "R31.AP",
"R32.AP", "R34.AP", "R35.AP", "R36.AP", "R37.AP", "R38.AP", "R39.AP", "R40.AP",
"TITLE.AP","R42.AP","S01.AP", "R45.AP","SOUND.AP","MUSIC.AP","DEAD.AP","EST.AP",
"W02.AP", "C02.AP", "C05.AP", "C04.AP", "C10.AP", "C03.AP", "C07.AP", "LOVE.AP",
"CAFE.AP","C08.AP", "C18.AP", "C19.AP", "C21.AP", "C23.AP", "C12.AP", "C16.AP",
"CAFE1.AP","C05A.AP","C06.AP","C11.AP", "C13.AP", "C20.AP", "C16A.AP","C09.AP",
"R45.AP", "R46.AP", "R47.AP", "R48.AP", "R49.AP"
"R32.AP", "R33.AP", "R34.AP", "R35.AP", "R36.AP", "R37.AP", "R38.AP", "R39.AP",
"R40.AP","TITLE.AP","R42.AP","S01.AP", "R44.AP", "R45.AP","SOUND.AP","MUSIC.AP",
"DEAD.AP","EST.AP", "W02.AP", "C02.AP", "C05.AP", "C04.AP", "C10.AP", "C03.AP",
"C07.AP", "LOVE.AP","CAFE.AP","C08.AP", "C18.AP", "C19.AP", "C21.AP", "C23.AP",
"C12.AP", "C16.AP","CAFE1.AP","C05A.AP","C06.AP","C11.AP", "C13.AP", "C20.AP",
"C16A.AP","C09.AP", "R45.AP", "R46.AP", "R47.AP", "R48.AP", "R49.AP"
};

const byte MOUSE0[] = {
Expand Down
14 changes: 9 additions & 5 deletions engines/access/room.cpp
Expand Up @@ -159,7 +159,7 @@ void Room::clearRoom() {
}

void Room::loadRoomData(const byte *roomData) {
RoomInfo roomInfo(roomData);
RoomInfo roomInfo(roomData, _vm->getGameID());

_roomFlag = roomInfo._roomFlag;

Expand Down Expand Up @@ -716,11 +716,16 @@ bool Room::checkCode(int v1, int v2) {

/*------------------------------------------------------------------------*/

RoomInfo::RoomInfo(const byte *data) {
RoomInfo::RoomInfo(const byte *data, int gameType) {
Common::MemoryReadStream stream(data, 999);

_roomFlag = stream.readByte();
_estIndex = (int16)stream.readUint16LE();

if (gameType != GType_MartianMemorandum)
_estIndex = (int16)stream.readUint16LE();
else
_estIndex = -1;

_musicFile._fileNum = (int16)stream.readUint16LE();
_musicFile._subfile = stream.readUint16LE();
_scaleH1 = stream.readByte();
Expand Down Expand Up @@ -748,8 +753,7 @@ RoomInfo::RoomInfo(const byte *data) {
_paletteFile._subfile = stream.readUint16LE();
if (_paletteFile._fileNum == -1) {
_startColor = _numColors = 0;
}
else {
} else {
_startColor = stream.readUint16LE();
_numColors = stream.readUint16LE();
}
Expand Down
2 changes: 1 addition & 1 deletion engines/access/room.h
Expand Up @@ -187,7 +187,7 @@ class RoomInfo {
Common::Array<uint32> _vidTable;
Common::Array<SoundIdent> _sounds;
public:
RoomInfo(const byte *data);
RoomInfo(const byte *data, int gameType);
};

} // End of namespace Access
Expand Down

0 comments on commit 966515a

Please sign in to comment.