fixed not finding data dir if installed
This commit is contained in:
parent
e40da2341c
commit
94b42a79d7
|
@ -28,8 +28,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
|
||||||
//#define HAXMODE 0
|
//#define HAXMODE 0
|
||||||
|
|
||||||
#define APPNAME "minetest"
|
|
||||||
|
|
||||||
#define DEBUGFILE "debug.txt"
|
#define DEBUGFILE "debug.txt"
|
||||||
|
|
||||||
#define WATER_ALPHA 160
|
#define WATER_ALPHA 160
|
||||||
|
|
|
@ -189,12 +189,12 @@ void initializePaths()
|
||||||
|
|
||||||
// Use "./bin/../data"
|
// Use "./bin/../data"
|
||||||
path_data = std::string(buf) + "/../data";
|
path_data = std::string(buf) + "/../data";
|
||||||
//path_data = std::string(buf) + "/../share/" + APPNAME;
|
//path_data = std::string(buf) + "/../share/" + PROJECT_NAME;
|
||||||
|
|
||||||
// Use "C:\Documents and Settings\user\Application Data\<APPNAME>"
|
// Use "C:\Documents and Settings\user\Application Data\<PROJECT_NAME>"
|
||||||
len = GetEnvironmentVariable("APPDATA", buf, buflen);
|
len = GetEnvironmentVariable("APPDATA", buf, buflen);
|
||||||
assert(len < buflen);
|
assert(len < buflen);
|
||||||
path_userdata = std::string(buf) + "/" + APPNAME;
|
path_userdata = std::string(buf) + "/" + PROJECT_NAME;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Linux
|
Linux
|
||||||
|
@ -209,15 +209,15 @@ void initializePaths()
|
||||||
|
|
||||||
pathRemoveFile(buf, '/');
|
pathRemoveFile(buf, '/');
|
||||||
|
|
||||||
path_data = std::string(buf) + "/../share/" + APPNAME;
|
path_data = std::string(buf) + "/../share/" + PROJECT_NAME;
|
||||||
//path_data = std::string(INSTALL_PREFIX) + "/share/" + APPNAME;
|
//path_data = std::string(INSTALL_PREFIX) + "/share/" + PROJECT_NAME;
|
||||||
if (!fs::PathExists(path_data)) {
|
if (!fs::PathExists(path_data)) {
|
||||||
dstream<<"WARNING: data path " << path_data << " not found!";
|
dstream<<"WARNING: data path " << path_data << " not found!";
|
||||||
path_data = std::string(buf) + "/../data";
|
path_data = std::string(buf) + "/../data";
|
||||||
dstream<<" Trying " << path_data << std::endl;
|
dstream<<" Trying " << path_data << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
path_userdata = std::string(getenv("HOME")) + "/." + APPNAME;
|
path_userdata = std::string(getenv("HOME")) + "/." + PROJECT_NAME;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
OS X
|
OS X
|
||||||
|
@ -243,12 +243,12 @@ void initializePaths()
|
||||||
}
|
}
|
||||||
CFRelease(resources_url);
|
CFRelease(resources_url);
|
||||||
|
|
||||||
path_userdata = std::string(getenv("HOME")) + "/Library/Application Support/" + APPNAME;
|
path_userdata = std::string(getenv("HOME")) + "/Library/Application Support/" + PROJECT_NAME;
|
||||||
|
|
||||||
#elif defined(__FreeBSD__)
|
#elif defined(__FreeBSD__)
|
||||||
|
|
||||||
path_data = std::string(INSTALL_PREFIX) + "/share/" + APPNAME;
|
path_data = std::string(INSTALL_PREFIX) + "/share/" + PROJECT_NAME;
|
||||||
path_userdata = std::string(getenv("HOME")) + "/." + APPNAME;
|
path_userdata = std::string(getenv("HOME")) + "/." + PROJECT_NAME;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -63,9 +63,9 @@ extern std::string path_data;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Directory for storing user data. Examples:
|
Directory for storing user data. Examples:
|
||||||
Windows: "C:\Documents and Settings\user\Application Data\<APPNAME>"
|
Windows: "C:\Documents and Settings\user\Application Data\<PROJECT_NAME>"
|
||||||
Linux: "~/.<APPNAME>"
|
Linux: "~/.<PROJECT_NAME>"
|
||||||
Mac: "~/Library/Application Support/<APPNAME>"
|
Mac: "~/Library/Application Support/<PROJECT_NAME>"
|
||||||
*/
|
*/
|
||||||
extern std::string path_userdata;
|
extern std::string path_userdata;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue