From 252e7736e59cdb2c57aa3a67396327d8e82c7742 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Sat, 24 Jul 2010 18:06:49 +0000 Subject: SCI: honor given order of screen items in sci32 fixes gk1 game menu slider controls svn-id: r51252 --- engines/sci/graphics/frameout.cpp | 10 +++++++++- engines/sci/graphics/frameout.h | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'engines') 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 PlaneList; struct FrameoutEntry { + uint16 givenOrderNr; reg_t object; GuiResourceId viewId; int16 loopNo; -- cgit v1.2.3