X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Ftools.c;h=4affe1366d5aa2f75718bcf80a83423b3585b7df;hp=8ac74ac7178eb4d7f10247e9c6302ac594df460e;hb=610fd714733687a10ec06da4ea70d05739b716b5;hpb=2d298d8e6d16600c4ea7cdbdc08508098f0218ef diff --git a/src/tools.c b/src/tools.c index 8ac74ac7..4affe136 100644 --- a/src/tools.c +++ b/src/tools.c @@ -9245,32 +9245,21 @@ void PlaySoundSelecting(void) void ToggleFullscreenOrChangeWindowScalingIfNeeded(void) { - boolean change_fullscreen = (setup.fullscreen != - video.fullscreen_enabled); - boolean change_window_scaling_percent = (!video.fullscreen_enabled && - setup.window_scaling_percent != - video.window_scaling_percent); - - if (change_window_scaling_percent && video.fullscreen_enabled) - return; - - if (!change_window_scaling_percent && !video.fullscreen_available) - return; - - if (change_window_scaling_percent) - { - SDLSetWindowScaling(setup.window_scaling_percent); - - return; - } - else if (change_fullscreen) + if (setup.fullscreen != video.fullscreen_enabled && + video.fullscreen_available) { SDLSetWindowFullscreen(setup.fullscreen); // set setup value according to successfully changed fullscreen mode setup.fullscreen = video.fullscreen_enabled; + } + else if (setup.window_scaling_percent != video.window_scaling_percent && + !video.fullscreen_enabled) + { + SDLSetWindowScaling(setup.window_scaling_percent); - return; + // set setup value according to successfully changed window scaling + setup.window_scaling_percent = video.window_scaling_percent; } }