aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorVladimir Menshakov2009-09-13 10:50:29 +0000
committerVladimir Menshakov2009-09-13 10:50:29 +0000
commit6c9ab139afb4fd7092ecb8bf97a47f6c097e4a07 (patch)
treeb1c22ce4ef7a13d667c70a2432c3295638bcb4d9 /engines
parente7469479ceebf341322fafbcbddd9028e8a42060 (diff)
downloadscummvm-rg350-6c9ab139afb4fd7092ecb8bf97a47f6c097e4a07.tar.gz
scummvm-rg350-6c9ab139afb4fd7092ecb8bf97a47f6c097e4a07.tar.bz2
scummvm-rg350-6c9ab139afb4fd7092ecb8bf97a47f6c097e4a07.zip
added intro support
svn-id: r44049
Diffstat (limited to 'engines')
-rw-r--r--engines/teenagent/callbacks.cpp77
-rw-r--r--engines/teenagent/dialog.cpp12
-rw-r--r--engines/teenagent/dialog.h4
-rw-r--r--engines/teenagent/scene.cpp31
-rw-r--r--engines/teenagent/scene.h2
-rw-r--r--engines/teenagent/teenagent.cpp11
6 files changed, 116 insertions, 21 deletions
diff --git a/engines/teenagent/callbacks.cpp b/engines/teenagent/callbacks.cpp
index 116d060a06..073abfbc12 100644
--- a/engines/teenagent/callbacks.cpp
+++ b/engines/teenagent/callbacks.cpp
@@ -88,6 +88,83 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
switch(addr) {
+ case 0x024c: //intro
+ loadScene(41, 139, 156, 3);
+ playSound(41, 12);
+ playAnimation(912, 1);
+ setOns(0, 108);
+ playSound(62, 8);
+ playSound(58, 40);
+ playAnimation(913, 1);
+ setOns(1, 109);
+ Dialog::show(scene, 0x748e, 914, 915, 0xe7, 0xd7);
+ displayCredits(0xe3c2);
+ loadScene(42, 139, 156, 3);
+ playSound(15, 20);
+ playAnimation(916, 1);
+ playSound(40, 18);
+ playSound(40, 22);
+ for(byte i = 27; i < 37; i += 2)
+ playSound(40, i);
+ playSound(29, 44);
+ playAnimation(918, 0, true);
+ playAnimation(917, 1, true);
+ waitAnimation();
+ displayCredits(0xe3e6);
+
+ loadScene(40, 139, 156, 3);
+ playMusic(3);
+ Dialog::show(scene, 0x750d, 920, 924, 0xe7, 0xeb); //as i told you, our organization...
+ playSound(26, 50);
+ playAnimation(925, 0, true);
+ playAnimation(926, 1, true);
+ waitAnimation();
+ Dialog::show(scene, 0x78a6, 927, 920, 0xeb, 0xeb);
+ displayCredits(0xe3ff);
+
+ loadScene(39, 139, 156, 3);
+ playMusic(11);
+ playSound(81, 2);
+ playSound(81, 8);
+ playSound(81, 11);
+ playSound(81, 14);
+ playSound(81, 16);
+ playSound(81, 18);
+ playSound(81, 20);
+ playSound(81, 21);
+ playAnimation(928, 1);
+ setOns(0, 112);
+ Dialog::show(scene, 0x78e1, 929, 0, 0xd1); //he's coming
+ moveTo(319, 150, 1, true);
+ moveTo(63, 150, 1);
+ displayMessage(0x5da8); //fixme: with delay!
+ playAnimation(851, 0);
+ playSound(24, 11);
+ playActorAnimation(931);
+ displayCredits(0xe42f);
+
+ playMusic(3);
+ loadScene(40, 50, 186, 1);
+ setOns(0, 113);
+ Dialog::show(scene, 0x78f1, 919, 0, 0xe7);
+ moveTo(196, 186, 1);
+ Dialog::show(scene, 0x7958, 919, 0, 0xe7);
+ playActorAnimation(932);
+ Dialog::show(scene, 0x7e07, 919, 0, 0xe7);
+ playActorAnimation(932);
+ Dialog::show(scene, 0x7e1a, 919, 0, 0xe7);
+ playActorAnimation(932);
+ Dialog::show(scene, 0x7e2c, 919, 0, 0xe7);
+ playActorAnimation(933);
+ Dialog::show(scene, 0x7e70, 919, 0, 0xe7);
+ moveTo(174, 186, 1);
+ playAnimation(851, 0, true);
+ playActorAnimation(934, true);
+ waitAnimation();
+ loadScene(10, 136, 153);
+
+ return true;
+
case 0x4021:
//pulling out mysterious object
if (CHECK_FLAG(0xdbe1, 1)) {
diff --git a/engines/teenagent/dialog.cpp b/engines/teenagent/dialog.cpp
index c317d0b581..b0e946949e 100644
--- a/engines/teenagent/dialog.cpp
+++ b/engines/teenagent/dialog.cpp
@@ -28,12 +28,12 @@
namespace TeenAgent {
-void Dialog::show(Scene * scene, uint16 addr, uint16 animation, uint16 actor_animation) {
+void Dialog::show(Scene * scene, uint16 addr, uint16 animation, uint16 actor_animation, byte color1, byte color2) {
debug(0, "Dialog::show(%04x, %u)", addr, animation);
Resources * res = Resources::instance();
int n = 0;
Common::String message;
- byte color = 0xd1;
+ byte color = color1;
while (n < 4) {
byte c = res->eseg.get_byte(addr++);
@@ -41,7 +41,7 @@ void Dialog::show(Scene * scene, uint16 addr, uint16 animation, uint16 actor_ani
case 0:
++n;
if (n == 3) {
- color = color == 0xd1? 0xd0: 0xd1;
+ color = color == color1? color2: color1;
//debug(0, "changing color", message);
}
continue;
@@ -86,7 +86,7 @@ void Dialog::show(Scene * scene, uint16 addr, uint16 animation, uint16 actor_ani
if (animation != 0) {
SceneEvent e(SceneEvent::PlayAnimation);
e.animation = animation;
- e.color = 0x83; //3rd slot, async animation
+ e.color = 0x41;
scene->push(e);
} //copy paste ninja was here
SceneEvent e(SceneEvent::Message);
@@ -96,7 +96,7 @@ void Dialog::show(Scene * scene, uint16 addr, uint16 animation, uint16 actor_ani
}
}
-uint16 Dialog::pop(Scene *scene, uint16 addr, uint16 animation, uint16 actor_animation) {
+uint16 Dialog::pop(Scene *scene, uint16 addr, uint16 animation, uint16 actor_animation, byte color1, byte color2) {
debug(0, "Dialog::pop(%04x, %u)", addr, animation);
Resources * res = Resources::instance();
uint16 next;
@@ -107,7 +107,7 @@ uint16 Dialog::pop(Scene *scene, uint16 addr, uint16 animation, uint16 actor_ani
uint16 next2 = res->dseg.get_word(addr);
if (next2 != 0xffff)
res->dseg.set_word(addr - 2, 0);
- show(scene, next, animation, actor_animation);
+ show(scene, next, animation, actor_animation, color1, color2);
return next;
}
diff --git a/engines/teenagent/dialog.h b/engines/teenagent/dialog.h
index 30f78676bf..65da1dcc74 100644
--- a/engines/teenagent/dialog.h
+++ b/engines/teenagent/dialog.h
@@ -33,8 +33,8 @@ namespace TeenAgent {
class Scene;
class Dialog {
public:
- static uint16 pop(Scene *scene, uint16 addr, uint16 animation = 0, uint16 actor_animation = 0);
- static void show(Scene *scene, uint16 addr, uint16 animation = 0, uint16 actor_animation = 0);
+ static uint16 pop(Scene *scene, uint16 addr, uint16 animation = 0, uint16 actor_animation = 0, byte color1 = 0xd1, byte color2 = 0xd0);
+ static void show(Scene *scene, uint16 addr, uint16 animation = 0, uint16 actor_animation = 0, byte color1 = 0xd1, byte color2 = 0xd0);
};
} // End of namespace TeenAgent
diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp
index 87bb958fdc..8234944243 100644
--- a/engines/teenagent/scene.cpp
+++ b/engines/teenagent/scene.cpp
@@ -33,7 +33,7 @@
namespace TeenAgent {
-Scene::Scene() : _engine(NULL),
+Scene::Scene() : intro(false), _engine(NULL),
_system(NULL),
_id(0), ons(0), walkboxes(0),
orientation(Object::ActorRight),
@@ -257,11 +257,10 @@ void Scene::push(const SceneEvent &event) {
}
bool Scene::processEvent(const Common::Event &event) {
- if (!message.empty()) {
- if (
- event.type == Common::EVENT_LBUTTONDOWN ||
- event.type == Common::EVENT_RBUTTONDOWN
- ) {
+ switch(event.type) {
+ case Common::EVENT_LBUTTONDOWN:
+ case Common::EVENT_RBUTTONDOWN:
+ if (!message.empty()) {
message.clear();
for(int i = 0; i < 4; ++i) {
if (custom_animations[i].loop)
@@ -270,8 +269,23 @@ bool Scene::processEvent(const Common::Event &event) {
nextEvent();
return true;
}
+ return false;
+
+ case Common::EVENT_KEYUP:
+ if (intro && event.kbd.keycode == Common::KEYCODE_ESCAPE) {
+ intro = false;
+ message.clear();
+ events.clear();
+ sounds.clear();
+ current_event.clear();
+ _engine->playMusic(4);
+ init(10, Common::Point(136, 153));
+ }
+ return false;
+
+ default:
+ return false;
}
- return false;
}
bool Scene::render(OSystem * system) {
@@ -287,7 +301,7 @@ bool Scene::render(OSystem * system) {
return true;
}
- bool busy = false;
+ bool busy = processEventQueue();
system->copyRectToScreen((const byte *)background.pixels, background.pitch, 0, 0, background.w, background.h);
@@ -373,7 +387,6 @@ bool Scene::render(OSystem * system) {
nextEvent();
}
- busy |= processEventQueue();
//if (!current_event.empty())
// current_event.dump();
/*
diff --git a/engines/teenagent/scene.h b/engines/teenagent/scene.h
index 49af961509..5749901fa1 100644
--- a/engines/teenagent/scene.h
+++ b/engines/teenagent/scene.h
@@ -90,6 +90,8 @@ struct SceneEvent {
class Scene {
public:
+ bool intro;
+
Scene();
void init(TeenAgentEngine *engine, OSystem * system);
diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp
index 055f7ad646..7e45cf13f5 100644
--- a/engines/teenagent/teenagent.cpp
+++ b/engines/teenagent/teenagent.cpp
@@ -211,19 +211,22 @@ Common::Error TeenAgentEngine::run() {
_system->setMouseCursor(res->dseg.ptr(0x00da), 8, 12, 0, 0, 1);
- scene->init(10, Common::Point(136, 153));
-
syncSoundSettings();
- music->load(4);
+ music->load(1);
_mixer->playInputStream(Audio::Mixer::kMusicSoundType, &_musicHandle, music, -1, 255, 0, true, false);
music->start();
{
int load_slot = Common::ConfigManager::instance().getInt("save_slot");
debug(0, "slot: %d", load_slot);
- if (load_slot >= 0)
+ if (load_slot >= 0) {
loadGameState(load_slot);
+ } else {
+ scene->intro = true;
+ scene_busy = true;
+ processCallback(0x24c);
+ }
}
uint32 frame = 0;