mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-23 07:57:51 -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
|
||||
// to avoid the game crashing due to not being able to find the resources
|
||||
static void fixCWD() {
|
||||
char cwd[1024];
|
||||
DWORD size = GetModuleFileNameA(NULL, cwd, sizeof(cwd));
|
||||
WCHAR cwd[MAX_PATH];
|
||||
DWORD size = GetModuleFileNameW(NULL, cwd, sizeof(cwd));
|
||||
if (size == sizeof(cwd)) return;
|
||||
for (int i = size - 1; i >= 0; i--) {
|
||||
if (cwd[i] == '\\') {
|
||||
|
@ -151,7 +151,7 @@ static void fixCWD() {
|
|||
break;
|
||||
}
|
||||
}
|
||||
SetCurrentDirectoryA(cwd);
|
||||
SetCurrentDirectoryW(cwd);
|
||||
}
|
||||
|
||||
int WINAPI gdMainHook(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow) {
|
||||
|
|
Loading…
Reference in a new issue