aboutsummaryrefslogtreecommitdiff
path: root/engines/prince
diff options
context:
space:
mode:
authorlukaslw2014-08-15 21:57:26 +0200
committerlukaslw2014-08-15 21:57:26 +0200
commit9ef705ebb46c93dea4da42ea63d42b34b395ae89 (patch)
tree23fa885de1dccac83005f89968eb7da0130345f0 /engines/prince
parent40ac742169db49e16756092f6e9bd28b23b8d7e3 (diff)
downloadscummvm-rg350-9ef705ebb46c93dea4da42ea63d42b34b395ae89.tar.gz
scummvm-rg350-9ef705ebb46c93dea4da42ea63d42b34b395ae89.tar.bz2
scummvm-rg350-9ef705ebb46c93dea4da42ea63d42b34b395ae89.zip
PRINCE: playNextFLCFrame() update
Diffstat (limited to 'engines/prince')
-rw-r--r--engines/prince/prince.cpp15
-rw-r--r--engines/prince/prince.h3
-rw-r--r--engines/prince/script.cpp3
3 files changed, 14 insertions, 7 deletions
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<Mob> &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");
}