From d680b0b02983350c16e106c50aea152eefc6b585 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 1 Aug 2019 19:48:04 -0700 Subject: GLK: Added Blorb mapping to the optional adaptive palette list --- engines/glk/blorb.cpp | 29 ++++++++++++++++++++++++++++- engines/glk/blorb.h | 1 + 2 files changed, 29 insertions(+), 1 deletion(-) (limited to 'engines/glk') diff --git a/engines/glk/blorb.cpp b/engines/glk/blorb.cpp index 849e6866e0..b97ee319c7 100644 --- a/engines/glk/blorb.cpp +++ b/engines/glk/blorb.cpp @@ -162,6 +162,27 @@ Common::ErrorCode Blorb::load() { } } + // Check through any optional remaining chunks for an adaptive palette list + while (f.pos() < f.size()) { + uint chunkId = f.readUint32BE(); + uint chunkSize = f.readUint32BE(); + + if (chunkId == ID_APal) { + // Found one, so create an entry so it can be opened as file named "apal" + ChunkEntry ce; + ce._filename = "apal"; + ce._offset = f.pos(); + ce._size = chunkSize; + ce._type = ID_APal; + _chunks.push_back(ce); + break; + } + + if (chunkSize & 1) + ++chunkSize; + f.skip(chunkSize); + } + return Common::kNoError; } @@ -169,8 +190,9 @@ bool Blorb::readRIdx(Common::SeekableReadStream &stream, Common::Array