aboutsummaryrefslogtreecommitdiff
path: root/engines/teenagent
diff options
context:
space:
mode:
authorVladimir Menshakov2010-02-02 07:26:36 +0000
committerVladimir Menshakov2010-02-02 07:26:36 +0000
commitef8215e70ca6225d2a2e01f21c8aebda2ca82a99 (patch)
treec7af45bc2f7dc44b5cd7d21c42655625f570f866 /engines/teenagent
parent34939584234235cc1a084e4c6fbb13f2de47bc83 (diff)
downloadscummvm-rg350-ef8215e70ca6225d2a2e01f21c8aebda2ca82a99.tar.gz
scummvm-rg350-ef8215e70ca6225d2a2e01f21c8aebda2ca82a99.tar.bz2
scummvm-rg350-ef8215e70ca6225d2a2e01f21c8aebda2ca82a99.zip
added kWait event type
svn-id: r47808
Diffstat (limited to 'engines/teenagent')
-rw-r--r--engines/teenagent/callbacks.cpp3
-rw-r--r--engines/teenagent/scene.cpp21
-rw-r--r--engines/teenagent/scene.h1
-rw-r--r--engines/teenagent/teenagent.cpp7
-rw-r--r--engines/teenagent/teenagent.h1
5 files changed, 28 insertions, 5 deletions
diff --git a/engines/teenagent/callbacks.cpp b/engines/teenagent/callbacks.cpp
index 67e05385bd..f4110ab627 100644
--- a/engines/teenagent/callbacks.cpp
+++ b/engines/teenagent/callbacks.cpp
@@ -360,8 +360,9 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
setOns(3, 0x59);
//some moving animation is missing here
moveTo(scene->getPosition().x, scene->getPosition().y + 1, 3);
- //wait
+ wait(150);
moveTo(scene->getPosition().x, scene->getPosition().y - 1, 2);
+ wait(100);
displayMessage(0x551f);
enableObject(4);
SET_FLAG(0xdbdc, 1);
diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp
index ef3dccca8b..9103e77c81 100644
--- a/engines/teenagent/scene.cpp
+++ b/engines/teenagent/scene.cpp
@@ -532,7 +532,7 @@ int Scene::lookupZoom(uint y) const {
}
-bool Scene::render(bool tick_game, bool tick_mark, uint32 message_delta) {
+bool Scene::render(bool tick_game, bool tick_mark, uint32 delta) {
Resources *res = Resources::instance();
bool busy;
bool restart;
@@ -570,12 +570,12 @@ bool Scene::render(bool tick_game, bool tick_mark, uint32 message_delta) {
}
if (!message.empty() && message_timer != 0) {
- if (message_timer <= message_delta) {
+ if (message_timer <= delta) {
clearMessage();
nextEvent();
continue;
} else
- message_timer -= message_delta;
+ message_timer -= delta;
}
if (current_event.type == SceneEvent::kCreditsMessage) {
@@ -799,6 +799,17 @@ bool Scene::render(bool tick_game, bool tick_mark, uint32 message_delta) {
_system->unlockScreen();
+ if (current_event.type == SceneEvent::kWait) {
+ if (current_event.timer > delta) {
+ busy = true;
+ current_event.timer -= delta;
+ }
+
+ if (current_event.timer <= delta)
+ restart |= nextEvent();
+
+ }
+
if (!restart && current_event.type == SceneEvent::kWaitForAnimation && !got_any_animation) {
debug(0, "no animations, nextevent");
nextEvent();
@@ -1048,6 +1059,10 @@ bool Scene::processEventQueue() {
current_event.clear();
break;
+ case SceneEvent::kWait:
+ debug(0, "wait %u", current_event.timer);
+ break;
+
case SceneEvent::kCredits:
debug(0, "showing credits");
break;
diff --git a/engines/teenagent/scene.h b/engines/teenagent/scene.h
index b7fe6753fe..9aacedc239 100644
--- a/engines/teenagent/scene.h
+++ b/engines/teenagent/scene.h
@@ -61,6 +61,7 @@ struct SceneEvent {
kTimer,
kEffect,
kFade,
+ kWait,
kQuit
} type;
diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp
index aa8006a3b6..05937f987c 100644
--- a/engines/teenagent/teenagent.cpp
+++ b/engines/teenagent/teenagent.cpp
@@ -885,6 +885,12 @@ void TeenAgentEngine::fadeOut() {
scene->push(event);
}
+void TeenAgentEngine::wait(uint16 frames) {
+ SceneEvent event(SceneEvent::kWait);
+ event.timer = frames * 10;
+ scene->push(event);
+}
+
void TeenAgentEngine::playSoundNow(byte id) {
Resources *res = Resources::instance();
Common::SeekableReadStream *in = res->sam_sam.getStream(id);
@@ -911,7 +917,6 @@ void TeenAgentEngine::setMusic(byte id) {
music->start();
}
-
bool TeenAgentEngine::hasFeature(EngineFeature f) const {
switch (f) {
case kSupportsRTL:
diff --git a/engines/teenagent/teenagent.h b/engines/teenagent/teenagent.h
index 9acc71adab..545cc68f9b 100644
--- a/engines/teenagent/teenagent.h
+++ b/engines/teenagent/teenagent.h
@@ -112,6 +112,7 @@ public:
void displayCredits();
void fadeIn();
void fadeOut();
+ void wait(uint16 frames);
Common::RandomSource random;