From 41e82276379f87c74675cc34b682bc69bced865e Mon Sep 17 00:00:00 2001 From: Walter van Niftrik Date: Sat, 26 Mar 2016 14:29:26 +0100 Subject: ADL: Set room description in hires1 --- engines/adl/hires2.cpp | 51 +++++++++++++++++++++++--------------------------- 1 file changed, 23 insertions(+), 28 deletions(-) (limited to 'engines/adl/hires2.cpp') 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); } -- cgit v1.2.3