aboutsummaryrefslogtreecommitdiff
path: root/engines/adl/hires2.cpp
diff options
context:
space:
mode:
authorWalter van Niftrik2016-03-26 17:56:55 +0100
committerWalter van Niftrik2016-06-06 20:35:49 +0200
commit42c41b449587f388796fe6a95a1a68027da629f9 (patch)
tree434789c19e5b6168a954136ed69b0502b0a37db2 /engines/adl/hires2.cpp
parentbd588d96155d2b8626d8f760d4bb41fba60efc8e (diff)
downloadscummvm-rg350-42c41b449587f388796fe6a95a1a68027da629f9.tar.gz
scummvm-rg350-42c41b449587f388796fe6a95a1a68027da629f9.tar.bz2
scummvm-rg350-42c41b449587f388796fe6a95a1a68027da629f9.zip
ADL: Load hires2 global pics
Diffstat (limited to 'engines/adl/hires2.cpp')
-rw-r--r--engines/adl/hires2.cpp14
1 files changed, 14 insertions, 0 deletions
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) {