(svn r10182) -Codechange: rewrite most part of the file loading/searching to be more flexible.

-Codechange: add support for personal directories on Windows.
-Fix [FS#153, FS#193, FS#502, FS#816, FS#854]: fix issues related to fixed names, fixed places of files/directories and application bundles.
This commit is contained in:
rubidium
2007-06-17 15:48:57 +00:00
parent 5fdde681c2
commit 347c28b71a
25 changed files with 427 additions and 274 deletions

View File

@@ -23,6 +23,7 @@
#include "music.h"
#include "date.h"
#include "industry.h"
#include "fileio.h"
#include "helpers.hpp"
#include "cargotype.h"
#include "group.h"
@@ -1295,8 +1296,15 @@ static int GetLanguageList(Language *langs, int start, int max, const char *path
*/
void InitializeLanguagePacks()
{
Searchpath sp;
Language files[MAX_LANG];
uint language_count = GetLanguageList(files, 0, lengthof(files), _paths.lang_dir);
uint language_count = 0;
FOR_ALL_SEARCHPATHS(sp) {
char path[MAX_PATH];
FioAppendDirectory(path, lengthof(path), sp, LANG_DIR);
language_count += GetLanguageList(files, language_count, lengthof(files), path);
}
if (language_count == 0) error("No available language packs (invalid versions?)");
/* Sort the language names alphabetically */