diff options
author | Marisa-Chan | 2014-07-12 21:38:11 +0000 |
---|---|---|
committer | Marisa-Chan | 2014-07-12 21:38:11 +0000 |
commit | 9dd9bfce808cacb90bdea1ee7cc371e698c1eca9 (patch) | |
tree | 50297cc8354c853f6a501eb7e7d9be35a191e079 /engines | |
parent | 57857a1d768fc9b226326efe2294f73e847c816e (diff) | |
download | scummvm-rg350-9dd9bfce808cacb90bdea1ee7cc371e698c1eca9.tar.gz scummvm-rg350-9dd9bfce808cacb90bdea1ee7cc371e698c1eca9.tar.bz2 scummvm-rg350-9dd9bfce808cacb90bdea1ee7cc371e698c1eca9.zip |
ZVISION: String manager only load text lines without parsing text styles.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/zvision/text/string_manager.cpp | 25 | ||||
-rw-r--r-- | engines/zvision/text/string_manager.h | 4 |
2 files changed, 27 insertions, 2 deletions
diff --git a/engines/zvision/text/string_manager.cpp b/engines/zvision/text/string_manager.cpp index cadfbf1f49..114f298505 100644 --- a/engines/zvision/text/string_manager.cpp +++ b/engines/zvision/text/string_manager.cpp @@ -22,6 +22,8 @@ #include "common/scummsys.h" +#include "zvision/zvision.h" +#include "zvision/core/search_manager.h" #include "zvision/text/string_manager.h" #include "zvision/fonts/truetype_font.h" @@ -49,10 +51,25 @@ StringManager::~StringManager() { void StringManager::initialize(ZVisionGameId gameId) { if (gameId == GID_NEMESIS) { // TODO: Check this hardcoded filename against all versions of Nemesis - parseStrFile("nemesis.str"); + loadStrFile("nemesis.str"); } else if (gameId == GID_GRANDINQUISITOR) { // TODO: Check this hardcoded filename against all versions of Grand Inquisitor - parseStrFile("inquis.str"); + loadStrFile("inquis.str"); + } +} + +void StringManager::loadStrFile(const Common::String &fileName) { + Common::File file; + if (!_engine->getSearchManager()->openFile(file, fileName)) { + warning("%s does not exist. String parsing failed", fileName.c_str()); + return; + } + uint lineNumber = 0; + while (!file.eos()) { + _lines[lineNumber] = readWideLine(file); + + lineNumber++; + assert(lineNumber <= NUM_TEXT_LINES); } } @@ -252,4 +269,8 @@ StringManager::TextStyle StringManager::getTextStyle(uint stringNumber) { return _inGameText[stringNumber].fragments.front().style; } +const Common::String StringManager::getTextLine(uint stringNumber) { + return _lines[stringNumber]; +} + } // End of namespace ZVision diff --git a/engines/zvision/text/string_manager.h b/engines/zvision/text/string_manager.h index af8324b890..e226fbeae8 100644 --- a/engines/zvision/text/string_manager.h +++ b/engines/zvision/text/string_manager.h @@ -63,6 +63,8 @@ private: private: ZVision *_engine; + Common::String _lines[NUM_TEXT_LINES]; + InGameText _inGameText[NUM_TEXT_LINES]; Common::HashMap<Common::String, TruetypeFont *> _fonts; @@ -71,8 +73,10 @@ private: public: void initialize(ZVisionGameId gameId); StringManager::TextStyle getTextStyle(uint stringNumber); + const Common::String getTextLine(uint stringNumber); private: + void loadStrFile(const Common::String &fileName); void parseStrFile(const Common::String &fileName); void parseTag(const Common::String &tagString, uint lineNumber); |