Skip to content

Commit

Permalink
ADL: Load hires2 global pics
Browse files Browse the repository at this point in the history
  • Loading branch information
waltervn committed Jun 6, 2016
1 parent bd588d9 commit 42c41b4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions engines/adl/hires2.cpp
Expand Up @@ -38,6 +38,10 @@ DataBlockPtr HiRes2Engine::readDataBlockPtr(Common::ReadStream &f) const {
byte sector = f.readByte();
byte offset = f.readByte();
byte size = f.readByte();

if (f.eos() || f.err())
error("Error reading DataBlockPtr");

return _disk.getDataBlock(track, sector, offset, size);
}

Expand Down Expand Up @@ -97,6 +101,16 @@ void HiRes2Engine::init() {
_messageIds.itemNotHere = IDI_HR2_MSG_ITEM_NOT_HERE;
_messageIds.thanksForPlaying = IDI_HR2_MSG_THANKS_FOR_PLAYING;

// Load global picture data
stream.reset(_disk.createReadStream(0x19, 0xa, 0x80, 0));
byte picNr;
while ((picNr = stream->readByte()) != 0xff) {
if (stream->eos() || stream->err())
error("Error reading global pic list");

_pictures[picNr] = readDataBlockPtr(*stream);
}

// Load item picture data
stream.reset(_disk.createReadStream(0x1e, 0x9, 0x05));
for (uint i = 0; i < IDI_HR2_NUM_ITEM_PICS; ++i) {
Expand Down

0 comments on commit 42c41b4

Please sign in to comment.