diff options
author | Vladimir Menshakov | 2009-12-08 22:04:00 +0000 |
---|---|---|
committer | Vladimir Menshakov | 2009-12-08 22:04:00 +0000 |
commit | 5de8c469638cbd00b791a8cfc90e249628e1ea99 (patch) | |
tree | 7bdbeef37d1fe4d91a1918cf38c4441848d0ea02 /engines/teenagent | |
parent | c2f9c512a1790118b95c2b171f9931f423a9417f (diff) | |
download | scummvm-rg350-5de8c469638cbd00b791a8cfc90e249628e1ea99.tar.gz scummvm-rg350-5de8c469638cbd00b791a8cfc90e249628e1ea99.tar.bz2 scummvm-rg350-5de8c469638cbd00b791a8cfc90e249628e1ea99.zip |
added final credits
svn-id: r46297
Diffstat (limited to 'engines/teenagent')
-rw-r--r-- | engines/teenagent/callbacks.cpp | 2 | ||||
-rw-r--r-- | engines/teenagent/scene.cpp | 18 | ||||
-rw-r--r-- | engines/teenagent/scene.h | 1 | ||||
-rw-r--r-- | engines/teenagent/teenagent.cpp | 15 | ||||
-rw-r--r-- | engines/teenagent/teenagent.h | 1 |
5 files changed, 36 insertions, 1 deletions
diff --git a/engines/teenagent/callbacks.cpp b/engines/teenagent/callbacks.cpp index 20088584f4..38488cfb00 100644 --- a/engines/teenagent/callbacks.cpp +++ b/engines/teenagent/callbacks.cpp @@ -3784,7 +3784,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) { waitAnimation(); playMusic(11); - //BIG FIXME: show scrolling credits + displayCredits(); loadScene(39, 192, 177, 0); hideActor(); Dialog::showMono(scene, 0x8b4d, 953, 0xe3, 1); //well... diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp index c56434b9c1..3851686a44 100644 --- a/engines/teenagent/scene.cpp +++ b/engines/teenagent/scene.cpp @@ -491,6 +491,20 @@ bool Scene::render(OSystem *system) { do { restart = false; busy = processEventQueue(); + + if (current_event.type == SceneEvent::kCredits) { + system->fillScreen(0); + ///\todo: optimize me + Graphics::Surface *surface = system->lockScreen(); + res->font7.render(surface, current_event.dst.x, current_event.dst.y--, current_event.message, current_event.color); + system->unlockScreen(); + + if (current_event.dst.y < -(int)current_event.timer) + current_event.clear(); + + return true; + } + if (!message.empty() && message_timer != 0) { if (--message_timer == 0) { clearMessage(); @@ -925,6 +939,10 @@ bool Scene::processEventQueue() { debug(0, "*stub* shaking the screen"); current_event.clear(); break; + + case SceneEvent::kCredits: + debug(0, "showing credits"); + break; case SceneEvent::kQuit: debug(0, "quit!"); diff --git a/engines/teenagent/scene.h b/engines/teenagent/scene.h index 97efea38d2..d9c89e689b 100644 --- a/engines/teenagent/scene.h +++ b/engines/teenagent/scene.h @@ -57,6 +57,7 @@ struct SceneEvent { kWaitForAnimation, kWaitLanAnimationFrame, kCreditsMessage, //16 + kCredits, kTimer, kEffect, kQuit diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp index 68b1fca799..079920b262 100644 --- a/engines/teenagent/teenagent.cpp +++ b/engines/teenagent/teenagent.cpp @@ -489,6 +489,21 @@ void TeenAgentEngine::displayCredits(uint16 addr) { scene->push(event); } +void TeenAgentEngine::displayCredits() { + SceneEvent event(SceneEvent::kCredits); + event.message = parseMessage(0xe488); + event.dst.y = 200; + + int lines = 1; + for(uint i = 0; i < event.message.size(); ++i) + if (event.message[i] == '\n') + ++lines; + event.dst.x = (320 - Resources::instance()->font7.render(NULL, 0, 0, event.message, 0xd1)) / 2; + event.timer = 11 * lines - event.dst.y + 22; + //debug(0, "credits = %s", event.message.c_str()); + scene->push(event); +} + void TeenAgentEngine::displayCutsceneMessage(uint16 addr, uint16 position) { SceneEvent event(SceneEvent::kCreditsMessage); diff --git a/engines/teenagent/teenagent.h b/engines/teenagent/teenagent.h index 24ad2fd58a..dbb510df03 100644 --- a/engines/teenagent/teenagent.h +++ b/engines/teenagent/teenagent.h @@ -105,6 +105,7 @@ public: void waitLanAnimationFrame(byte slot, uint16 frame); void setTimerCallback(uint16 addr, uint16 frames); void shakeScreen(); + void displayCredits(); Common::RandomSource random; |