diff options
author | Vladimir Menshakov | 2010-01-06 20:49:16 +0000 |
---|---|---|
committer | Vladimir Menshakov | 2010-01-06 20:49:16 +0000 |
commit | dfc039e4bed4fcc9fe9e2a2a7c24bc9385991363 (patch) | |
tree | 028420754729a4838cbf6ce7833cf29916789d20 | |
parent | 1f12957a50bbc38173c4f28f6ccaa82af8624c8d (diff) | |
download | scummvm-rg350-dfc039e4bed4fcc9fe9e2a2a7c24bc9385991363.tar.gz scummvm-rg350-dfc039e4bed4fcc9fe9e2a2a7c24bc9385991363.tar.bz2 scummvm-rg350-dfc039e4bed4fcc9fe9e2a2a7c24bc9385991363.zip |
better z-ordering for the mark's animation
svn-id: r47095
-rw-r--r-- | engines/teenagent/scene.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
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<Surface *>::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; |