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

@@ -22,7 +22,7 @@
/*
This is for generating thumbnails and videos of examples. Just include it
temporarily and let it override SDL_RenderPresent, etc, and it'll dump each
frame rendered to a new .bmp file.
frame rendered to a new .png file.
*/
static bool SAVERENDERING_SDL_RenderPresent(SDL_Renderer *renderer)
@@ -33,9 +33,9 @@ static bool SAVERENDERING_SDL_RenderPresent(SDL_Renderer *renderer)
SDL_LogError(SDL_LOG_CATEGORY_RENDER, "Failed to read pixels for frame #%u! (%s)", framenum, SDL_GetError());
} else {
char fname[64];
SDL_snprintf(fname, sizeof (fname), "frame%05u.bmp", framenum);
if (!SDL_SaveBMP(surface, fname)) {
SDL_LogError(SDL_LOG_CATEGORY_RENDER, "Failed to save bmp for frame #%u! (%s)", framenum, SDL_GetError());
SDL_snprintf(fname, sizeof (fname), "frame%05u.png", framenum);
if (!SDL_SavePNG(surface, fname)) {
SDL_LogError(SDL_LOG_CATEGORY_RENDER, "Failed to save png for frame #%u! (%s)", framenum, SDL_GetError());
}
SDL_DestroySurface(surface);
}