From 5273bfcd522df721bb4e63c24343514e1eebc36b Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Wed, 6 Mar 2024 09:55:00 +0100 Subject: [PATCH] moved function --- src/libgame/sdl.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index 89d2af1e..045b7057 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -415,6 +415,25 @@ const char *SDLGetRendererName(void) return renderer_info.name; } +static SDL_Surface *SDLGetOpaqueSurface(SDL_Surface *surface) +{ + SDL_Surface *new_surface; + + if (surface == NULL) + return NULL; + + if ((new_surface = SDLGetNativeSurface(surface)) == NULL) + Fail("SDLGetNativeSurface() failed"); + + // remove alpha channel from native non-transparent surface, if defined + SDLSetAlpha(new_surface, FALSE, 0); + + // remove transparent color from native non-transparent surface, if defined + SDL_SetColorKey(new_surface, UNSET_TRANSPARENT_PIXEL, 0); + + return new_surface; +} + SDL_Surface *SDLGetNativeSurface(SDL_Surface *surface) { SDL_PixelFormat format; @@ -2320,25 +2339,6 @@ SDL_Surface *SDLZoomSurface(SDL_Surface *src, int dst_width, int dst_height) return zoom_dst; } -static SDL_Surface *SDLGetOpaqueSurface(SDL_Surface *surface) -{ - SDL_Surface *new_surface; - - if (surface == NULL) - return NULL; - - if ((new_surface = SDLGetNativeSurface(surface)) == NULL) - Fail("SDLGetNativeSurface() failed"); - - // remove alpha channel from native non-transparent surface, if defined - SDLSetAlpha(new_surface, FALSE, 0); - - // remove transparent color from native non-transparent surface, if defined - SDL_SetColorKey(new_surface, UNSET_TRANSPARENT_PIXEL, 0); - - return new_surface; -} - Bitmap *SDLZoomBitmap(Bitmap *src_bitmap, int dst_width, int dst_height) { Bitmap *dst_bitmap = CreateBitmapStruct(); -- 2.34.1