aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/video/video_theora_player.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/wintermute/video/video_theora_player.cpp')
-rw-r--r--engines/wintermute/video/video_theora_player.cpp28
1 files changed, 18 insertions, 10 deletions
diff --git a/engines/wintermute/video/video_theora_player.cpp b/engines/wintermute/video/video_theora_player.cpp
index 600eae8349..2af3ac1638 100644
--- a/engines/wintermute/video/video_theora_player.cpp
+++ b/engines/wintermute/video/video_theora_player.cpp
@@ -86,6 +86,7 @@ void VideoTheoraPlayer::SetDefaults() {
_theoraDecoder = nullptr;
_subtitler = new VideoSubtitler(_gameRef);
+ _subtitles = false;
}
//////////////////////////////////////////////////////////////////////////
@@ -134,7 +135,13 @@ bool VideoTheoraPlayer::initialize(const Common::String &filename, const Common:
#endif
- _subtitler->loadSubtitles(_filename.c_str(), subtitleFile.c_str());
+ if (_subtitler->loadSubtitles(_filename.c_str(), subtitleFile.c_str())) {
+ // We have subtitles
+ _subtitles = true;
+ } else {
+ // We couldn't load subtitles...
+ _subtitles = false;
+ }
_theoraDecoder->loadStream(_file);
@@ -220,8 +227,10 @@ bool VideoTheoraPlayer::play(TVideoPlayback type, int x, int y, bool freezeGame,
_state = THEORA_STATE_PLAYING;
_looping = looping;
_playbackType = type;
- _subtitler->update(_theoraDecoder->getFrameCount());
- _subtitler->display();
+ if (_subtitler && _subtitles && _gameRef->_subtitles) {
+ _subtitler->update(_theoraDecoder->getFrameCount());
+ _subtitler->display();
+ }
_startTime = startTime;
_volume = volume;
_posX = x;
@@ -296,8 +305,9 @@ bool VideoTheoraPlayer::update() {
}
if (_theoraDecoder) {
-
- _subtitler->update(_theoraDecoder->getCurFrame());
+ if (_subtitler && _subtitles && _gameRef->_subtitles) {
+ _subtitler->update(_theoraDecoder->getCurFrame());
+ }
if (_theoraDecoder->endOfVideo() && _looping) {
warning("Should loop movie %s, hacked for now", _filename.c_str());
@@ -422,12 +432,10 @@ bool VideoTheoraPlayer::display(uint32 alpha) {
} else {
res = STATUS_FAILED;
}
- // TODO: Add subtitles-support
-/* if (m_Subtitler && _gameRef->m_VideoSubtitles) {
- m_Subtitler->display();
- }*/
- _subtitler->display();
+ if (_subtitler && _subtitles && _gameRef->_subtitles) {
+ _subtitler->display();
+ }
return res;
}