mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-28 07:16:53 +00:00
VIDEO: Implement VMD subtitles
svn-id: r51915
This commit is contained in:
parent
e6f5785436
commit
0be37b6b28
@ -221,6 +221,10 @@ Common::MemoryReadStream *CoktelDecoder::getEmbeddedFile(const Common::String &f
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32 CoktelDecoder::getSubtitleIndex() const {
|
||||
return -1;
|
||||
}
|
||||
|
||||
void CoktelDecoder::close() {
|
||||
disableSound();
|
||||
freeSurface();
|
||||
@ -1473,7 +1477,8 @@ VMDDecoder::VMDDecoder(Audio::Mixer &mixer, Audio::Mixer::SoundType soundType) :
|
||||
_audioFormat(kAudioFormat8bitRaw), _hasVideo(false), _videoCodec(0),
|
||||
_blitMode(0), _bytesPerPixel(0), _firstFramePos(0),
|
||||
_frameData(0), _frameDataSize(0), _frameDataLen(0),
|
||||
_videoBuffer(0), _videoBufferSize(0), _externalCodec(false), _codec(0) {
|
||||
_videoBuffer(0), _videoBufferSize(0), _externalCodec(false), _codec(0),
|
||||
_subtitle(-1) {
|
||||
|
||||
}
|
||||
|
||||
@ -1499,6 +1504,8 @@ bool VMDDecoder::seek(int32 frame, int whence, bool restart) {
|
||||
_stream->seek(_frames[frame + 1].offset);
|
||||
_curFrame = frame;
|
||||
|
||||
_subtitle = -1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1927,6 +1934,7 @@ void VMDDecoder::processFrame() {
|
||||
_dirtyRects.clear();
|
||||
|
||||
_paletteDirty = false;
|
||||
_subtitle = -1;
|
||||
|
||||
bool startSound = false;
|
||||
|
||||
@ -2029,9 +2037,7 @@ void VMDDecoder::processFrame() {
|
||||
|
||||
} else if (part.type == kPartTypeSubtitle) {
|
||||
|
||||
// TODO:
|
||||
// state.speechId = part.id;
|
||||
// Always triggers when speech starts
|
||||
_subtitle = part.id;
|
||||
_stream->skip(part.size);
|
||||
|
||||
} else {
|
||||
@ -2443,6 +2449,10 @@ Common::MemoryReadStream *VMDDecoder::getEmbeddedFile(const Common::String &file
|
||||
return stream;
|
||||
}
|
||||
|
||||
int32 VMDDecoder::getSubtitleIndex() const {
|
||||
return _subtitle;
|
||||
}
|
||||
|
||||
} // End of namespace Graphics
|
||||
|
||||
#endif // GRAPHICS_VIDEO_COKTELDECODER_H
|
||||
|
@ -110,6 +110,9 @@ public:
|
||||
/** Return that embedded file. */
|
||||
virtual Common::MemoryReadStream *getEmbeddedFile(const Common::String &fileName) const;
|
||||
|
||||
/** Return the current subtitle index. */
|
||||
virtual int32 getSubtitleIndex() const;
|
||||
|
||||
|
||||
// VideoDecoder interface
|
||||
|
||||
@ -351,6 +354,8 @@ public:
|
||||
bool hasEmbeddedFile(const Common::String &fileName) const;
|
||||
Common::MemoryReadStream *getEmbeddedFile(const Common::String &fileName) const;
|
||||
|
||||
int32 getSubtitleIndex() const;
|
||||
|
||||
|
||||
// VideoDecoder interface
|
||||
|
||||
@ -459,6 +464,8 @@ private:
|
||||
bool _externalCodec;
|
||||
Codec *_codec;
|
||||
|
||||
int32 _subtitle;
|
||||
|
||||
// Loading helper functions
|
||||
bool assessVideoProperties();
|
||||
bool assessAudioProperties();
|
||||
|
Loading…
x
Reference in New Issue
Block a user