From c509752da116a66cca8ac9c364edb888b1bbd3d9 Mon Sep 17 00:00:00 2001 From: Sylvain Dupont Date: Mon, 25 Oct 2010 22:41:34 +0000 Subject: TOON: Fixed some Z-order issues for animations Happened when the flag 0x20 was set in Init_Scene_Anim It says to use the background layer system svn-id: r53836 --- engines/toon/script_func.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'engines/toon') diff --git a/engines/toon/script_func.cpp b/engines/toon/script_func.cpp index be1301cec2..a84683a9a2 100644 --- a/engines/toon/script_func.cpp +++ b/engines/toon/script_func.cpp @@ -701,7 +701,7 @@ int32 ScriptFunc::sys_Cmd_Place_Scene_Anim(EMCState *state) { int32 frame = stackPos(5); SceneAnimation *sceneAnim = _vm->getSceneAnimation(sceneId); - sceneAnim->_animInstance->setPosition(x, y, 0, false); + sceneAnim->_animInstance->setPosition(x, y, sceneAnim->_animInstance->getZ(), false); sceneAnim->_animInstance->forceFrame(frame); _vm->setSceneAnimationScriptUpdate(false); return 0; @@ -915,10 +915,14 @@ int32 ScriptFunc::sys_Cmd_Init_Scene_Anim(EMCState *state) { int32 dx = stackPos(4); int32 dy = stackPos(5); + int32 x = stackPos(2); int32 layerZ = stackPos(3); if (dx == -2) sceneAnim->_animInstance->moveRelative(640, 0, 0); + else if (dx < 0) { + dx = sceneAnim->_animation->_x1; + } else if (dx >= 0) sceneAnim->_animInstance->setX(dx); @@ -927,8 +931,10 @@ int32 ScriptFunc::sys_Cmd_Init_Scene_Anim(EMCState *state) { else dy = sceneAnim->_animation->_y1; - if (flags & 0x20) - sceneAnim->_animInstance->setZ(_vm->getLayerAtPoint(dx, dy)); + if (flags & 0x20) { + sceneAnim->_animInstance->setZ(_vm->getLayerAtPoint(x, layerZ)); + sceneAnim->_animInstance->setUseMask(true); + } if (layerZ >= 0) { sceneAnim->_animInstance->setLayerZ(layerZ); -- cgit v1.2.3