diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/animator_v2.cpp | 6 | ||||
-rw-r--r-- | engines/kyra/scene_v2.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/script_v2.cpp | 11 |
3 files changed, 8 insertions, 11 deletions
diff --git a/engines/kyra/animator_v2.cpp b/engines/kyra/animator_v2.cpp index 8119c0fb9c..1a0fcbb939 100644 --- a/engines/kyra/animator_v2.cpp +++ b/engines/kyra/animator_v2.cpp @@ -65,10 +65,10 @@ KyraEngine_v2::AnimObj *KyraEngine_v2::initAnimList(AnimObj *list, AnimObj *entr KyraEngine_v2::AnimObj *KyraEngine_v2::addToAnimListSorted(AnimObj *list, AnimObj *add) { debugC(9, kDebugLevelAnimator, "KyraEngine_v2::addToAnimListSorted(%p, %p)", (const void*)list, (const void*)add); - if (!list) { - add->nextObject = 0; + add->nextObject = 0; + + if (!list) return add; - } if (add->yPos1 <= list->yPos1) { add->nextObject = list; diff --git a/engines/kyra/scene_v2.cpp b/engines/kyra/scene_v2.cpp index 4612862241..319ad6f682 100644 --- a/engines/kyra/scene_v2.cpp +++ b/engines/kyra/scene_v2.cpp @@ -742,6 +742,8 @@ void KyraEngine_v2::freeSceneShapePtrs() { void KyraEngine_v2::freeSceneAnims() { debugC(9, kDebugLevelMain, "KyraEngine_v2::freeSceneAnims()"); + for (int i = 0; i < ARRAYSIZE(_sceneAnims); ++i) + _sceneAnims[i].flags = 0; Common::for_each(_sceneAnimMovie, _sceneAnimMovie+ARRAYSIZE(_sceneAnimMovie), Common::mem_fun(&WSAMovieV2::close)); } diff --git a/engines/kyra/script_v2.cpp b/engines/kyra/script_v2.cpp index 65a4f8cb63..447603e907 100644 --- a/engines/kyra/script_v2.cpp +++ b/engines/kyra/script_v2.cpp @@ -1468,11 +1468,6 @@ int KyraEngine_v2::o2_setupSceneAnimation(ScriptState *script) { obj->height = anim.height; obj->width2 = obj->height2 = anim.specialSize; - // be sure we don't have an the object allready in the anim list - // else we get look ups in some places, the original doesn't do this - // though - _animList = deleteAnimListEntry(_animList, obj); - _animList = addToAnimListSorted(_animList, obj); obj->needRefresh = 1; obj->unk8 = 1; @@ -1481,8 +1476,8 @@ int KyraEngine_v2::o2_setupSceneAnimation(ScriptState *script) { int KyraEngine_v2::o2_stopSceneAnimation(ScriptState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_stopSceneAnimation(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); - const int index = 1+stackPos(0); - AnimObj &obj = _animObjects[index]; + const int index = stackPos(0); + AnimObj &obj = _animObjects[1+index]; restorePage3(); obj.shapeIndex3 = 0xFFFF; obj.animNum = 0xFFFF; @@ -1491,7 +1486,7 @@ int KyraEngine_v2::o2_stopSceneAnimation(ScriptState *script) { if (stackPos(1)) refreshAnimObjectsIfNeed(); obj.enabled = false; - _animList = deleteAnimListEntry(_animList, &_animObjects[index]); + _animList = deleteAnimListEntry(_animList, &_animObjects[1+index]); if (_sceneAnimMovie[index]->opened()) _sceneAnimMovie[index]->close(); |