SCI/newgui: kAnimate - _delete invoking implemented

svn-id: r44782
This commit is contained in:
Martin Kiewitz 2009-10-08 11:23:53 +00:00
parent cce8d2e279
commit 120b6b9392
3 changed files with 23 additions and 4 deletions

View File

@ -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);
}

View File

@ -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) {

View File

@ -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;