aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/teenagent/scene.cpp17
-rw-r--r--engines/teenagent/scene.h1
-rw-r--r--engines/teenagent/teenagent.cpp11
-rw-r--r--engines/teenagent/teenagent.h1
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;