From d8e4d70b674ef2fc86300d01a1827b215c6abc6c Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Fri, 27 Jul 2007 13:05:24 +0000 Subject: The language fallback now prefers the other english if USA or GRB was requested but wasn't found in the game data. svn-id: r28237 --- engines/gob/game.cpp | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) (limited to 'engines/gob/game.cpp') diff --git a/engines/gob/game.cpp b/engines/gob/game.cpp index a5993fd1de..e47dc1809f 100644 --- a/engines/gob/game.cpp +++ b/engines/gob/game.cpp @@ -672,18 +672,39 @@ byte *Game::loadLocTexts(int32 *dataSize) { 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); + + } else if (!_foundTotLoc) { + bool found = false; + + if (_vm->_global->_languageWanted == 2) { + handle = openLocTextFile(locTextFile, 5); + if (handle >= 0) { + _vm->_global->_language = 5; + found = true; + } + } else if (_vm->_global->_languageWanted == 5) { + handle = openLocTextFile(locTextFile, 2); if (handle >= 0) { - _vm->_global->_language = i; - break; + _vm->_global->_language = 2; + found = true; } } + + if (!found) { + for (i = 0; i < 10; i++) { + handle = openLocTextFile(locTextFile, i); + if (handle >= 0) { + _vm->_global->_language = i; + break; + } + } + } + } + debugC(1, kDebugFileIO, "Using language %d for %s", _vm->_global->_language, _curTotFile); -- cgit v1.2.3