aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorVladimir Menshakov2009-11-17 22:45:41 +0000
committerVladimir Menshakov2009-11-17 22:45:41 +0000
commit618cade585dd5f5e260ba3c5fef46cab129cfbad (patch)
tree928a2d026cc6b64c6221750f8637abb2f01dc440 /engines
parent9013668a1648065806cdc58b30795da4d0175ae0 (diff)
downloadscummvm-rg350-618cade585dd5f5e260ba3c5fef46cab129cfbad.tar.gz
scummvm-rg350-618cade585dd5f5e260ba3c5fef46cab129cfbad.tar.bz2
scummvm-rg350-618cade585dd5f5e260ba3c5fef46cab129cfbad.zip
added kEffect for screen shaking, fixed barman callback
svn-id: r45965
Diffstat (limited to 'engines')
-rw-r--r--engines/teenagent/callbacks.cpp3
-rw-r--r--engines/teenagent/scene.cpp11
-rw-r--r--engines/teenagent/scene.h1
-rw-r--r--engines/teenagent/teenagent.cpp5
-rw-r--r--engines/teenagent/teenagent.h1
5 files changed, 17 insertions, 4 deletions
diff --git a/engines/teenagent/callbacks.cpp b/engines/teenagent/callbacks.cpp
index 81945234d4..55048e09e9 100644
--- a/engines/teenagent/callbacks.cpp
+++ b/engines/teenagent/callbacks.cpp
@@ -484,6 +484,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
playSound(75, 10);
playSound(24, 15);
playAnimation(883, 0);
+ shakeScreen();
disableObject(1);
disableObject(2);
SET_FLAG(0xDBE9, 1);
@@ -551,7 +552,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
playSound(89, 5);
playActorAnimation(958);
loadScene(9, 240, 182, 4);
- } else if (CHECK_FLAG(0xDBE9, 1)) {
+ } else if (CHECK_FLAG(0xDBE7, 1)) {
displayMessage(0x5894);
} else {
Dialog::pop(scene, 0xDB8A, 0, 857, 0xd1, 0xef, 0, 1);
diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp
index 369a174573..4e2a9463e6 100644
--- a/engines/teenagent/scene.cpp
+++ b/engines/teenagent/scene.cpp
@@ -580,9 +580,9 @@ bool Scene::render(OSystem *system) {
return true;
}
- if (background.pixels && debug_features.feature[DebugFeatures::kShowBack])
+ if (background.pixels && debug_features.feature[DebugFeatures::kShowBack]) {
system->copyRectToScreen((const byte *)background.pixels, background.pitch, 0, 0, background.w, background.h);
- else
+ } else
system->fillScreen(0);
Graphics::Surface *surface = system->lockScreen();
@@ -995,11 +995,16 @@ bool Scene::processEventQueue() {
current_event.clear();
break;
+ case SceneEvent::kEffect:
+ debug(0, "*stub* shaking the screen");
+ current_event.clear();
+ break;
+
case SceneEvent::kQuit:
debug(0, "quit!");
_engine->quitGame();
break;
-
+
default:
error("empty/unhandler event[%d]", (int)current_event.type);
}
diff --git a/engines/teenagent/scene.h b/engines/teenagent/scene.h
index ab26d4a4e7..97efea38d2 100644
--- a/engines/teenagent/scene.h
+++ b/engines/teenagent/scene.h
@@ -58,6 +58,7 @@ struct SceneEvent {
kWaitLanAnimationFrame,
kCreditsMessage, //16
kTimer,
+ kEffect,
kQuit
} type;
diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp
index 4ff910f7c2..68cdc5c9fc 100644
--- a/engines/teenagent/teenagent.cpp
+++ b/engines/teenagent/teenagent.cpp
@@ -623,6 +623,11 @@ void TeenAgentEngine::setTimerCallback(uint16 addr, uint16 frames) {
scene->push(event);
}
+void TeenAgentEngine::shakeScreen() {
+ SceneEvent event(SceneEvent::kEffect);
+ 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 232762bf15..e00db41890 100644
--- a/engines/teenagent/teenagent.h
+++ b/engines/teenagent/teenagent.h
@@ -96,6 +96,7 @@ public:
void waitAnimation();
void waitLanAnimationFrame(byte slot, uint16 frame);
void setTimerCallback(uint16 addr, uint16 frames);
+ void shakeScreen();
Common::RandomSource random;