diff options
author | Walter van Niftrik | 2016-04-03 19:26:34 +0200 |
---|---|---|
committer | Walter van Niftrik | 2016-06-06 20:35:49 +0200 |
commit | bc0fc246f047415837d7c7bccf82918303fcccaf (patch) | |
tree | 56fadc08e5847e161f587017767903997574ba4c /engines/adl/hires1.cpp | |
parent | ed0653e3939a8a9dbfac873a23c40da2c00ab81b (diff) | |
download | scummvm-rg350-bc0fc246f047415837d7c7bccf82918303fcccaf.tar.gz scummvm-rg350-bc0fc246f047415837d7c7bccf82918303fcccaf.tar.bz2 scummvm-rg350-bc0fc246f047415837d7c7bccf82918303fcccaf.zip |
ADL: Implement hires2 screen update routine
Diffstat (limited to 'engines/adl/hires1.cpp')
-rw-r--r-- | engines/adl/hires1.cpp | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/engines/adl/hires1.cpp b/engines/adl/hires1.cpp index 1d7e50e123..cca2fe42e5 100644 --- a/engines/adl/hires1.cpp +++ b/engines/adl/hires1.cpp @@ -289,7 +289,35 @@ void HiRes1Engine::printMessage(uint idx) { printString(msg); } -void HiRes1Engine::drawItem(const Item &item, const Common::Point &pos) const { +void HiRes1Engine::drawItems() { + Common::List<Item>::iterator item; + + uint dropped = 0; + + for (item = _state.items.begin(); item != _state.items.end(); ++item) { + // Skip items not in this room + if (item->room != _state.room) + continue; + + if (item->state == IDI_ITEM_DROPPED) { + // Draw dropped item if in normal view + if (getCurRoom().picture == getCurRoom().curPicture) + drawItem(*item, _itemOffsets[dropped++]); + } else { + // Draw fixed item if current view is in the pic list + Common::Array<byte>::const_iterator pic; + + for (pic = item->roomPictures.begin(); pic != item->roomPictures.end(); ++pic) { + if (*pic == getCurRoom().curPicture) { + drawItem(*item, item->position); + break; + } + } + } + } +} + +void HiRes1Engine::drawItem(Item &item, const Common::Point &pos) { if (item.isLineArt) { StreamPtr stream(_corners[item.picture - 1]->createReadStream()); static_cast<Graphics_v1 *>(_graphics)->drawCorners(*stream, pos); @@ -302,6 +330,9 @@ void HiRes1Engine::loadRoom(byte roomNr) { } void HiRes1Engine::showRoom() { + clearScreen(); + loadRoom(_state.room); + if (!_state.isDark) { drawPic(getCurRoom().curPicture); drawItems(); |