diff options
author | RichieSams | 2013-09-16 00:10:35 -0500 |
---|---|---|
committer | RichieSams | 2013-09-16 00:10:35 -0500 |
commit | d59cf9fda66f8bcd89f12248d7337727d708f425 (patch) | |
tree | 8a3b40fc4832474475d0b390f41d65e32d6513bd /engines/zvision | |
parent | 14cfc65c0d3f3ac678c17614140ea32902abec69 (diff) | |
download | scummvm-rg350-d59cf9fda66f8bcd89f12248d7337727d708f425.tar.gz scummvm-rg350-d59cf9fda66f8bcd89f12248d7337727d708f425.tar.bz2 scummvm-rg350-d59cf9fda66f8bcd89f12248d7337727d708f425.zip |
ZVISION: Convert StringManager::parseStr to use readWideLine()
Diffstat (limited to 'engines/zvision')
-rw-r--r-- | engines/zvision/string_manager.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/engines/zvision/string_manager.cpp b/engines/zvision/string_manager.cpp index 127b62f34e..1cc3c15fd2 100644 --- a/engines/zvision/string_manager.cpp +++ b/engines/zvision/string_manager.cpp @@ -63,11 +63,16 @@ void StringManager::parseStrFile(const Common::String &fileName) { return; } - Common::String line = file.readLine(); - uint lineNumber = 0; while (!file.eos()) { - Common::String asciiLine = wideToASCII(line.c_str(), line.size()); + _lastStyle.align = Graphics::kTextAlignLeft; + _lastStyle.color = 0; + _lastStyle.font = nullptr; + + Common::String asciiLine = readWideLine(file); + if (asciiLine.empty()) { + continue; + } char tagString[150]; uint tagStringCursor = 0; @@ -79,16 +84,19 @@ void StringManager::parseStrFile(const Common::String &fileName) { switch (asciiLine[i]) { case '<': inTag = true; + if (!_inGameText[lineNumber].fragments.empty()) { + _inGameText[lineNumber].fragments.back().text = Common::String(textString, textStringCursor); + textStringCursor = 0; + } break; case '>': inTag = false; - parseTag(Common::String(tagString, tagStringCursor), Common::String(textString, textStringCursor), i); + parseTag(Common::String(tagString, tagStringCursor), lineNumber); tagStringCursor = 0; - textStringCursor = 0; break; default: if (inTag) { - textString[tagStringCursor] = asciiLine[i]; + tagString[tagStringCursor] = asciiLine[i]; tagStringCursor++; } else { textString[textStringCursor] = asciiLine[i]; |