Feature #865 ยป 0036-sdl3-Update-create_surf_with_format.patch
client/gui-sdl3/graphics.c | ||
---|---|---|
/**********************************************************************//**
|
||
Create an surface with format
|
||
**************************************************************************/
|
||
SDL_Surface *create_surf_with_format(SDL_PixelFormat *pf,
|
||
SDL_Surface *create_surf_with_format(SDL_PixelFormat pf,
|
||
int width, int height)
|
||
{
|
||
SDL_Surface *surf = SDL_CreateSurface(width, height, pf->format);
|
||
SDL_Surface *surf = SDL_CreateSurface(width, height, pf);
|
||
if (surf == NULL) {
|
||
log_error(_("Unable to create Sprite (Surface) of size "
|
||
"%d x %d %d Bits"),
|
||
width, height, pf->bits_per_pixel);
|
||
width, height, SDL_GetPixelFormatDetails(pf)->bits_per_pixel);
|
||
return NULL;
|
||
}
|
||
client/gui-sdl3/graphics.h | ||
---|---|---|
SDL_Surface *load_surf(const char *fname);
|
||
SDL_Surface *create_surf_with_format(SDL_PixelFormat *pf,
|
||
SDL_Surface *create_surf_with_format(SDL_PixelFormat pf,
|
||
int width, int height);
|
||
SDL_Surface *create_surf(int width, int height);
|
||
SDL_Surface *convert_surf(SDL_Surface *surf_in);
|