mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-27 09:55:34 -05:00
Compare commits
2 commits
cc2459433f
...
f8a12ae8e6
Author | SHA1 | Date | |
---|---|---|---|
|
f8a12ae8e6 | ||
|
e222313f22 |
1 changed files with 3 additions and 3 deletions
|
@ -142,8 +142,8 @@ unsigned int gdTimestamp = 0;
|
||||||
// this function will set the current working directory to the game's directory
|
// this function will set the current working directory to the game's directory
|
||||||
// to avoid the game crashing due to not being able to find the resources
|
// to avoid the game crashing due to not being able to find the resources
|
||||||
static void fixCWD() {
|
static void fixCWD() {
|
||||||
char cwd[1024];
|
WCHAR cwd[MAX_PATH];
|
||||||
DWORD size = GetModuleFileNameA(NULL, cwd, sizeof(cwd));
|
DWORD size = GetModuleFileNameW(NULL, cwd, sizeof(cwd));
|
||||||
if (size == sizeof(cwd)) return;
|
if (size == sizeof(cwd)) return;
|
||||||
for (int i = size - 1; i >= 0; i--) {
|
for (int i = size - 1; i >= 0; i--) {
|
||||||
if (cwd[i] == '\\') {
|
if (cwd[i] == '\\') {
|
||||||
|
@ -151,7 +151,7 @@ static void fixCWD() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SetCurrentDirectoryA(cwd);
|
SetCurrentDirectoryW(cwd);
|
||||||
}
|
}
|
||||||
|
|
||||||
int WINAPI gdMainHook(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow) {
|
int WINAPI gdMainHook(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow) {
|
||||||
|
|
Loading…
Reference in a new issue