diff options
author | Vladimir Menshakov | 2009-11-07 12:00:56 +0000 |
---|---|---|
committer | Vladimir Menshakov | 2009-11-07 12:00:56 +0000 |
commit | f3f382ba37bdee7e0d3f530d72bdcd704dc4bb66 (patch) | |
tree | 28a86e109c17c9411c9e31ec55592aacfb4ac76d /engines/teenagent | |
parent | 0b67aa406e4c19edd9c264ce6f1447aee8ff4c8e (diff) | |
download | scummvm-rg350-f3f382ba37bdee7e0d3f530d72bdcd704dc4bb66.tar.gz scummvm-rg350-f3f382ba37bdee7e0d3f530d72bdcd704dc4bb66.tar.bz2 scummvm-rg350-f3f382ba37bdee7e0d3f530d72bdcd704dc4bb66.zip |
implemented waiting for the particular frame in animation.
svn-id: r45724
Diffstat (limited to 'engines/teenagent')
-rw-r--r-- | engines/teenagent/scene.cpp | 17 | ||||
-rw-r--r-- | engines/teenagent/scene.h | 1 | ||||
-rw-r--r-- | engines/teenagent/teenagent.cpp | 11 | ||||
-rw-r--r-- | engines/teenagent/teenagent.h | 1 |
4 files changed, 30 insertions, 0 deletions
diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp index df0c3d6c2a..35cbcf7e09 100644 --- a/engines/teenagent/scene.cpp +++ b/engines/teenagent/scene.cpp @@ -400,6 +400,19 @@ bool Scene::render(OSystem *system) { a = animation + i; s = a->currentFrame(); + if (current_event.type == SceneEvent::kWaitLanAnimationFrame && current_event.color == i) { + if (s == NULL) { + 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(); + } + } + if (s == NULL) continue; @@ -635,6 +648,10 @@ bool Scene::processEventQueue() { debug(0, "waiting for the animation"); break; + case SceneEvent::kWaitLanAnimationFrame: + debug(0, "waiting for the frame %d in slot %d", current_event.animation, current_event.color); + break; + case SceneEvent::kQuit: debug(0, "quit!"); _engine->quitGame(); diff --git a/engines/teenagent/scene.h b/engines/teenagent/scene.h index b6e0b64d30..7fcddcc608 100644 --- a/engines/teenagent/scene.h +++ b/engines/teenagent/scene.h @@ -53,6 +53,7 @@ struct SceneEvent { kEnableObject, //12 kHideActor, kWaitForAnimation, + kWaitLanAnimationFrame, kCreditsMessage, kQuit //16 } type; diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp index 7029672bb0..c074fb6ed2 100644 --- a/engines/teenagent/teenagent.cpp +++ b/engines/teenagent/teenagent.cpp @@ -543,6 +543,17 @@ void TeenAgentEngine::waitAnimation() { scene->push(event); } +void TeenAgentEngine::waitLanAnimationFrame(byte slot, uint16 frame) { + SceneEvent event(SceneEvent::kWaitLanAnimationFrame); + if (frame > 0) + --frame; + + event.color = slot - 1; + event.animation = frame; + scene->push(event); +} + + void TeenAgentEngine::playSoundNow(byte id) { Resources *res = Resources::instance(); Common::SeekableReadStream *in = res->sam_sam.getStream(id); diff --git a/engines/teenagent/teenagent.h b/engines/teenagent/teenagent.h index d9e8731ce5..b9cec2bfc7 100644 --- a/engines/teenagent/teenagent.h +++ b/engines/teenagent/teenagent.h @@ -90,6 +90,7 @@ public: void hideActor(); void showActor(); void waitAnimation(); + void waitLanAnimationFrame(byte slot, uint16 frame); Common::RandomSource random; |