mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 00:24:40 +00:00
update sdl to 2.32.6
This commit is contained in:
parent
e557f5962b
commit
ddc1f8c1e2
1339 changed files with 53966 additions and 19207 deletions
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright 2022 Collabora Ltd.
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
|
|
@ -28,13 +28,13 @@ GetNearbyFilename(const char *file)
|
|||
|
||||
base = SDL_GetBasePath();
|
||||
|
||||
if (base != NULL) {
|
||||
if (base) {
|
||||
SDL_RWops *rw;
|
||||
size_t len = SDL_strlen(base) + SDL_strlen(file) + 1;
|
||||
|
||||
path = SDL_malloc(len);
|
||||
|
||||
if (path == NULL) {
|
||||
if (!path) {
|
||||
SDL_free(base);
|
||||
SDL_OutOfMemory();
|
||||
return NULL;
|
||||
|
|
@ -54,7 +54,7 @@ GetNearbyFilename(const char *file)
|
|||
}
|
||||
|
||||
path = SDL_strdup(file);
|
||||
if (path == NULL) {
|
||||
if (!path) {
|
||||
SDL_OutOfMemory();
|
||||
}
|
||||
return path;
|
||||
|
|
@ -72,10 +72,10 @@ GetNearbyFilename(const char *file)
|
|||
char *
|
||||
GetResourceFilename(const char *user_specified, const char *def)
|
||||
{
|
||||
if (user_specified != NULL) {
|
||||
if (user_specified) {
|
||||
char *ret = SDL_strdup(user_specified);
|
||||
|
||||
if (ret == NULL) {
|
||||
if (!ret) {
|
||||
SDL_OutOfMemory();
|
||||
}
|
||||
|
||||
|
|
@ -105,12 +105,12 @@ LoadTexture(SDL_Renderer *renderer, const char *file, SDL_bool transparent,
|
|||
|
||||
path = GetNearbyFilename(file);
|
||||
|
||||
if (path != NULL) {
|
||||
if (path) {
|
||||
file = path;
|
||||
}
|
||||
|
||||
temp = SDL_LoadBMP(file);
|
||||
if (temp == NULL) {
|
||||
if (!temp) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s", file, SDL_GetError());
|
||||
} else {
|
||||
/* Set transparent pixel as the pixel at (0,0) */
|
||||
|
|
@ -137,16 +137,16 @@ LoadTexture(SDL_Renderer *renderer, const char *file, SDL_bool transparent,
|
|||
}
|
||||
}
|
||||
|
||||
if (width_out != NULL) {
|
||||
if (width_out) {
|
||||
*width_out = temp->w;
|
||||
}
|
||||
|
||||
if (height_out != NULL) {
|
||||
if (height_out) {
|
||||
*height_out = temp->h;
|
||||
}
|
||||
|
||||
texture = SDL_CreateTextureFromSurface(renderer, temp);
|
||||
if (texture == NULL) {
|
||||
if (!texture) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create texture: %s\n", SDL_GetError());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue