diff options
author | Vladimir Menshakov | 2009-10-31 18:49:47 +0000 |
---|---|---|
committer | Vladimir Menshakov | 2009-10-31 18:49:47 +0000 |
commit | d033899a0595d6a371ca9c2861b85ce5604f6ba6 (patch) | |
tree | 8a272f2cbe9fe2f906a9ed1cdfab8f72f646bb37 /engines/teenagent | |
parent | 67a7492fa2e46c113b15469a9b44ffdb1ece2af9 (diff) | |
download | scummvm-rg350-d033899a0595d6a371ca9c2861b85ce5604f6ba6.tar.gz scummvm-rg350-d033899a0595d6a371ca9c2861b85ce5604f6ba6.tar.bz2 scummvm-rg350-d033899a0595d6a371ca9c2861b85ce5604f6ba6.zip |
added cutscenes where needed, fixed invalid skipping of fullscreen messages.
svn-id: r45575
Diffstat (limited to 'engines/teenagent')
-rw-r--r-- | engines/teenagent/callbacks.cpp | 8 | ||||
-rw-r--r-- | engines/teenagent/font.cpp | 4 | ||||
-rw-r--r-- | engines/teenagent/scene.cpp | 29 | ||||
-rw-r--r-- | engines/teenagent/scene.h | 10 | ||||
-rw-r--r-- | engines/teenagent/teenagent.cpp | 13 | ||||
-rw-r--r-- | engines/teenagent/teenagent.h | 1 |
6 files changed, 45 insertions, 20 deletions
diff --git a/engines/teenagent/callbacks.cpp b/engines/teenagent/callbacks.cpp index 87d75da3cc..681ef94dde 100644 --- a/engines/teenagent/callbacks.cpp +++ b/engines/teenagent/callbacks.cpp @@ -2096,7 +2096,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) { SET_FLAG(0xDBE6, 1); setOns(1, 0x66); moveTo(224, 194, 0, true); - debug(0, "FIXME: add cut message: 57DF at 30423"); + displayCutsceneMessage(0x57df, 30423); inventory->remove(0x59); } else { displayMessage(0x5de2); @@ -3623,7 +3623,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) { for (uint i = 0; i < 8; ++i) playSound(26, 30 + i * 11); playActorAnimation(661); - //cutscene 3c80 at 30484 + displayCutsceneMessage(0x3c80, 30484); playSound(56, 10); playSound(56, 21); @@ -3637,7 +3637,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) { waitAnimation(); setOns(1, 49); - //cutscene 0x3c9a at 30453 + displayCutsceneMessage(0x3c9a, 30453); moveTo(162, 184, 0, true); playSound(26, 6); playSound(26, 17); @@ -3708,7 +3708,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) { byte id = scene->getId(); playMusic(11); - debug(0, "FIXME: cutscene: meanwhile in a mansion #%u, %04x", tries, ptr); + displayCutsceneMessage(0x580a, 30484); processCallback(ptr); playMusic(6); if (scene->getId() == 11 && CHECK_FLAG(0xDBEC, 1)) diff --git a/engines/teenagent/font.cpp b/engines/teenagent/font.cpp index e18c4f5904..da50469e62 100644 --- a/engines/teenagent/font.cpp +++ b/engines/teenagent/font.cpp @@ -63,12 +63,16 @@ uint Font::render(Graphics::Surface *surface, int x, int y, char c) { for (uint j = 0; j < w; ++j) { byte v = *glyph++; switch (v) { + case 0: + break; case 1: dst[j] = shadow_color; break; case 2: dst[j] = color; break; + default: + dst[j] = v; } } dst += surface->pitch; diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp index b96bb603f0..af37a6d011 100644 --- a/engines/teenagent/scene.cpp +++ b/engines/teenagent/scene.cpp @@ -316,12 +316,13 @@ bool Scene::processEvent(const Common::Event &event) { sounds.clear(); current_event.clear(); message_color = 0xd1; + Resources::instance()->font7.color = 0xd1; for (int i = 0; i < 4; ++i) custom_animation[i].free(); _engine->playMusic(4); init(10, Common::Point(136, 153)); } - return false; + return true; default: return false; @@ -331,22 +332,28 @@ bool Scene::processEvent(const Common::Event &event) { bool Scene::render(OSystem *system) { //render background Resources *res = Resources::instance(); - if (current_event.type == SceneEvent::kCreditsMessage) { - system->fillScreen(0); - Graphics::Surface *surface = system->lockScreen(); - res->font8.color = current_event.color; - res->font8.shadow_color = current_event.orientation; - res->font8.render(surface, current_event.dst.x, current_event.dst.y, message); - system->unlockScreen(); - return true; - } - bool busy; bool restart; do { restart = false; busy = processEventQueue(); + + if (current_event.type == SceneEvent::kCreditsMessage) { + system->fillScreen(0); + Graphics::Surface *surface = system->lockScreen(); + if (current_event.lan == 8) { + res->font8.color = current_event.color; + res->font8.shadow_color = current_event.orientation; + res->font8.render(surface, current_event.dst.x, current_event.dst.y, message); + } else { + res->font7.color = 0xd1; + res->font7.render(surface, current_event.dst.x, current_event.dst.y, message); + } + system->unlockScreen(); + return true; + } + system->copyRectToScreen((const byte *)background.pixels, background.pitch, 0, 0, background.w, background.h); Graphics::Surface *surface = system->lockScreen(); diff --git a/engines/teenagent/scene.h b/engines/teenagent/scene.h index 849b27f2c1..683e5c8042 100644 --- a/engines/teenagent/scene.h +++ b/engines/teenagent/scene.h @@ -38,23 +38,23 @@ class Dialog; struct SceneEvent { enum Type { - kNone, + kNone, //0 kMessage, kWalk, kPlayAnimation, - kPlayActorAnimation, + kPlayActorAnimation, //4 kPauseAnimation, kClearAnimations, kLoadScene, - kSetOn, + kSetOn, //8 kSetLan, kPlayMusic, kPlaySound, - kEnableObject, + kEnableObject, //12 kHideActor, kWaitForAnimation, kCreditsMessage, - kQuit + kQuit //16 } type; Common::String message; diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp index b8a4c059ed..17242d677e 100644 --- a/engines/teenagent/teenagent.cpp +++ b/engines/teenagent/teenagent.cpp @@ -377,6 +377,7 @@ void TeenAgentEngine::displayCredits(uint16 addr) { const byte *src = Resources::instance()->dseg.ptr(addr); event.orientation = *src++; event.color = *src++; + event.lan = 8; event.dst.y = *src; while (true) { @@ -393,6 +394,18 @@ void TeenAgentEngine::displayCredits(uint16 addr) { scene->push(event); } +void TeenAgentEngine::displayCutsceneMessage(uint16 addr, uint16 position) { + SceneEvent event(SceneEvent::kCreditsMessage); + + event.message = parseMessage(addr); + event.dst.x = position % 320; + event.dst.y = position / 320; + event.lan = 7; + + scene->push(event); +} + + void TeenAgentEngine::moveTo(const Common::Point &dst, byte o, bool warp) { moveTo(dst.x, dst.y, o, warp); } diff --git a/engines/teenagent/teenagent.h b/engines/teenagent/teenagent.h index 36bbb815e5..d9e8731ce5 100644 --- a/engines/teenagent/teenagent.h +++ b/engines/teenagent/teenagent.h @@ -68,6 +68,7 @@ public: void displayMessage(uint16 addr, byte color = 0xd1); void displayMessage(const Common::String &str, byte color = 0xd1); void displayCredits(uint16 addr); + void displayCutsceneMessage(uint16 addr, uint16 position); void moveTo(const Common::Point &dst, byte o, bool warp = false); void moveTo(uint16 x, uint16 y, byte o, bool warp = false); void moveTo(Object *obj); |