diff options
author | Paul Gilbert | 2018-03-11 15:30:17 -0400 |
---|---|---|
committer | Paul Gilbert | 2018-03-11 15:30:17 -0400 |
commit | e20266d60659d6d0d85d327567512c82df72f6a1 (patch) | |
tree | 03b1ce572adbc0cd5e787929f4c81b20a477a4cf /engines/xeen/subtitles.cpp | |
parent | 41ca5d24956efa3fd151954ba6f89572272df03b (diff) | |
download | scummvm-rg350-e20266d60659d6d0d85d327567512c82df72f6a1.tar.gz scummvm-rg350-e20266d60659d6d0d85d327567512c82df72f6a1.tar.bz2 scummvm-rg350-e20266d60659d6d0d85d327567512c82df72f6a1.zip |
XEEN: Subtitle fixes for Clouds of Xeen intro
Diffstat (limited to 'engines/xeen/subtitles.cpp')
-rw-r--r-- | engines/xeen/subtitles.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/engines/xeen/subtitles.cpp b/engines/xeen/subtitles.cpp index f6702fcf73..9a5f250cf9 100644 --- a/engines/xeen/subtitles.cpp +++ b/engines/xeen/subtitles.cpp @@ -38,7 +38,7 @@ Subtitles::~Subtitles() { } void Subtitles::loadSubtitles() { - File f("special.bin", 2); + File f("special.bin"); while (f.pos() < f.size()) _lines.push_back(f.readString()); f.close(); @@ -133,5 +133,30 @@ void Subtitles::show() { } } +/*------------------------------------------------------------------------*/ + +void CloudsSubtitles::loadSubtitles() { + File f("special.bin"); + + // The first subtitle line contains all the text for the Clouds intro. Since ScummVM allows + // both voice and subtitles at the same time, unlike the original, we need to split up the + // first subtitle into separate lines to allow them to better interleave with the voice + Common::String line = f.readString(); + for (;;) { + const char *lineSep = strstr(line.c_str(), " "); + if (!lineSep) + break; + + _lines.push_back(Common::String(line.c_str(), lineSep)); + line = Common::String(lineSep + 3); + while (line.hasPrefix(" ")) + line.deleteChar(0); + } + + // Read in remaining lines + while (f.pos() < f.size()) + _lines.push_back(f.readString()); + f.close(); +} } // End of namespace Xeen |