mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-04 23:22:48 +02:00
Add SDL_LoadSurface and SDL_LoadSurface_IO (#14374)
This commit is contained in:
@@ -111,7 +111,7 @@ static const char *cross[] = {
|
||||
|
||||
static SDL_Surface *load_image_file(const char *file)
|
||||
{
|
||||
SDL_Surface *surface = SDL_strstr(file, ".png") ? SDL_LoadPNG(file) : SDL_LoadBMP(file);
|
||||
SDL_Surface *surface = SDL_LoadSurface(file);
|
||||
if (surface) {
|
||||
if (SDL_GetSurfacePalette(surface)) {
|
||||
const Uint8 bpp = SDL_BITSPERPIXEL(surface->format);
|
||||
|
||||
@@ -54,7 +54,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
if (image_file) {
|
||||
shape = SDL_strstr(image_file, ".png") ? SDL_LoadPNG(image_file) : SDL_LoadBMP(image_file);
|
||||
shape = SDL_LoadSurface(image_file);
|
||||
if (!shape) {
|
||||
SDL_Log("Couldn't load %s: %s", image_file, SDL_GetError());
|
||||
goto quit;
|
||||
|
||||
@@ -84,7 +84,7 @@ SDL_Texture *LoadTexture(SDL_Renderer *renderer, const char *file, bool transpar
|
||||
file = path;
|
||||
}
|
||||
|
||||
temp = SDL_strstr(file, ".png") ? SDL_LoadPNG(file) : SDL_LoadBMP(file);
|
||||
temp = SDL_LoadSurface(file);
|
||||
if (!temp) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s", file, SDL_GetError());
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user