diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp index 259ba8431fd..58be183e8a5 100644 --- a/engines/groovie/script.cpp +++ b/engines/groovie/script.cpp @@ -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; diff --git a/engines/groovie/video/player.h b/engines/groovie/video/player.h index e5f74e1f96d..2f8c947de3f 100644 --- a/engines/groovie/video/player.h +++ b/engines/groovie/video/player.h @@ -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(); };