From 6f550d419a7d3d341f4d32598ec8b18f12859094 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Mon, 18 Apr 2005 07:30:26 +0000 Subject: Add work around for inveotry background/items in putttime/puttzoo not always been drawn. svn-id: r17663 --- scumm/object.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'scumm') diff --git a/scumm/object.cpp b/scumm/object.cpp index d966f829f8..899e85e06a 100644 --- a/scumm/object.cpp +++ b/scumm/object.cpp @@ -371,7 +371,7 @@ void ScummEngine::drawRoomObject(int i, int arg) { do { a = od->parentstate; if (!od->parent) { - if ((_version <= 6 && !(_features & GF_HUMONGOUS)) || od->fl_object_index == 0) + if (_version <= 6 || od->fl_object_index == 0) drawObject(i, arg); break; } @@ -383,7 +383,21 @@ void ScummEngine::drawRoomObjects(int arg) { int i; const int mask = (_version <= 2) ? 0x8 : 0xF; - if (_gameId == GID_SAMNMAX) { + if (_features & GF_HUMONGOUS) { + // In HE games, normal objects are drawn, followed by FlObjects. + for (i = (_numLocalObjects-1); i > 0; i--) + if (_objs[i].obj_nr > 0 && (_objs[i].state & mask) && _objs[i].fl_object_index == 0) + drawRoomObject(i, arg); + } + // HACK: Reverse order is required to draw inventory background and items + // in correct order in putttime/puttzoo. Otherwise the inventory background + // is drawn over the items. But this doesn't match original, maybe masking + // issue somewhere? + for (i = 1; i < _numLocalObjects; i++) { + if (_objs[i].obj_nr > 0 && (_objs[i].state & mask) && _objs[i].fl_object_index != 0) + drawRoomObject(i, arg); + } + if (_gameId == GID_SAMNMAX || _heversion >= 72) { // In Sam & Max, objects are drawn in reverse order. for (i = 1; i < _numLocalObjects; i++) if (_objs[i].obj_nr > 0) -- cgit v1.2.3