From e7c93489e4f6055c988d048c9c479de3eff94ece Mon Sep 17 00:00:00 2001 From: Walter van Niftrik Date: Sat, 19 Mar 2016 20:19:59 +0100 Subject: ADL: Clean up drawItems() --- engines/adl/adl.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'engines') diff --git a/engines/adl/adl.cpp b/engines/adl/adl.cpp index 1f4ebcd4bb..715d7a8087 100644 --- a/engines/adl/adl.cpp +++ b/engines/adl/adl.cpp @@ -362,24 +362,25 @@ void AdlEngine::drawItems() const { 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) { - const Common::Point &p = _itemOffsets[dropped]; - drawItem(*item, p); + drawItem(*item, _itemOffsets[dropped]); ++dropped; } - continue; - } - - Common::Array::const_iterator pic; + } else { + // Draw fixed item if current view is in the pic list + Common::Array::const_iterator pic; - for (pic = item->roomPictures.begin(); pic != item->roomPictures.end(); ++pic) { - if (matchesCurrentPic(*pic)) { - drawItem(*item, item->position); - continue; + for (pic = item->roomPictures.begin(); pic != item->roomPictures.end(); ++pic) { + if (matchesCurrentPic(*pic)) { + drawItem(*item, item->position); + break; + } } } } -- cgit v1.2.3