diff options
author | Martin Kiewitz | 2010-05-24 15:39:30 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-05-24 15:39:30 +0000 |
commit | e9db62b272409580e45e776d4dfcd358670d6ccd (patch) | |
tree | 67c22df437ecea56e09f8b2c2bc74433d34d396b /engines/sci | |
parent | b49efb67f6e6f9d8b8107ec0de82055588fe215f (diff) | |
download | scummvm-rg350-e9db62b272409580e45e776d4dfcd358670d6ccd.tar.gz scummvm-rg350-e9db62b272409580e45e776d4dfcd358670d6ccd.tar.bz2 scummvm-rg350-e9db62b272409580e45e776d4dfcd358670d6ccd.zip |
SCI: sort according to original order in kAnimate, when y and z are the same - fixes iceman half-open compartment in room 35
svn-id: r49189
Diffstat (limited to 'engines/sci')
-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; |