Skip to content

Commit

Permalink
ADL: Load hires2 items
Browse files Browse the repository at this point in the history
  • Loading branch information
waltervn committed Jun 6, 2016
1 parent 46528f2 commit df4daf9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
26 changes: 26 additions & 0 deletions engines/adl/hires2.cpp
Expand Up @@ -120,6 +120,32 @@ void HiRes2Engine::initState() {
f.readByte(); // always 1, possibly disk?
_state.rooms.push_back(room);
}

_state.items.clear();
f.seek(IDI_HR2_OFS_ITEMS);
while (f.readByte() != 0xff) {
Item item;
item.noun = f.readByte();
item.room = f.readByte();
item.picture = f.readByte();
item.isLineArt = f.readByte(); // Is this still used in this way?
item.position.x = f.readByte();
item.position.y = f.readByte();
item.state = f.readByte();
item.description = f.readByte();

f.readByte();

byte size = f.readByte();

for (uint i = 0; i < size; ++i)
item.roomPictures.push_back(f.readByte());

_state.items.push_back(item);

// One unknown extra byte compared to hires1
f.readByte();
}
}

void HiRes2Engine::loadRoom(byte roomNr) {
Expand Down
1 change: 1 addition & 0 deletions engines/adl/hires2.h
Expand Up @@ -46,6 +46,7 @@ namespace Adl {
#define IDI_HR2_OFS_NOUNS TS(0x22, 0x2)
#define IDI_HR2_OFS_ROOMS TSO(0x21, 0x5, 0x0e) // Skip bogus room 0
#define IDI_HR2_OFS_MESSAGES TSO(0x1f, 0x2, 0x04) // Skip bogus message 0
#define IDI_HR2_OFS_ITEMS T(0x21)

#define IDI_HR2_OFS_CMDS_0 TS(0x1f, 0x7)
#define IDI_HR2_OFS_CMDS_1 TS(0x1d, 0x7)
Expand Down

0 comments on commit df4daf9

Please sign in to comment.