Skip to content

Commit

Permalink
More robust base.jd loading; Use boost::locale on non-Win32.
Browse files Browse the repository at this point in the history
  • Loading branch information
Oberon00 committed Jul 25, 2013
1 parent 0e702c5 commit 21e1f45
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,14 @@ int main(int argc, char* argv[])
cmdLine.assign(argv, argv + argc);
#endif

#ifdef _WIN32
std::locale::global(boost::locale::generator().generate("")); // Use UTF-8
fs::path::imbue(std::locale()); // Not sure if this is necessary.
std::cout.imbue(std::locale());
std::cerr.imbue(std::locale());
std::clog.imbue(std::locale());
std::cin.imbue(std::locale());

#ifdef _WIN32
std::string defaultGame;
{ // Scope for moduleName, moduleNameW
uint16_t moduleNameW[MAX_PATH];
Expand Down Expand Up @@ -285,12 +285,13 @@ int main(int argc, char* argv[])
FileSystem& fs = FileSystem::get();
regSvc(fs);

std::string programpath = PHYSFS_getBaseDir();
fs::path programpath = PHYSFS_getBaseDir();
std::vector<std::string> baselibpaths;
baselibpaths.push_back(programpath + "/base.jd");
baselibpaths.push_back(programpath + "/../base.jd");
baselibpaths.push_back(programpath + "/../share/jade-engine/base.jd");
baselibpaths.push_back(programpath + "/../share/base.jd");
baselibpaths.push_back((programpath / "base.jd").string());
baselibpaths.push_back((programpath / "../base.jd/base.jd").string());
baselibpaths.push_back((programpath / "../base.jd").string());
baselibpaths.push_back((programpath / "../share/jade-engine/base.jd").string());
baselibpaths.push_back((programpath / "../share/base.jd").string());
baselibpaths.push_back(basepath + "/base.jd");
baselibpaths.push_back("./base.jd");
fs.mountFirstWorking(baselibpaths, "/", FileSystem::logWarnings|FileSystem::mountOptional);
Expand Down

0 comments on commit 21e1f45

Please sign in to comment.