Unix: prioritize local resource directory over installed one.
parent
cbf84a9d2b
commit
33e292a6bc
|
@ -1536,11 +1536,13 @@ const void *LoadResource(const std::string &name, size_t *size) {
|
||||||
struct stat st;
|
struct stat st;
|
||||||
std::string path;
|
std::string path;
|
||||||
|
|
||||||
path = (UNIX_DATADIR "/") + name;
|
if(resource_dir.empty()) {
|
||||||
if(stat(path.c_str(), &st)) {
|
path = (UNIX_DATADIR "/") + name;
|
||||||
ssassert(errno == ENOENT, "Unexpected stat() error");
|
} else {
|
||||||
ssassert(!resource_dir.empty(), "Expected local resource directory to be set");
|
|
||||||
path = resource_dir + "/" + name;
|
path = resource_dir + "/" + name;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(stat(path.c_str(), &st)) {
|
||||||
ssassert(!stat(path.c_str(), &st), "Cannot find resource");
|
ssassert(!stat(path.c_str(), &st), "Cannot find resource");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue