rework on resources system

master
Eduardo Bart 13 years ago
parent ab6c52a3ee
commit afc79a99e1

@ -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();

Loading…
Cancel
Save