diff options
author | Vladimir Menshakov | 2009-11-08 22:37:03 +0000 |
---|---|---|
committer | Vladimir Menshakov | 2009-11-08 22:37:03 +0000 |
commit | ea0b2a8cb8e1e23c62442f248c5b6551469e8db8 (patch) | |
tree | 76b6adb3724e18b0c875d705884dfb8ca199d209 /engines/teenagent/scene.cpp | |
parent | 79409d8ef1b14c3bf6d0863cb5bd6b8c81277574 (diff) | |
download | scummvm-rg350-ea0b2a8cb8e1e23c62442f248c5b6551469e8db8.tar.gz scummvm-rg350-ea0b2a8cb8e1e23c62442f248c5b6551469e8db8.tar.bz2 scummvm-rg350-ea0b2a8cb8e1e23c62442f248c5b6551469e8db8.zip |
implemented mouse-rock-glue time challenge
svn-id: r45767
Diffstat (limited to 'engines/teenagent/scene.cpp')
-rw-r--r-- | engines/teenagent/scene.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp index 23644f16f6..bad567943a 100644 --- a/engines/teenagent/scene.cpp +++ b/engines/teenagent/scene.cpp @@ -38,7 +38,7 @@ Scene::Scene() : intro(false), _engine(NULL), _id(0), ons(0), orientation(Object::kActorRight), message_timer(0), message_first_frame(0), message_last_frame(0), - current_event(SceneEvent::kNone), hide_actor(false) {} + current_event(SceneEvent::kNone), hide_actor(false), callback(0), callback_timer(0) {} void Scene::warp(const Common::Point &_point, byte o) { Common::Point point(_point); @@ -500,6 +500,15 @@ bool Scene::render(OSystem *system) { busy = true; } } + + if (!busy && callback_timer) { + if (--callback_timer == 0) { + if (_engine->inventory->active()) + _engine->inventory->activate(false); + _engine->processCallback(callback); + callback = 0; + } + } system->unlockScreen(); @@ -680,6 +689,13 @@ bool Scene::processEventQueue() { case SceneEvent::kWaitLanAnimationFrame: debug(0, "waiting for the frame %d in slot %d", current_event.animation, current_event.slot); break; + + case SceneEvent::kTimer: + callback = current_event.callback; + callback_timer = current_event.timer; + debug(0, "triggering callback %04x in %u frames", callback, callback_timer); + current_event.clear(); + break; case SceneEvent::kQuit: debug(0, "quit!"); @@ -772,6 +788,8 @@ void Scene::clear() { animation[i].free(); custom_animation[i].free(); } + callback = 0; + callback_timer = 0; } void Scene::clearMessage() { |