diff options
-rw-r--r-- | engines/sci/graphics/animate.cpp | 11 | ||||
-rw-r--r-- | engines/sci/graphics/animate.h | 3 |
2 files changed, 12 insertions, 2 deletions
diff --git a/engines/sci/graphics/animate.cpp b/engines/sci/graphics/animate.cpp index 71c7b7dd7f..8a03c9579b 100644 --- a/engines/sci/graphics/animate.cpp +++ b/engines/sci/graphics/animate.cpp @@ -109,7 +109,15 @@ bool GfxAnimate::invoke(List *list, int argc, reg_t *argv) { } bool sortHelper(const AnimateEntry* entry1, const AnimateEntry* entry2) { - return (entry1->y == entry2->y) ? (entry1->z < entry2->z) : (entry1->y < entry2->y); + if (entry1->y == entry2->y) { + // if both y and z are the same, use the order we were given originally + // this is needed for special cases like iceman room 35 + if (entry1->z == entry2->z) + return entry1->givenOrderNo < entry2->givenOrderNo; + else + return entry1->z < entry2->z; + } + return entry1->y < entry2->y; } void GfxAnimate::makeSortedList(List *list) { @@ -156,6 +164,7 @@ void GfxAnimate::makeSortedList(List *list) { listEntry->object = curObject; // Get data from current object + listEntry->givenOrderNo = listNr; listEntry->viewId = GET_SEL32V(_s->_segMan, curObject, SELECTOR(view)); listEntry->loopNo = GET_SEL32V(_s->_segMan, curObject, SELECTOR(loop)); listEntry->celNo = GET_SEL32V(_s->_segMan, curObject, SELECTOR(cel)); diff --git a/engines/sci/graphics/animate.h b/engines/sci/graphics/animate.h index 2cc59b1767..706b7182cf 100644 --- a/engines/sci/graphics/animate.h +++ b/engines/sci/graphics/animate.h @@ -40,7 +40,7 @@ enum ViewSignals { kSignalAlwaysUpdate = 0x0020, kSignalForceUpdate = 0x0040, kSignalRemoveView = 0x0080, - kSignalFrozen = 0x0100, + kSignalFrozen = 0x0100, // I got frozen today!! kSignalExtraActor = 0x0200, // unused by us, defines all actors that may be included into the background if speed is too slow kSignalHitObstacle = 0x0400, // used in the actor movement code by kDoBresen() kSignalDoesntTurn = 0x0800, // used by _k_dirloop() to determine if an actor can turn or not @@ -57,6 +57,7 @@ enum ViewScaleSignals { }; struct AnimateEntry { + int16 givenOrderNo; reg_t object; GuiResourceId viewId; int16 loopNo; |