From 5727b097b2b22db9c05afbd701a35a5f4af66334 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Sat, 16 Mar 2013 00:50:40 -0400 Subject: PEGASUS: Add the new demo theora videos --- engines/pegasus/pegasus.cpp | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'engines/pegasus/pegasus.cpp') diff --git a/engines/pegasus/pegasus.cpp b/engines/pegasus/pegasus.cpp index 2dae8f4f60..1441ff4f3c 100644 --- a/engines/pegasus/pegasus.cpp +++ b/engines/pegasus/pegasus.cpp @@ -37,6 +37,7 @@ #include "base/plugins.h" #include "base/version.h" #include "gui/saveload.h" +#include "video/theora_decoder.h" #include "video/qt_decoder.h" #include "pegasus/console.h" @@ -1362,8 +1363,14 @@ bool PegasusEngine::playMovieScaled(Video::VideoDecoder *video, uint16 x, uint16 if (video->needsUpdate()) { const Graphics::Surface *frame = video->decodeNextFrame(); - if (frame) - drawScaledFrame(frame, x, y); + if (frame) { + if (frame->w <= 320 && frame->h <= 240) { + drawScaledFrame(frame, x, y); + } else { + _system->copyRectToScreen((byte *)frame->pixels, frame->pitch, x, y, frame->w, frame->h); + _system->updateScreen(); + } + } } Input input; @@ -1387,6 +1394,18 @@ void PegasusEngine::die(const DeathReason reason) { } void PegasusEngine::doDeath() { +#ifdef USE_THEORADEC + // The updated demo has a new Theora video for the closing + if (isDemo() && _deathReason == kPlayerWonGame) { + Video::TheoraDecoder decoder; + + if (decoder.loadFile("Images/Demo TSA/DemoClosing.ogg")) { + decoder.start(); + playMovieScaled(&decoder, 0, 0); + } + } +#endif + _gfx->doFadeOutSync(); throwAwayEverything(); useMenu(new DeathMenu(_deathReason)); @@ -1591,6 +1610,16 @@ void PegasusEngine::startNewGame() { GameState.setPrehistoricSeenFlyer2(false); GameState.setPrehistoricSeenBridgeZoom(false); GameState.setPrehistoricBreakerThrown(false); + +#ifdef USE_THEORADEC + // The updated demo has a new Theora video for the closing + Video::TheoraDecoder decoder; + + if (decoder.loadFile("Images/Demo TSA/DemoOpening.ogg")) { + decoder.start(); + playMovieScaled(&decoder, 0, 0); + } +#endif } else { jumpToNewEnvironment(kCaldoriaID, kCaldoria00, kEast); } -- cgit v1.2.3