From e20266d60659d6d0d85d327567512c82df72f6a1 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 11 Mar 2018 15:30:17 -0400 Subject: XEEN: Subtitle fixes for Clouds of Xeen intro --- engines/xeen/subtitles.cpp | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'engines/xeen/subtitles.cpp') 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 -- cgit v1.2.3