aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/gui
diff options
context:
space:
mode:
authorMartin Kiewitz2009-10-10 21:38:24 +0000
committerMartin Kiewitz2009-10-10 21:38:24 +0000
commit2d3979ff6e9db470e587eb59517c09b01e078e66 (patch)
treef10a636d29238d597a19f1c10583c27fea5c930e /engines/sci/gui
parent5d0afc45c6f4632574eaa7e0844f1711fe16c7ce (diff)
downloadscummvm-rg350-2d3979ff6e9db470e587eb59517c09b01e078e66.tar.gz
scummvm-rg350-2d3979ff6e9db470e587eb59517c09b01e078e66.tar.bz2
scummvm-rg350-2d3979ff6e9db470e587eb59517c09b01e078e66.zip
SCI/newgui: kAnimate - list is finally sorted according to y and z
svn-id: r44888
Diffstat (limited to 'engines/sci/gui')
-rw-r--r--engines/sci/gui/gui_gfx.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/engines/sci/gui/gui_gfx.cpp b/engines/sci/gui/gui_gfx.cpp
index f6fb5c526b..99bc486b85 100644
--- a/engines/sci/gui/gui_gfx.cpp
+++ b/engines/sci/gui/gui_gfx.cpp
@@ -844,6 +844,10 @@ void SciGuiGfx::AnimateInvoke(List *list, int argc, reg_t *argv) {
}
}
+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 @@ void SciGuiGfx::AnimateMakeSortedList(List *list) {
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) {