From: Holger Schemel Date: Wed, 6 Mar 2024 08:55:00 +0000 (+0100) Subject: moved function X-Git-Tag: 4.4.0.0-test-1~249 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=5273bfcd522df721bb4e63c24343514e1eebc36b;p=rocksndiamonds.git moved function --- 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();