diff options
-rw-r--r-- | engines/gob/scenery.cpp | 9 | ||||
-rw-r--r-- | engines/gob/videoplayer.cpp | 16 | ||||
-rw-r--r-- | engines/gob/videoplayer.h | 2 |
3 files changed, 16 insertions, 11 deletions
diff --git a/engines/gob/scenery.cpp b/engines/gob/scenery.cpp index c427e9299a..f9587dc0b3 100644 --- a/engines/gob/scenery.cpp +++ b/engines/gob/scenery.cpp @@ -636,12 +636,9 @@ void Scenery::updateAnim(int16 layer, int16 frame, int16 animation, int16 flags, _vm->_vidPlayer->play(obj.videoSlot - 1, props); } - /* - // Subtitle - Graphics::CoktelVideo::State state = _vm->_vidPlayer->getState(obj.videoSlot - 1); - if (state.flags & Graphics::CoktelVideo::kStateSpeech) - _vm->_draw->printTotText(state.speechId); - */ + int32 subtitle = _vm->_vidPlayer->getSubtitleIndex(obj.videoSlot - 1); + if (subtitle != -1) + _vm->_draw->printTotText(subtitle); destX = 0; destY = 0; diff --git a/engines/gob/videoplayer.cpp b/engines/gob/videoplayer.cpp index d0d2f4309f..ae2ef32537 100644 --- a/engines/gob/videoplayer.cpp +++ b/engines/gob/videoplayer.cpp @@ -380,11 +380,9 @@ bool VideoPlayer::playFrame(int slot, Properties &properties) { // Only retrace if we're playing the frame we actually want to play _vm->_video->retrace(); - /* - // Subtitle - if (state.flags & Graphics::CoktelDecoder::kStateSpeech) - _vm->_draw->printTotText(state.speechId); - */ + int32 subtitle = video->decoder->getSubtitleIndex(); + if (subtitle != -1) + _vm->_draw->printTotText(subtitle); if (modifiedPal && ((properties.palCmd == 2) || (properties.palCmd == 4))) _vm->_palAnim->fade(_vm->_global->_pPaletteDesc, -2, 0); @@ -510,6 +508,14 @@ Common::MemoryReadStream *VideoPlayer::getEmbeddedFile(const Common::String &fil return video->decoder->getEmbeddedFile(fileName); } +int32 VideoPlayer::getSubtitleIndex(int slot) const { + const Video *video = getVideoBySlot(slot); + if (!video) + return -1; + + return video->decoder->getSubtitleIndex(); +} + void VideoPlayer::writeVideoInfo(const Common::String &file, int16 varX, int16 varY, int16 varFrames, int16 varWidth, int16 varHeight) { diff --git a/engines/gob/videoplayer.h b/engines/gob/videoplayer.h index 7cb9c013b6..d91d0a3845 100644 --- a/engines/gob/videoplayer.h +++ b/engines/gob/videoplayer.h @@ -123,6 +123,8 @@ public: bool hasEmbeddedFile(const Common::String &fileName, int slot = 0) const; Common::MemoryReadStream *getEmbeddedFile(const Common::String &fileName, int slot = 0); + int32 getSubtitleIndex(int slot = 0) const; + void writeVideoInfo(const Common::String &file, int16 varX, int16 varY, int16 varFrames, int16 varWidth, int16 varHeight); |