[Scummvm-cvs-logs] SF.net SVN: scummvm:[44888] scummvm/trunk/engines/sci/gui/gui_gfx.cpp

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Sat Oct 10 23:38:24 CEST 2009


Revision: 44888
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44888&view=rev
Author:   m_kiewitz
Date:     2009-10-10 21:38:24 +0000 (Sat, 10 Oct 2009)

Log Message:
-----------
SCI/newgui: kAnimate - list is finally sorted according to y and z

Modified Paths:
--------------
    scummvm/trunk/engines/sci/gui/gui_gfx.cpp

Modified: scummvm/trunk/engines/sci/gui/gui_gfx.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_gfx.cpp	2009-10-10 21:25:21 UTC (rev 44887)
+++ scummvm/trunk/engines/sci/gui/gui_gfx.cpp	2009-10-10 21:38:24 UTC (rev 44888)
@@ -844,6 +844,10 @@
 	}
 }
 
+bool AnimateSortHelper(const GuiAnimateEntry* entry1, const GuiAnimateEntry* entry2) {
+	return (entry1->y == entry2->y) ? (entry1->z < entry2->z) : (entry1->y < entry2->y);
+}
+
 void SciGuiGfx::AnimateMakeSortedList(List *list) {
 	SegManager *segMan = _s->_segMan;
 	reg_t curAddress = list->first;
@@ -903,7 +907,11 @@
 		curNode = _s->_segMan->lookupNode(curAddress);
 	}
 
-	// TODO: Actually we need a sorted list here
+	// Now sort the list according y and z (descending)
+	GuiAnimateList::iterator listBegin = _animateList.begin();
+	GuiAnimateList::iterator listEnd = _animateList.end();
+
+	Common::sort(_animateList.begin(), _animateList.end(), AnimateSortHelper);
 }
 
 void SciGuiGfx::AnimateFill(byte &old_picNotValid) {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list