mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-23 12:44:02 +00:00
GROOVIE: Initial plug in of subtitles to video player
This commit is contained in:
parent
bb42c9bda4
commit
5e05bacb1c
@ -950,6 +950,18 @@ bool Script::playvideofromref(uint32 fileref, bool loopUntilAudioDone) {
|
||||
if (_version == kGroovieCDY && _scriptFile == "26a_graf.grv")
|
||||
_bitflags |= 1;
|
||||
_vm->_videoPlayer->load(_videoFile, _bitflags);
|
||||
|
||||
// Find correct filename
|
||||
ResInfo info;
|
||||
_vm->_resMan->getResInfo(fileref, info);
|
||||
|
||||
// Remove the extension and add ".txt"
|
||||
info.filename.deleteLastChar();
|
||||
info.filename.deleteLastChar();
|
||||
info.filename.deleteLastChar();
|
||||
info.filename += "txt";
|
||||
|
||||
_vm->_videoPlayer->loadSubtitles(info.filename.c_str());
|
||||
} else {
|
||||
error("Groovie::Script: Couldn't open file");
|
||||
return true;
|
||||
|
@ -23,6 +23,7 @@
|
||||
#define GROOVIE_VIDEO_PLAYER_H
|
||||
|
||||
#include "common/system.h"
|
||||
#include "video/subtitles.h"
|
||||
|
||||
namespace Audio {
|
||||
class QueuingAudioStream;
|
||||
@ -48,6 +49,8 @@ public:
|
||||
virtual void copyfgtobg(uint8 arg) {}
|
||||
void setOverrideSpeed(bool isOverride);
|
||||
|
||||
void loadSubtitles(const char *fname) { _subtitles.loadSRTFile(fname); }
|
||||
|
||||
protected:
|
||||
// To be implemented by subclasses
|
||||
virtual uint16 loadInternal() = 0;
|
||||
@ -71,6 +74,8 @@ private:
|
||||
uint32 _lastFrameTime;
|
||||
float _frameTimeDrift;
|
||||
|
||||
Video::Subtitles _subtitles;
|
||||
|
||||
protected:
|
||||
void waitFrame();
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user