Skip to content
Permalink
Browse files

ZVISION: Error out when the game string file isn't found

  • Loading branch information
bluegr committed Dec 22, 2014
1 parent f364756 commit b51852c641cf4d558d035d7d1dd9309d6d238647
Showing with 4 additions and 7 deletions.
  1. +4 −7 engines/zvision/text/string_manager.cpp
@@ -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);

0 comments on commit b51852c

Please sign in to comment.
You can’t perform that action at this time.