Updates the SDL library to the latest standard bugfix release

This commit is contained in:
JeffR 2023-07-13 15:20:29 -05:00
parent cb766f2878
commit 083d2175ea
1280 changed files with 343926 additions and 179615 deletions

View file

@ -1,5 +1,5 @@
/*
Copyright 1997-2022 Sam Lantinga
Copyright 1997-2023 Sam Lantinga
Copyright 2022 Collabora Ltd.
SPDX-License-Identifier: Zlib
*/
@ -33,7 +33,7 @@ GetNearbyFilename(const char *file)
return NULL;
}
SDL_snprintf(path, len, "%s%s", base, file);
(void)SDL_snprintf(path, len, "%s%s", base, file);
SDL_free(base);
rw = SDL_RWFromFile(path, "rb");
@ -114,17 +114,17 @@ LoadTexture(SDL_Renderer *renderer, const char *file, SDL_bool transparent,
switch (temp->format->BitsPerPixel) {
case 15:
SDL_SetColorKey(temp, SDL_TRUE,
(*(Uint16 *) temp->pixels) & 0x00007FFF);
(*(Uint16 *)temp->pixels) & 0x00007FFF);
break;
case 16:
SDL_SetColorKey(temp, SDL_TRUE, *(Uint16 *) temp->pixels);
SDL_SetColorKey(temp, SDL_TRUE, *(Uint16 *)temp->pixels);
break;
case 24:
SDL_SetColorKey(temp, SDL_TRUE,
(*(Uint32 *) temp->pixels) & 0x00FFFFFF);
(*(Uint32 *)temp->pixels) & 0x00FFFFFF);
break;
case 32:
SDL_SetColorKey(temp, SDL_TRUE, *(Uint32 *) temp->pixels);
SDL_SetColorKey(temp, SDL_TRUE, *(Uint32 *)temp->pixels);
break;
}
}
@ -139,13 +139,11 @@ LoadTexture(SDL_Renderer *renderer, const char *file, SDL_bool transparent,
}
texture = SDL_CreateTextureFromSurface(renderer, temp);
if (!texture) {
if (texture == NULL) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create texture: %s\n", SDL_GetError());
}
}
if (temp) {
SDL_FreeSurface(temp);
}
SDL_FreeSurface(temp);
if (path) {
SDL_free(path);
}