fix finding runtime files relative to the executable path
This commit is contained in:
parent
4017d8237e
commit
95381faedc
@ -6,9 +6,9 @@ static const std::initializer_list<const char *> Shader_Extensions = {"", ".glsl
|
||||
|
||||
static std::string System_Runtime_Dir;
|
||||
|
||||
void Runtime::init(const char * argv_0, const char * appname)
|
||||
void Runtime::init(const char * executable_path, const char * appname)
|
||||
{
|
||||
System_Runtime_Dir = Path::join(Path::dirname(Path::dirname(argv_0)), "share", appname);
|
||||
System_Runtime_Dir = Path::join(Path::dirname(Path::dirname(executable_path)), "share", appname);
|
||||
}
|
||||
|
||||
std::string Runtime::find(Type t, const std::string & name)
|
||||
|
@ -14,7 +14,7 @@ public:
|
||||
};
|
||||
|
||||
static std::string find(Type t, const std::string & name);
|
||||
static void init(const char * argv_0, const char * appname);
|
||||
static void init(const char * executable_path, const char * appname);
|
||||
|
||||
protected:
|
||||
static std::string find_first_under(const std::string & runtime_subpath,
|
||||
|
@ -11,7 +11,7 @@ int main(int argc, char * argv[])
|
||||
return 1;
|
||||
}
|
||||
|
||||
Runtime::init(argv[0], APPNAME);
|
||||
Runtime::init(System::executable_path().c_str(), APPNAME);
|
||||
|
||||
const char * filename = nullptr;
|
||||
if (argc > 1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user