diff options
author | Vladimir Menshakov | 2009-11-07 12:33:59 +0000 |
---|---|---|
committer | Vladimir Menshakov | 2009-11-07 12:33:59 +0000 |
commit | 404b2099990344f2c8345c99450ffe32c5b7bb6a (patch) | |
tree | 269690bb6c1f7ed4389355c354ab5acffff539d0 /engines/teenagent/scene.cpp | |
parent | 9f1a756576ccbfaa01521697142a1e715fe57a5d (diff) | |
download | scummvm-rg350-404b2099990344f2c8345c99450ffe32c5b7bb6a.tar.gz scummvm-rg350-404b2099990344f2c8345c99450ffe32c5b7bb6a.tar.bz2 scummvm-rg350-404b2099990344f2c8345c99450ffe32c5b7bb6a.zip |
do not bail out from the waitAnimation event if restart frame requested.
svn-id: r45728
Diffstat (limited to 'engines/teenagent/scene.cpp')
-rw-r--r-- | engines/teenagent/scene.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp index 98e552f48d..ac3ce11e7d 100644 --- a/engines/teenagent/scene.cpp +++ b/engines/teenagent/scene.cpp @@ -391,25 +391,24 @@ bool Scene::render(OSystem *system) { Animation *a = custom_animation + i; Surface *s = a->currentFrame(); if (s != NULL) { - animation_position[i] = s->render(surface); busy = true; if (!a->paused && !a->loop) got_any_animation = true; - continue; + } else { + a = animation + i; + s = a->currentFrame(); } - - a = animation + i; - s = a->currentFrame(); + if (current_event.type == SceneEvent::kWaitLanAnimationFrame && current_event.color == i) { if (s == NULL) { - nextEvent(); + restart |= nextEvent(); continue; } int index = a->currentIndex(); //debug(0, "index = %d", index); if (index == current_event.animation) { debug(0, "kWaitLanAnimationFrame(%d, %d) complete", current_event.color, current_event.animation); - nextEvent(); + restart |= nextEvent(); } } @@ -487,7 +486,7 @@ bool Scene::render(OSystem *system) { system->unlockScreen(); - if (current_event.type == SceneEvent::kWaitForAnimation && !got_any_animation) { + if (!restart && current_event.type == SceneEvent::kWaitForAnimation && !got_any_animation) { debug(0, "no animations, nextevent"); nextEvent(); restart = true; @@ -695,12 +694,19 @@ Object *Scene::getObject(int id, int scene_id) { Common::Point Scene::messagePosition(const Common::String &str, Common::Point position) { Resources *res = Resources::instance(); uint w = res->font7.render(NULL, 0, 0, str); + uint h = res->font7.height + 3; + position.x -= w / 2; - position.y -= res->font7.height + 3; + position.y -= h; + if (position.x + w > 320) position.x = 320 - w; if (position.x < 0) position.x = 0; + if (position.y + h > 320) + position.y = 200 - h; + if (position.y < 0) + position.y = 0; return position; } |