Use PNG files for tests and examples

These are much smaller than the previous BMP files

Fixes https://github.com/libsdl-org/SDL/issues/14159
This commit is contained in:
Sam Lantinga
2025-10-06 11:45:48 -07:00
parent 7454302cd0
commit bb0d6221c1
143 changed files with 10608 additions and 147151 deletions

View File

@@ -48,26 +48,26 @@ int main(int argc, char *argv[])
} else if (!image_file) {
image_file = argv[i];
} else {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Usage: %s [--resizable] [shape.bmp]", argv[0]);
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Usage: %s [--resizable] [shape.png]", argv[0]);
goto quit;
}
}
if (image_file) {
shape = SDL_LoadBMP(image_file);
shape = SDL_strstr(image_file, ".png") ? SDL_LoadPNG(image_file) : SDL_LoadBMP(image_file);
if (!shape) {
SDL_Log("Couldn't load %s: %s", image_file, SDL_GetError());
goto quit;
}
} else {
SDL_IOStream *stream = SDL_IOFromConstMem(glass_bmp, sizeof(glass_bmp));
SDL_IOStream *stream = SDL_IOFromConstMem(glass_png, sizeof(glass_png));
if (!stream) {
SDL_Log("Couldn't create iostream for glass.bmp: %s", SDL_GetError());
SDL_Log("Couldn't create iostream for glass.png: %s", SDL_GetError());
goto quit;
}
shape = SDL_LoadBMP_IO(stream, true);
shape = SDL_LoadPNG_IO(stream, true);
if (!shape) {
SDL_Log("Couldn't load glass.bmp: %s", SDL_GetError());
SDL_Log("Couldn't load glass.png: %s", SDL_GetError());
goto quit;
}
}