From 42c41b449587f388796fe6a95a1a68027da629f9 Mon Sep 17 00:00:00 2001 From: Walter van Niftrik Date: Sat, 26 Mar 2016 17:56:55 +0100 Subject: ADL: Load hires2 global pics --- engines/adl/hires2.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'engines/adl') diff --git a/engines/adl/hires2.cpp b/engines/adl/hires2.cpp index f6818a6638..1e06135278 100644 --- a/engines/adl/hires2.cpp +++ b/engines/adl/hires2.cpp @@ -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); } @@ -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) { -- cgit v1.2.3