You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

36 lines
743 B

#include "Environment.h"
#include <vector>
#include "Path.h"
#include "../Log.h"
std::string Environment::resourceDir = "";
void Environment::init() {
if (!resourceDir.empty())
return; // already initialized O_o
std::vector<std::string> paths = {
"res"
};
#ifndef _WIN32
// linux or osx
paths.push_back("/usr/share/netrunner/resources");
paths.push_back("/usr/local/share/netrunner/resources");
#else
paths.push_back(""); //TODO: place it somewhere for windows
#endif
for (std::string &path : paths) {
if (Path::directoryExists(path)) {
resourceDir = path;
logInfo() << "Found resource dir at " << path << "!" << std::endl;
break;
}
}
}
std::string Environment::getResourceDir() {
return resourceDir;
}