From dfc039e4bed4fcc9fe9e2a2a7c24bc9385991363 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Wed, 6 Jan 2010 20:49:16 +0000 Subject: better z-ordering for the mark's animation svn-id: r47095 --- engines/teenagent/scene.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'engines/teenagent') diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp index 5c438d30ce..dbeaac227b 100644 --- a/engines/teenagent/scene.cpp +++ b/engines/teenagent/scene.cpp @@ -663,15 +663,24 @@ bool Scene::render(bool tick_game, bool tick_mark, uint32 message_delta) { Common::sort(z_order.begin(), z_order.end(), ZOrderCmp()); Common::List::iterator z_order_it; + Surface *mark = actor_animation.currentFrame(game_delta); + int horizon = mark != NULL? mark->y + mark->h: position.y; + for(z_order_it = z_order.begin(); z_order_it != z_order.end(); ++z_order_it) { Surface *s = *z_order_it; - if (s->y + s->h > position.y) + if (s->y + s->h > horizon) break; s->render(surface); } - Surface *mark = actor_animation.currentFrame(game_delta); - if (!hide_actor && mark == NULL) { + if (mark != NULL) { + actor_animation_position = mark->render(surface); + if (!actor_animation.ignore) + busy = true; + else + busy = false; + got_any_animation = true; + } else if (!hide_actor) { actor_animation.free(); uint zoom = lookupZoom(position.y); @@ -739,14 +748,6 @@ bool Scene::render(bool tick_game, bool tick_mark, uint32 message_delta) { Surface *s = *z_order_it; s->render(surface); } - if (mark != NULL) { - actor_animation_position = mark->render(surface); - if (!actor_animation.ignore) - busy = true; - else - busy = false; - got_any_animation = true; - } if (!message.empty()) { bool visible = true; -- cgit v1.2.3