projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6729979
)
improved error tolerance of SDL native surface conversion
author
Holger Schemel
<info@artsoft.org>
Mon, 2 Mar 2015 10:18:56 +0000
(11:18 +0100)
committer
Holger Schemel
<info@artsoft.org>
Mon, 2 Mar 2015 10:18:56 +0000
(11:18 +0100)
src/libgame/sdl.c
patch
|
blob
|
history
diff --git
a/src/libgame/sdl.c
b/src/libgame/sdl.c
index 2217842e8c8b132e7e17193360b7dcd236de158a..e7e985052cb7e9f7b8ebd88f4863620e1b939514 100644
(file)
--- a/
src/libgame/sdl.c
+++ b/
src/libgame/sdl.c
@@
-207,11
+207,13
@@
boolean SDLSetNativeSurface(SDL_Surface **surface)
SDL_Surface *SDLGetNativeSurface(SDL_Surface *surface)
{
- if (surface == NULL ||
- backbuffer == NULL ||
- backbuffer->surface == NULL)
+ if (surface == NULL)
return NULL;
+ if (backbuffer == NULL ||
+ backbuffer->surface == NULL)
+ return SDL_ConvertSurface(surface, surface->format, 0);
+
return SDL_ConvertSurface(surface, backbuffer->surface->format, 0);
}