aboutsummaryrefslogtreecommitdiff
path: root/engines/toon
diff options
context:
space:
mode:
authorSylvain Dupont2010-10-25 22:41:34 +0000
committerSylvain Dupont2010-10-25 22:41:34 +0000
commitc509752da116a66cca8ac9c364edb888b1bbd3d9 (patch)
treeee3fa3bc08e82233f964b1c6f39456a0677ee36e /engines/toon
parente761f76653b1c12493d1cb047ace29264e537e4b (diff)
downloadscummvm-rg350-c509752da116a66cca8ac9c364edb888b1bbd3d9.tar.gz
scummvm-rg350-c509752da116a66cca8ac9c364edb888b1bbd3d9.tar.bz2
scummvm-rg350-c509752da116a66cca8ac9c364edb888b1bbd3d9.zip
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
Diffstat (limited to 'engines/toon')
-rw-r--r--engines/toon/script_func.cpp12
1 files changed, 9 insertions, 3 deletions
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);