From: Holger Schemel Date: Fri, 22 Apr 2016 17:48:44 +0000 (+0200) Subject: fixed using unsupported rendering mode from config file with SDL1 target X-Git-Tag: 4.0.0.0-rc2~8 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=766384cc29e6d22af67fe3329069291efc0f681a;p=rocksndiamonds.git fixed using unsupported rendering mode from config file with SDL1 target --- diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index 913205aa..d1406e8b 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -385,13 +385,8 @@ void SDLInitVideoBuffer(boolean fullscreen) { video.window_scaling_percent = setup.window_scaling_percent; video.window_scaling_quality = setup.window_scaling_quality; - video.screen_rendering_mode = - (strEqual(setup.screen_rendering_mode, STR_SPECIAL_RENDERING_BITMAP) ? - SPECIAL_RENDERING_BITMAP : - strEqual(setup.screen_rendering_mode, STR_SPECIAL_RENDERING_TARGET) ? - SPECIAL_RENDERING_TARGET: - strEqual(setup.screen_rendering_mode, STR_SPECIAL_RENDERING_DOUBLE) ? - SPECIAL_RENDERING_DOUBLE : SPECIAL_RENDERING_OFF); + + SDLSetScreenRenderingMode(setup.screen_rendering_mode); #if defined(TARGET_SDL2) // SDL 2.0: support for (desktop) fullscreen mode available @@ -640,13 +635,8 @@ boolean SDLSetVideoMode(boolean fullscreen) video.fullscreen_enabled = FALSE; video.window_scaling_percent = setup.window_scaling_percent; video.window_scaling_quality = setup.window_scaling_quality; - video.screen_rendering_mode = - (strEqual(setup.screen_rendering_mode, STR_SPECIAL_RENDERING_BITMAP) ? - SPECIAL_RENDERING_BITMAP : - strEqual(setup.screen_rendering_mode, STR_SPECIAL_RENDERING_TARGET) ? - SPECIAL_RENDERING_TARGET: - strEqual(setup.screen_rendering_mode, STR_SPECIAL_RENDERING_DOUBLE) ? - SPECIAL_RENDERING_DOUBLE : SPECIAL_RENDERING_OFF); + + SDLSetScreenRenderingMode(setup.screen_rendering_mode); } } @@ -757,17 +747,6 @@ void SDLSetWindowScalingQuality(char *window_scaling_quality) video.window_scaling_quality = window_scaling_quality; } -void SDLSetScreenRenderingMode(char *screen_rendering_mode) -{ - video.screen_rendering_mode = - (strEqual(screen_rendering_mode, STR_SPECIAL_RENDERING_BITMAP) ? - SPECIAL_RENDERING_BITMAP : - strEqual(screen_rendering_mode, STR_SPECIAL_RENDERING_TARGET) ? - SPECIAL_RENDERING_TARGET: - strEqual(screen_rendering_mode, STR_SPECIAL_RENDERING_DOUBLE) ? - SPECIAL_RENDERING_DOUBLE : SPECIAL_RENDERING_OFF); -} - void SDLSetWindowFullscreen(boolean fullscreen) { if (sdl_window == NULL) @@ -790,6 +769,21 @@ void SDLSetWindowFullscreen(boolean fullscreen) } #endif +void SDLSetScreenRenderingMode(char *screen_rendering_mode) +{ +#if defined(TARGET_SDL2) + video.screen_rendering_mode = + (strEqual(screen_rendering_mode, STR_SPECIAL_RENDERING_BITMAP) ? + SPECIAL_RENDERING_BITMAP : + strEqual(screen_rendering_mode, STR_SPECIAL_RENDERING_TARGET) ? + SPECIAL_RENDERING_TARGET: + strEqual(screen_rendering_mode, STR_SPECIAL_RENDERING_DOUBLE) ? + SPECIAL_RENDERING_DOUBLE : SPECIAL_RENDERING_OFF); +#else + video.screen_rendering_mode = SPECIAL_RENDERING_BITMAP; +#endif +} + void SDLRedrawWindow() { UpdateScreen_WithoutFrameDelay(NULL); diff --git a/src/libgame/sdl.h b/src/libgame/sdl.h index bad3037c..2402ca52 100644 --- a/src/libgame/sdl.h +++ b/src/libgame/sdl.h @@ -437,12 +437,11 @@ void SDLFreeBitmapTextures(Bitmap *); SDL_Surface *SDL_DisplayFormat(SDL_Surface *); void SDLSetWindowScaling(int); void SDLSetWindowScalingQuality(char *); -void SDLSetScreenRenderingMode(char *); void SDLSetWindowFullscreen(boolean); #endif +void SDLSetScreenRenderingMode(char *); void SDLRedrawWindow(); - void SDLSetWindowTitle(void); void SDLLimitScreenUpdates(boolean);