mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-12 06:00:48 +00:00
ZVISION: String manager only load text lines without parsing text styles.
This commit is contained in:
parent
57857a1d76
commit
9dd9bfce80
@ -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
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user