diff options
Diffstat (limited to 'engines/adl/hires2.cpp')
-rw-r--r-- | engines/adl/hires2.cpp | 51 |
1 files changed, 23 insertions, 28 deletions
diff --git a/engines/adl/hires2.cpp b/engines/adl/hires2.cpp index dffbd81b67..39f2199e6a 100644 --- a/engines/adl/hires2.cpp +++ b/engines/adl/hires2.cpp @@ -182,29 +182,6 @@ void HiRes2Engine::initState() { } } -void HiRes2Engine::loadRoom(byte roomNr) { - Room &room = getRoom(roomNr); - StreamPtr stream(room.data->createReadStream()); - - uint16 descOffset = stream->readUint16LE(); - uint16 commandOffset = stream->readUint16LE(); - - // There's no picture count. The original engine always checks at most - // five pictures. We use the description offset to bound our search. - uint16 picCount = (descOffset - 4) / 5; - - for (uint i = 0; i < picCount; ++i) { - Picture2 pic; - readPictureMeta(*stream, pic); - _roomData.pictures.push_back(pic); - } - - _roomData.description = readStringAt(*stream, descOffset, 0xff); - - stream->seek(commandOffset); - readCommands(*stream, _roomData.commands); -} - void HiRes2Engine::restartGame() { initState(); } @@ -230,8 +207,30 @@ void HiRes2Engine::drawItem(const Item &item, const Common::Point &pos) const { _graphics->drawPic(*stream, pos, 0); } +void HiRes2Engine::loadRoom(byte roomNr) { + Room &room = getRoom(roomNr); + StreamPtr stream(room.data->createReadStream()); + + uint16 descOffset = stream->readUint16LE(); + uint16 commandOffset = stream->readUint16LE(); + + // There's no picture count. The original engine always checks at most + // five pictures. We use the description offset to bound our search. + uint16 picCount = (descOffset - 4) / 5; + + for (uint i = 0; i < picCount; ++i) { + Picture2 pic; + readPictureMeta(*stream, pic); + _roomData.pictures.push_back(pic); + } + + _roomData.description = readStringAt(*stream, descOffset, 0xff); + + stream->seek(commandOffset); + readCommands(*stream, _roomData.commands); +} + void HiRes2Engine::showRoom() { - loadRoom(_state.room); drawPic(getCurRoom().curPicture, Common::Point()); drawItems(); _display->updateHiResScreen(); @@ -239,10 +238,6 @@ void HiRes2Engine::showRoom() { _linesPrinted = 0; } -void HiRes2Engine::printMessage(uint idx) { - printString(_messages[idx - 1]); -} - Engine *HiRes2Engine_create(OSystem *syst, const AdlGameDescription *gd) { return new HiRes2Engine(syst, gd); } |