early-access version 1667

This commit is contained in:
pineappleEA
2021-05-09 11:30:38 +02:00
parent 5e268d25d7
commit 5dbb928ff2
1069 changed files with 38272 additions and 14437 deletions

View File

@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -39,7 +39,7 @@ SDL_GetBasePath(void)
GetModuleFileNameExW_t pGetModuleFileNameExW;
DWORD buflen = 128;
WCHAR *path = NULL;
HANDLE psapi = LoadLibrary(L"psapi.dll");
HANDLE psapi = LoadLibrary(TEXT("psapi.dll"));
char *retval = NULL;
DWORD len = 0;
int i;
@@ -93,7 +93,7 @@ SDL_GetBasePath(void)
SDL_assert(i > 0); /* Should have been an absolute path. */
path[i+1] = '\0'; /* chop off filename. */
retval = WIN_StringToUTF8(path);
retval = WIN_StringToUTF8W(path);
SDL_free(path);
return retval;
@@ -130,20 +130,20 @@ SDL_GetPrefPath(const char *org, const char *app)
return NULL;
}
worg = WIN_UTF8ToString(org);
worg = WIN_UTF8ToStringW(org);
if (worg == NULL) {
SDL_OutOfMemory();
return NULL;
}
wapp = WIN_UTF8ToString(app);
wapp = WIN_UTF8ToStringW(app);
if (wapp == NULL) {
SDL_free(worg);
SDL_OutOfMemory();
return NULL;
}
new_wpath_len = lstrlenW(worg) + lstrlenW(wapp) + lstrlenW(path) + 3;
new_wpath_len = SDL_wcslen(worg) + SDL_wcslen(wapp) + SDL_wcslen(path) + 3;
if ((new_wpath_len + 1) > MAX_PATH) {
SDL_free(worg);
@@ -153,8 +153,8 @@ SDL_GetPrefPath(const char *org, const char *app)
}
if (*worg) {
lstrcatW(path, L"\\");
lstrcatW(path, worg);
SDL_wcslcat(path, L"\\", SDL_arraysize(path));
SDL_wcslcat(path, worg, SDL_arraysize(path));
}
SDL_free(worg);
@@ -167,8 +167,8 @@ SDL_GetPrefPath(const char *org, const char *app)
}
}
lstrcatW(path, L"\\");
lstrcatW(path, wapp);
SDL_wcslcat(path, L"\\", SDL_arraysize(path));
SDL_wcslcat(path, wapp, SDL_arraysize(path));
SDL_free(wapp);
api_result = CreateDirectoryW(path, NULL);
@@ -179,9 +179,9 @@ SDL_GetPrefPath(const char *org, const char *app)
}
}
lstrcatW(path, L"\\");
SDL_wcslcat(path, L"\\", SDL_arraysize(path));
retval = WIN_StringToUTF8(path);
retval = WIN_StringToUTF8W(path);
return retval;
}