mirror of https://github.com/bsnes-emu/bsnes.git
nall: Use the value of datadir to find the assets dir.
This commit is contained in:
parent
8a6b89d032
commit
adafcb4430
|
@ -12,6 +12,9 @@ auto locate(string name) -> string {
|
||||||
location = {Path::userData(), "bsnes/", name};
|
location = {Path::userData(), "bsnes/", name};
|
||||||
if(inode::exists(location)) return location;
|
if(inode::exists(location)) return location;
|
||||||
|
|
||||||
|
location = {Path::sharedData(), "bsnes/", name};
|
||||||
|
if(inode::exists(location)) return location;
|
||||||
|
|
||||||
directory::create({Path::userSettings(), "bsnes/"});
|
directory::create({Path::userSettings(), "bsnes/"});
|
||||||
return {Path::userSettings(), "bsnes/", name};
|
return {Path::userSettings(), "bsnes/", name};
|
||||||
}
|
}
|
||||||
|
|
|
@ -243,4 +243,5 @@ else
|
||||||
bindir ?= $(prefix)/bin
|
bindir ?= $(prefix)/bin
|
||||||
datarootdir ?= $(prefix)/share
|
datarootdir ?= $(prefix)/share
|
||||||
datadir ?= $(datarootdir)
|
datadir ?= $(datarootdir)
|
||||||
|
flags += -DDATADIR=\"$(datadir)\"
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -137,6 +137,8 @@ inline auto sharedData() -> string {
|
||||||
result.transform("\\", "/");
|
result.transform("\\", "/");
|
||||||
#elif defined(PLATFORM_MACOS)
|
#elif defined(PLATFORM_MACOS)
|
||||||
string result = "/Library/Application Support/";
|
string result = "/Library/Application Support/";
|
||||||
|
#elif defined(DATADIR)
|
||||||
|
string result = DATADIR;
|
||||||
#else
|
#else
|
||||||
string result = "/usr/share/";
|
string result = "/usr/share/";
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue