From bd588d96155d2b8626d8f760d4bb41fba60efc8e Mon Sep 17 00:00:00 2001 From: Walter van Niftrik Date: Sat, 26 Mar 2016 16:27:51 +0100 Subject: ADL: Use HashMaps for room/global pics --- engines/adl/hires1.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'engines/adl/hires1.cpp') diff --git a/engines/adl/hires1.cpp b/engines/adl/hires1.cpp index b191afd12c..4161bfed05 100644 --- a/engines/adl/hires1.cpp +++ b/engines/adl/hires1.cpp @@ -166,13 +166,11 @@ void HiRes1Engine::init() { // Load picture data from executable stream->seek(IDI_HR1_OFS_PICS); - for (uint i = 0; i < IDI_HR1_NUM_PICS; ++i) { - struct Picture pic; + for (uint i = 1; i <= IDI_HR1_NUM_PICS; ++i) { byte block = stream->readByte(); Common::String name = Common::String::format("BLOCK%i", block); uint16 offset = stream->readUint16LE(); - pic.data = _files->getDataBlock(name, offset); - _pictures.push_back(pic); + _pictures[i] = _files->getDataBlock(name, offset); } // Load commands from executable @@ -265,7 +263,7 @@ void HiRes1Engine::restartGame() { } void HiRes1Engine::drawPic(byte pic, Common::Point pos) const { - _graphics->drawPic(*_pictures[pic].data->createReadStream(), pos, 0x7f); + _graphics->drawPic(*_pictures[pic]->createReadStream(), pos, 0x7f); } void HiRes1Engine::printString(const Common::String &str) { -- cgit v1.2.3