mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-03-20 15:51:07 +01:00
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:
@@ -124,7 +124,7 @@ static SDL_Texture *CreateSpriteTexture(SDL_Renderer *renderer, unsigned char *d
|
||||
SDL_Surface *surface;
|
||||
SDL_IOStream *src = SDL_IOFromConstMem(data, len);
|
||||
if (src) {
|
||||
surface = SDL_LoadBMP_IO(src, true);
|
||||
surface = SDL_LoadPNG_IO(src, true);
|
||||
if (surface) {
|
||||
/* Treat white as transparent */
|
||||
SDL_SetSurfaceColorKey(surface, true, SDL_MapSurfaceRGB(surface, 255, 255, 255));
|
||||
@@ -171,7 +171,7 @@ static bool InitSpriteOverlay(SpriteRenderState *rs, SDL_Window *window)
|
||||
return false;
|
||||
}
|
||||
|
||||
rs->sprite = CreateSpriteTexture(rs->renderer, icon_bmp, icon_bmp_len);
|
||||
rs->sprite = CreateSpriteTexture(rs->renderer, icon_png, icon_png_len);
|
||||
if (!rs->sprite) {
|
||||
SDL_Log("Couldn't create sprite: %s\n", SDL_GetError());
|
||||
QuitSpriteOverlay(rs);
|
||||
|
||||
Reference in New Issue
Block a user