diff options
author | Sven Hesse | 2007-02-12 14:37:27 +0000 |
---|---|---|
committer | Sven Hesse | 2007-02-12 14:37:27 +0000 |
commit | 15f52b96b80e02cd7d95f1942297016b05b56ee4 (patch) | |
tree | afb239bc8d959583a26cf2939cc3dd7d4f6c3c5d /engines/gob/game.cpp | |
parent | bd1a85582cb5412716c43f133c579a458bb4f933 (diff) | |
download | scummvm-rg350-15f52b96b80e02cd7d95f1942297016b05b56ee4.tar.gz scummvm-rg350-15f52b96b80e02cd7d95f1942297016b05b56ee4.tar.bz2 scummvm-rg350-15f52b96b80e02cd7d95f1942297016b05b56ee4.zip |
Changed language finding again
svn-id: r25525
Diffstat (limited to 'engines/gob/game.cpp')
-rw-r--r-- | engines/gob/game.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/engines/gob/game.cpp b/engines/gob/game.cpp index 1e9354f2fd..8549081297 100644 --- a/engines/gob/game.cpp +++ b/engines/gob/game.cpp @@ -54,6 +54,8 @@ Game::Game(GobEngine *vm) : _vm(vm) { _extHandle = 0; _collisionAreas = 0; _shouldPushColls = 0; + + _foundTotLoc = false; _totTextData = 0; // Collisions stack @@ -690,28 +692,29 @@ int16 Game::openLocTextFile(char *locTextFile, int language) { } char *Game::loadLocTexts(void) { - static bool found = false; char locTextFile[20]; int16 handle; int i; strcpy(locTextFile, _curTotFile); - handle = openLocTextFile(locTextFile, _vm->_global->_language); - if ((handle < 0) && !found) { + handle = openLocTextFile(locTextFile, _vm->_global->_languageWanted); + if (handle >= 0) { + _foundTotLoc = true; + _vm->_global->_language = _vm->_global->_languageWanted; + } + else if (!_foundTotLoc) { for (i = 0; i < 10; i++) { handle = openLocTextFile(locTextFile, i); if (handle >= 0) { - warning("Your game version doesn't support the requested language, using the first one available (%d)", i); _vm->_global->_language = i; - found = true; break; } } } + debugC(1, kDebugFileIO, "Using language %d for %s", _vm->_global->_language, _curTotFile); if (handle >= 0) { - found = true; _vm->_dataio->closeData(handle); return _vm->_dataio->getData(locTextFile); } |