diff options
-rw-r--r-- | engines/sci/graphics/frameout.cpp | 10 | ||||
-rw-r--r-- | engines/sci/graphics/frameout.h | 1 |
2 files changed, 10 insertions, 1 deletions
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp index 0ace3c8e62..6f0aa1c428 100644 --- a/engines/sci/graphics/frameout.cpp +++ b/engines/sci/graphics/frameout.cpp @@ -122,7 +122,12 @@ int16 GfxFrameout::kernelGetHighPlanePri() { } bool sortHelper(const FrameoutEntry* entry1, const FrameoutEntry* entry2) { - return (entry1->priority == entry2->priority) ? (entry1->y < entry2->y) : (entry1->priority < entry2->priority); + if (entry1->priority == entry2->priority) { + if (entry1->y == entry2->y) + return (entry1->givenOrderNr < entry2->givenOrderNr); + return (entry1->y < entry2->y); + } + return (entry1->priority < entry2->priority); } bool planeSortHelper(const PlaneEntry &entry1, const PlaneEntry &entry2) { @@ -247,6 +252,7 @@ void GfxFrameout::kernelFrameout() { itemEntry->scaleX = readSelectorValue(_segMan, itemObject, SELECTOR(scaleX)); itemEntry->scaleY = readSelectorValue(_segMan, itemObject, SELECTOR(scaleY)); itemEntry->object = itemObject; + itemEntry->givenOrderNr = itemNr; itemList.push_back(itemEntry); itemEntry++; @@ -282,6 +288,8 @@ void GfxFrameout::kernelFrameout() { // Now display itemlist itemEntry = itemData; +// warning("Plane %s", _segMan->getObjectName(planeObject)); + for (FrameoutList::iterator listIterator = itemList.begin(); listIterator != itemList.end(); listIterator++) { itemEntry = *listIterator; diff --git a/engines/sci/graphics/frameout.h b/engines/sci/graphics/frameout.h index 5adf147c8d..5c42489446 100644 --- a/engines/sci/graphics/frameout.h +++ b/engines/sci/graphics/frameout.h @@ -39,6 +39,7 @@ struct PlaneEntry { typedef Common::List<PlaneEntry> PlaneList; struct FrameoutEntry { + uint16 givenOrderNr; reg_t object; GuiResourceId viewId; int16 loopNo; |