MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / LoadSubtitles

Function LoadSubtitles

TombEngine/Sound/sound.cpp:608–627  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

606}
607
608void LoadSubtitles(const std::string& name)
609{
610 Subtitles.clear();
611
612 auto subtitleName = FullAudioDirectory + name + ".srt";
613
614 if (!std::filesystem::is_regular_file(subtitleName))
615 subtitleName = FullAudioDirectory + "/subtitles/" + name + ".srt";
616
617 if (!std::filesystem::is_regular_file(subtitleName))
618 return;
619
620 auto factory = new SubtitleParserFactory(subtitleName);
621 auto parser = factory->getParser();
622 Subtitles = parser->getSubtitles();
623 delete factory;
624
625 for (auto& sub : Subtitles)
626 sub->setText(ReplaceNewLineSymbols(sub->getText()));
627}
628
629void PlaySoundTrack(const std::string& track, short mask)
630{

Callers 1

PlaySoundTrackFunction · 0.85

Calls 6

ReplaceNewLineSymbolsFunction · 0.85
getParserMethod · 0.80
getSubtitlesMethod · 0.80
setTextMethod · 0.80
getTextMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected