projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d9e1c98
)
fixed converting surfaces with alpha channel for SDL 1.2
author
Holger Schemel
<info@artsoft.org>
Mon, 27 Jun 2016 23:36:58 +0000
(
01:36
+0200)
committer
Holger Schemel
<info@artsoft.org>
Mon, 27 Jun 2016 23:36:58 +0000
(
01:36
+0200)
src/libgame/sdl.c
patch
|
blob
|
history
diff --git
a/src/libgame/sdl.c
b/src/libgame/sdl.c
index 1e479577eb106c0ddddc36bc4a20f790da2b273a..72bbc14abe3df5abee36b2aeac94943cdfd3ff7b 100644
(file)
--- 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",