update sdl to 2.32.6

This commit is contained in:
AzaezelX 2025-05-24 13:39:03 -05:00
parent e557f5962b
commit ddc1f8c1e2
1339 changed files with 53966 additions and 19207 deletions

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 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
@ -32,7 +32,7 @@ static SDL_Locale *build_locales_from_csv_string(char *csv)
SDL_Locale *loc;
SDL_Locale *retval;
if (csv == NULL || !csv[0]) {
if (!csv || !csv[0]) {
return NULL; /* nothing to report */
}
@ -48,7 +48,7 @@ static SDL_Locale *build_locales_from_csv_string(char *csv)
alloclen = slen + (num_locales * sizeof(SDL_Locale));
loc = retval = (SDL_Locale *)SDL_calloc(1, alloclen);
if (retval == NULL) {
if (!retval) {
SDL_OutOfMemory();
return NULL; /* oh well */
}

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 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

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 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

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 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

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 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

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 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

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 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

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 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
@ -33,7 +33,7 @@ void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen)
{
/* The 3DS only supports these 12 languages, only one can be active at a time */
static const char AVAILABLE_LOCALES[][6] = { "ja_JP", "en_US", "fr_FR", "de_DE",
"it_IT", "es_ES", "zn_CN", "ko_KR",
"it_IT", "es_ES", "zh_CN", "ko_KR",
"nl_NL", "pt_PT", "ru_RU", "zh_TW" };
u8 current_locale = GetLocaleIndex();
if (current_locale != BAD_LOCALE) {
@ -45,14 +45,13 @@ SDL_FORCE_INLINE u8
GetLocaleIndex(void)
{
u8 current_locale;
Result result;
if (R_FAILED(cfguInit())) {
return BAD_LOCALE;
}
if (R_FAILED(CFGU_GetSystemLanguage(&current_locale))) {
return BAD_LOCALE;
}
result = CFGU_GetSystemLanguage(&current_locale);
cfguExit();
return current_locale;
return R_SUCCEEDED(result) ? current_locale : BAD_LOCALE;
}
/* vi: set sts=4 ts=4 sw=4 expandtab: */

View file

@ -0,0 +1,77 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2025 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
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "../../SDL_internal.h"
#include "../SDL_syslocale.h"
#include <psputility.h>
void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen)
{
int current_locale_int = PSP_SYSTEMPARAM_LANGUAGE_ENGLISH;
SDL_assert(buflen > 0);
sceUtilityGetSystemParamInt(PSP_SYSTEMPARAM_ID_INT_LANGUAGE, &current_locale_int);
switch(current_locale_int) {
case PSP_SYSTEMPARAM_LANGUAGE_JAPANESE:
SDL_strlcpy(buf, "ja_JP", buflen);
break;
case PSP_SYSTEMPARAM_LANGUAGE_ENGLISH:
SDL_strlcpy(buf, "en_US", buflen);
break;
case PSP_SYSTEMPARAM_LANGUAGE_FRENCH:
SDL_strlcpy(buf, "fr_FR", buflen);
break;
case PSP_SYSTEMPARAM_LANGUAGE_SPANISH:
SDL_strlcpy(buf, "es_ES", buflen);
break;
case PSP_SYSTEMPARAM_LANGUAGE_GERMAN:
SDL_strlcpy(buf, "de_DE", buflen);
break;
case PSP_SYSTEMPARAM_LANGUAGE_ITALIAN:
SDL_strlcpy(buf, "it_IT", buflen);
break;
case PSP_SYSTEMPARAM_LANGUAGE_DUTCH:
SDL_strlcpy(buf, "nl_NL", buflen);
break;
case PSP_SYSTEMPARAM_LANGUAGE_PORTUGUESE:
SDL_strlcpy(buf, "pt_PT", buflen);
break;
case PSP_SYSTEMPARAM_LANGUAGE_RUSSIAN:
SDL_strlcpy(buf, "ru_RU", buflen);
break;
case PSP_SYSTEMPARAM_LANGUAGE_KOREAN:
SDL_strlcpy(buf, "ko_KR", buflen);
break;
case PSP_SYSTEMPARAM_LANGUAGE_CHINESE_TRADITIONAL:
SDL_strlcpy(buf, "zh_TW", buflen);
break;
case PSP_SYSTEMPARAM_LANGUAGE_CHINESE_SIMPLIFIED:
SDL_strlcpy(buf, "zh_CN", buflen);
break;
default:
SDL_strlcpy(buf, "en_US", buflen);
break;
}
}
/* vi: set ts=4 sw=4 expandtab: */

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 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
@ -27,12 +27,12 @@ static void normalize_locale_str(char *dst, char *str, size_t buflen)
char *ptr;
ptr = SDL_strchr(str, '.'); /* chop off encoding if specified. */
if (ptr != NULL) {
if (ptr) {
*ptr = '\0';
}
ptr = SDL_strchr(str, '@'); /* chop off extra bits if specified. */
if (ptr != NULL) {
if (ptr) {
*ptr = '\0';
}
@ -71,7 +71,7 @@ void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen)
SDL_assert(buflen > 0);
tmp = SDL_small_alloc(char, buflen, &isstack);
if (tmp == NULL) {
if (!tmp) {
SDL_OutOfMemory();
return;
}

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 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

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 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
@ -65,7 +65,7 @@ static void SDL_SYS_GetPreferredLocales_vista(char *buf, size_t buflen)
pGetUserPreferredUILanguages(MUI_LANGUAGE_NAME, &numlangs, NULL, &wbuflen);
wbuf = SDL_small_alloc(WCHAR, wbuflen, &isstack);
if (wbuf == NULL) {
if (!wbuf) {
SDL_OutOfMemory();
return;
}
@ -102,7 +102,7 @@ void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen)
}
}
if (pGetUserPreferredUILanguages == NULL) {
if (!pGetUserPreferredUILanguages) {
SDL_SYS_GetPreferredLocales_winxp(buf, buflen); /* this is always available */
} else {
SDL_SYS_GetPreferredLocales_vista(buf, buflen); /* available on Vista and later. */

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 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
@ -33,7 +33,7 @@ void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen)
int ret = 0;
/* !!! FIXME: do we not have GetUserPreferredUILanguages on WinPhone or UWP? */
#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
#if SDL_WINAPI_FAMILY_PHONE
ret = GetLocaleInfoEx(LOCALE_NAME_SYSTEM_DEFAULT, LOCALE_SNAME, wbuffer, SDL_arraysize(wbuffer));
#else
ret = GetSystemDefaultLocaleName(wbuffer, SDL_arraysize(wbuffer));