From a201b2e506be4adbacb0b7ffa9d40a94a4842e3e Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Tue, 10 Aug 2010 17:16:38 +0000 Subject: SCI: kAddToPic(list) set fixed priority flag svn-id: r51954 --- engines/sci/graphics/animate.cpp | 17 ++++++++++++++--- engines/sci/graphics/animate.h | 1 + 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'engines/sci') diff --git a/engines/sci/graphics/animate.cpp b/engines/sci/graphics/animate.cpp index 1e9beab607..913b369790 100644 --- a/engines/sci/graphics/animate.cpp +++ b/engines/sci/graphics/animate.cpp @@ -518,6 +518,19 @@ void GfxAnimate::reAnimate(Common::Rect rect) { } } +void GfxAnimate::preprocessAddToPicList() { + AnimateList::iterator it; + const AnimateList::iterator end = _list.end(); + + for (it = _list.begin(); it != end; ++it) { + if (it->priority == -1) + it->priority = _ports->kernelCoordinateToPriority(it->y); + + // Do not allow priority to get changed by fill() + it->signal |= kSignalFixedPriority; + } +} + void GfxAnimate::addToPicDrawCels() { reg_t curObject; GfxView *view = NULL; @@ -527,9 +540,6 @@ void GfxAnimate::addToPicDrawCels() { for (it = _list.begin(); it != end; ++it) { curObject = it->object; - if (it->priority == -1) - it->priority = _ports->kernelCoordinateToPriority(it->y); - // Get the corresponding view view = _cache->getView(it->viewId); @@ -687,6 +697,7 @@ void GfxAnimate::kernelAddToPicList(reg_t listReference, int argc, reg_t *argv) error("kAddToPic called with non-list as parameter"); makeSortedList(list); + preprocessAddToPicList(); fill(tempPicNotValid); addToPicDrawCels(); diff --git a/engines/sci/graphics/animate.h b/engines/sci/graphics/animate.h index 7e82187eed..c2101e5384 100644 --- a/engines/sci/graphics/animate.h +++ b/engines/sci/graphics/animate.h @@ -100,6 +100,7 @@ public: void updateScreen(byte oldPicNotValid); void restoreAndDelete(int argc, reg_t *argv); void reAnimate(Common::Rect rect); + void preprocessAddToPicList(); void addToPicDrawCels(); void addToPicDrawView(GuiResourceId viewId, int16 loopNo, int16 celNo, int16 leftPos, int16 topPos, int16 priority, int16 control); -- cgit v1.2.3