rework on resources system

This commit is contained in:
Eduardo Bart 2011-05-19 15:46:40 -03:00
parent ab6c52a3ee
commit afc79a99e1
1 changed files with 10 additions and 3 deletions

View File

@ -43,12 +43,19 @@ void Resources::init(const char *argv0)
possibleDirs.push_back("data"); possibleDirs.push_back("data");
possibleDirs.push_back(baseDir + "data"); possibleDirs.push_back(baseDir + "data");
possibleDirs.push_back(baseDir + "../data"); possibleDirs.push_back(baseDir + "../data");
possibleDirs.push_back(baseDir + "../share/data"); possibleDirs.push_back(baseDir + "../share/otclient/data");
possibleDirs.push_back(""); possibleDirs.push_back("");
foreach(dir, possibleDirs) bool found = false;
if(g_resources.addToSearchPath(dir)) foreach(dir, possibleDirs) {
if(g_resources.addToSearchPath(dir)) {
flogInfo("Using data directory: %s", dir.c_str());
found = true;
break; break;
}
}
if(!found)
logFatal("ERROR: could not find data directory");
// setup write directory // setup write directory
dir = Platform::getAppUserDir(); dir = Platform::getAppUserDir();