X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsdl.c;h=19526fe0b5a3c1ff1847f019a7e2e0ed302db8cf;hb=1465ca1ffdf2104d25b9a46ca9bf8a3f175403fd;hp=2d6d16b5072df53ae1e1d64ac8e415b2e25c1a09;hpb=621b6a2c4781c9c3e2f5849f9c184a906e0ce5b6;p=rocksndiamonds.git diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index 2d6d16b5..19526fe0 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -65,10 +65,11 @@ inline boolean SDLSetVideoMode(DrawBuffer *backbuffer, boolean fullscreen) { /* switch display to fullscreen mode, if available */ DrawWindow window_old = *backbuffer; - DrawWindow window_new; + DrawWindow window_new = CreateBitmapStruct(); - if ((window_new = SDL_SetVideoMode(video.width, video.height, video.depth, - surface_flags)) == NULL) + if ((window_new->surface = SDL_SetVideoMode(video.width, video.height, + video.depth, surface_flags)) + == NULL) { /* switching display to fullscreen mode failed */ Error(ERR_WARN, "SDL_SetVideoMode() failed: %s", SDL_GetError()); @@ -80,7 +81,7 @@ inline boolean SDLSetVideoMode(DrawBuffer *backbuffer, boolean fullscreen) else { if (window_old) - SDL_FreeSurface(window_old); + FreeBitmap(window_old); *backbuffer = window_new; video.fullscreen_enabled = TRUE; @@ -92,10 +93,11 @@ inline boolean SDLSetVideoMode(DrawBuffer *backbuffer, boolean fullscreen) { /* switch display to window mode */ DrawWindow window_old = *backbuffer; - DrawWindow window_new; + DrawWindow window_new = CreateBitmapStruct(); - if ((window_new = SDL_SetVideoMode(video.width, video.height, video.depth, - surface_flags)) == NULL) + if ((window_new->surface = SDL_SetVideoMode(video.width, video.height, + video.depth, surface_flags)) + == NULL) { /* switching display to window mode failed -- should not happen */ Error(ERR_WARN, "SDL_SetVideoMode() failed: %s", SDL_GetError()); @@ -105,7 +107,7 @@ inline boolean SDLSetVideoMode(DrawBuffer *backbuffer, boolean fullscreen) else { if (window_old) - SDL_FreeSurface(window_old); + FreeBitmap(window_old); *backbuffer = window_new; video.fullscreen_enabled = FALSE;