aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorSven Hesse2010-08-08 01:05:46 +0000
committerSven Hesse2010-08-08 01:05:46 +0000
commita78ddb8488de0b6928b0135dfbd461e39380c436 (patch)
treedf8bfd05029eb9f8af2f3c9f8fc027e08a9fbd26 /engines
parent0be37b6b28bf0089dd1f23bc6b81fb256c2cb4ae (diff)
downloadscummvm-rg350-a78ddb8488de0b6928b0135dfbd461e39380c436.tar.gz
scummvm-rg350-a78ddb8488de0b6928b0135dfbd461e39380c436.tar.bz2
scummvm-rg350-a78ddb8488de0b6928b0135dfbd461e39380c436.zip
GOB: Handle VMD subtitles again
svn-id: r51916
Diffstat (limited to 'engines')
-rw-r--r--engines/gob/scenery.cpp9
-rw-r--r--engines/gob/videoplayer.cpp16
-rw-r--r--engines/gob/videoplayer.h2
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);