diff options
author | Martin Kiewitz | 2009-10-08 11:23:53 +0000 |
---|---|---|
committer | Martin Kiewitz | 2009-10-08 11:23:53 +0000 |
commit | 120b6b939267afaecf23e13fca3d94f8b98aee30 (patch) | |
tree | 2fac9b4e99b08e8452c9a2d561dd1e263175e8a5 /engines/sci/gui | |
parent | cce8d2e279cad25e9bc0bffbe94b5da230b9495f (diff) | |
download | scummvm-rg350-120b6b939267afaecf23e13fca3d94f8b98aee30.tar.gz scummvm-rg350-120b6b939267afaecf23e13fca3d94f8b98aee30.tar.bz2 scummvm-rg350-120b6b939267afaecf23e13fca3d94f8b98aee30.zip |
SCI/newgui: kAnimate - _delete invoking implemented
svn-id: r44782
Diffstat (limited to 'engines/sci/gui')
-rw-r--r-- | engines/sci/gui/gui.cpp | 2 | ||||
-rw-r--r-- | engines/sci/gui/gui_gfx.cpp | 23 | ||||
-rw-r--r-- | engines/sci/gui/gui_gfx.h | 2 |
3 files changed, 23 insertions, 4 deletions
diff --git a/engines/sci/gui/gui.cpp b/engines/sci/gui/gui.cpp index 16cfff765c..7c1f278296 100644 --- a/engines/sci/gui/gui.cpp +++ b/engines/sci/gui/gui.cpp @@ -414,7 +414,7 @@ void SciGui::animate(reg_t listReference, bool cycle, int argc, reg_t *argv) { //_gfx->AnimateUpdateScreen(); _screen->copyToScreen(); - _gfx->AnimateRestoreAndDelete(); + _gfx->AnimateRestoreAndDelete(list, argc, argv); _gfx->SetPort(oldPort); } diff --git a/engines/sci/gui/gui_gfx.cpp b/engines/sci/gui/gui_gfx.cpp index 1259814329..dbc7c9f0f0 100644 --- a/engines/sci/gui/gui_gfx.cpp +++ b/engines/sci/gui/gui_gfx.cpp @@ -1076,7 +1076,8 @@ enum { SCI_ANIMATE_MASK_ALWAYSUPDATE = 0x0020, SCI_ANIMATE_MASK_FORCEUPDATE = 0x0040, SCI_ANIMATE_MASK_REMOVEVIEW = 0x0080, - SCI_ANIMATE_MASK_FROZEN = 0x0100 + SCI_ANIMATE_MASK_FROZEN = 0x0100, + SCI_ANIMATE_MASK_DISPOSEME = 0x8000 }; void SciGuiGfx::AnimateInvoke(List *list, int argc, reg_t *argv) { @@ -1259,7 +1260,25 @@ void SciGuiGfx::AnimateDrawCels(List *list) { } } -void SciGuiGfx::AnimateRestoreAndDelete() { +void SciGuiGfx::AnimateRestoreAndDelete(List *list, int argc, reg_t *argv) { + SegManager *segMan = _s->_segMan; + reg_t curAddress = list->first; + Node *curNode = _s->_segMan->lookupNode(curAddress); + reg_t curObject; + uint16 mask; + + while (curNode) { + curObject = curNode->value; + mask = GET_SEL32V(curObject, signal); + if (mask & SCI_ANIMATE_MASK_DISPOSEME) { + // Call .delete_ method of that object + invoke_selector(_s, curObject, _s->_kernel->_selectorCache.delete_, kContinueOnInvalidSelector, argv, argc, __FILE__, __LINE__, 0); + // Lookup node again, since the nodetable it was in may have been reallocated + curNode = _s->_segMan->lookupNode(curAddress); + } + curAddress = curNode->succ; + curNode = _s->_segMan->lookupNode(curAddress); + } } void SciGuiGfx::SetNowSeen(reg_t objectReference) { diff --git a/engines/sci/gui/gui_gfx.h b/engines/sci/gui/gui_gfx.h index a2e9895293..96c408788e 100644 --- a/engines/sci/gui/gui_gfx.h +++ b/engines/sci/gui/gui_gfx.h @@ -110,7 +110,7 @@ public: Common::List<GuiAnimateList> *AnimateMakeSortedList(List *list); void AnimateUpdate(); void AnimateDrawCels(List *list); - void AnimateRestoreAndDelete(); + void AnimateRestoreAndDelete(List *list, int argc, reg_t *argv); void SetNowSeen(reg_t objectReference); GuiPort *_menuPort; |