From: Holger Schemel Date: Mon, 27 Jun 2016 23:36:58 +0000 (+0200) Subject: fixed converting surfaces with alpha channel for SDL 1.2 X-Git-Tag: 4.0.0.0~60 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=bdc4b9689a59b103dac615c5b52b7641e8aaa416;p=rocksndiamonds.git fixed converting surfaces with alpha channel for SDL 1.2 --- diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index 1e479577..72bbc14a 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -340,10 +340,12 @@ SDL_Surface *SDLGetNativeSurface(SDL_Surface *surface) if (surface == NULL) return NULL; - if (video.initialized) - new_surface = SDL_DisplayFormat(surface); - else + if (!video.initialized) new_surface = SDL_ConvertSurface(surface, surface->format, SURFACE_FLAGS); + else if (SDLHasAlpha(surface)) + new_surface = SDL_DisplayFormatAlpha(surface); + else + new_surface = SDL_DisplayFormat(surface); if (new_surface == NULL) Error(ERR_EXIT, "%s() failed: %s",