From 9ef705ebb46c93dea4da42ea63d42b34b395ae89 Mon Sep 17 00:00:00 2001 From: lukaslw Date: Fri, 15 Aug 2014 21:57:26 +0200 Subject: PRINCE: playNextFLCFrame() update --- engines/prince/prince.cpp | 15 ++++++++++----- engines/prince/prince.h | 3 ++- engines/prince/script.cpp | 3 ++- 3 files changed, 14 insertions(+), 7 deletions(-) (limited to 'engines/prince') diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp index cfd1e77628..634ac2ccf6 100644 --- a/engines/prince/prince.cpp +++ b/engines/prince/prince.cpp @@ -94,7 +94,8 @@ PrinceEngine::PrinceEngine(OSystem *syst, const PrinceGameDescription *gameDesc) _checkBitmapTemp(nullptr), _checkBitmap(nullptr), _checkMask(0), _checkX(0), _checkY(0), _traceLineFirstPointFlag(false), _tracePointFirstPointFlag(false), _coordsBuf2(nullptr), _coords2(nullptr), _coordsBuf3(nullptr), _coords3(nullptr), _shanLen(0), _directionTable(nullptr), _currentMidi(0), _lightX(0), _lightY(0), _curveData(nullptr), _curvPos(0), - _creditsData(nullptr), _creditsDataSize(0), _currentTime(0), _zoomBitmap(nullptr), _shadowBitmap(nullptr), _transTable(nullptr) { + _creditsData(nullptr), _creditsDataSize(0), _currentTime(0), _zoomBitmap(nullptr), _shadowBitmap(nullptr), _transTable(nullptr), + _flcFrameSurface(nullptr) { // Debug/console setup DebugMan.addDebugChannel(DebugChannel::kScript, "script", "Prince Script debug channel"); @@ -626,7 +627,7 @@ void PrinceEngine::stopMusic() { } } -bool PrinceEngine::playNextFrame() { +bool PrinceEngine::playNextFLCFrame() { if (!_flicPlayer.isVideoLoaded()) return false; @@ -634,9 +635,13 @@ bool PrinceEngine::playNextFrame() { if (s) { _graph->drawTransparentSurface(_graph->_frontScreen, 0, 0, s, 255); _graph->change(); + _flcFrameSurface = s; } else if (_flicLooped) { _flicPlayer.rewind(); - playNextFrame(); + playNextFLCFrame(); + } else if (_flcFrameSurface) { + _graph->drawTransparentSurface(_graph->_frontScreen, 0, 0, _flcFrameSurface, 255); + _graph->change(); } return true; @@ -783,7 +788,7 @@ bool PrinceEngine::loadAnim(uint16 animNr, bool loop) { debugEngine("%s loaded", streamName.c_str()); _flicLooped = loop; _flicPlayer.start(); - playNextFrame(); + playNextFLCFrame(); return true; } @@ -1796,7 +1801,7 @@ void PrinceEngine::drawScreen() { showNormAnims(); - playNextFrame(); + playNextFLCFrame(); showObjects(); diff --git a/engines/prince/prince.h b/engines/prince/prince.h index d9f86bc912..7e4592ad54 100644 --- a/engines/prince/prince.h +++ b/engines/prince/prince.h @@ -274,6 +274,7 @@ public: const PrinceGameDescription *_gameDescription; Video::FlicDecoder _flicPlayer; + const Graphics::Surface *_flcFrameSurface; VariaTxt *_variaTxt; uint32 _talkTxtSize; @@ -596,7 +597,7 @@ public: int checkRightUpDir(); private: - bool playNextFrame(); + bool playNextFLCFrame(); void keyHandler(Common::Event event); int checkMob(Graphics::Surface *screen, Common::Array &mobList, bool usePriorityList); void drawScreen(); diff --git a/engines/prince/script.cpp b/engines/prince/script.cpp index 9dabebfb5e..582864d0c3 100644 --- a/engines/prince/script.cpp +++ b/engines/prince/script.cpp @@ -1723,6 +1723,7 @@ void Interpreter::O_SETBACKANIMDATA() { void Interpreter::O_VIEWFLC() { int32 animNr = readScriptFlagValue(); + _vm->_flcFrameSurface = nullptr; _vm->loadAnim(animNr, false); debugInterpreter("O_VIEWFLC animNr %d", animNr); } @@ -1745,8 +1746,8 @@ void Interpreter::O_CHECKFLCEND() { } } -// TODO void Interpreter::O_FREEFLC() { + _vm->_flcFrameSurface = nullptr; debugInterpreter("O_FREEFLC"); } -- cgit v1.2.3