Skip to content

Commit

Permalink
ZVISION: Error out when the game string file isn't found
Browse files Browse the repository at this point in the history
  • Loading branch information
bluegr committed Dec 22, 2014
1 parent f364756 commit b51852c
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions engines/zvision/text/string_manager.cpp
Expand Up @@ -43,21 +43,18 @@ StringManager::~StringManager() {
}

void StringManager::initialize(ZVisionGameId gameId) {
if (gameId == GID_NEMESIS) {
// TODO: Check this hardcoded filename against all versions of Nemesis
if (gameId == GID_NEMESIS)
loadStrFile("nemesis.str");
} else if (gameId == GID_GRANDINQUISITOR) {
// TODO: Check this hardcoded filename against all versions of Grand Inquisitor
else if (gameId == GID_GRANDINQUISITOR)
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;
error("%s does not exist. String parsing failed", fileName.c_str());
}

uint lineNumber = 0;
while (!file.eos()) {
_lines[lineNumber] = readWideLine(file);
Expand Down

0 comments on commit b51852c

Please sign in to comment.