projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
split function to toggle fullscreen and change window scaling
[rocksndiamonds.git]
/
src
/
screens.c
diff --git
a/src/screens.c
b/src/screens.c
index 9c5a86fd482db0b9defdac9d88de2982695fa427..1808e9bcd4a6dbfe71083b9117e52ec82762ab3f 100644
(file)
--- a/
src/screens.c
+++ b/
src/screens.c
@@
-1580,10
+1580,6
@@
void DrawMainMenu(void)
return;
}
return;
}
- // needed if last screen was the setup screen and fullscreen state changed
- // (moved to "execSetupGraphics()" to change fullscreen state directly)
- // ToggleFullscreenOrChangeWindowScalingIfNeeded();
-
// leveldir_current may be invalid (level group, parent link)
if (!validLevelSeries(leveldir_current))
leveldir_current = getFirstValidTreeInfoEntry(leveldir_last_valid);
// leveldir_current may be invalid (level group, parent link)
if (!validLevelSeries(leveldir_current))
leveldir_current = getFirstValidTreeInfoEntry(leveldir_last_valid);
@@
-5302,13
+5298,21
@@
static void execSetupGraphics(void)
if (setup_mode == SETUP_MODE_CHOOSE_WINDOW_SIZE)
execSetupGraphics_setWindowSizes(FALSE);
if (setup_mode == SETUP_MODE_CHOOSE_WINDOW_SIZE)
execSetupGraphics_setWindowSizes(FALSE);
+ // update "setup.vsync_mode" from list selection
+ // (in this case, vsync mode was changed on setup screen)
+ if (setup_mode == SETUP_MODE_CHOOSE_VSYNC)
+ execSetupGraphics_setVsyncModes(FALSE);
+
// update list selection from "setup.window_scaling_percent"
// (window scaling may have changed by resizing the window)
execSetupGraphics_setWindowSizes(TRUE);
// update list selection from "setup.window_scaling_percent"
// (window scaling may have changed by resizing the window)
execSetupGraphics_setWindowSizes(TRUE);
+ // update list selection from "setup.vsync_mode"
+ // (vsync_mode may have changed by re-creating the renderer)
+ execSetupGraphics_setVsyncModes(TRUE);
+
execSetupGraphics_setScalingTypes();
execSetupGraphics_setRenderingModes();
execSetupGraphics_setScalingTypes();
execSetupGraphics_setRenderingModes();
- execSetupGraphics_setVsyncModes(FALSE);
setup_mode = SETUP_MODE_GRAPHICS;
setup_mode = SETUP_MODE_GRAPHICS;
@@
-5319,7
+5323,7
@@
static void execSetupGraphics(void)
ModifyGameSpeedIfNeeded();
// window scaling may have changed at this point
ModifyGameSpeedIfNeeded();
// window scaling may have changed at this point
-
ToggleFullscreenOr
ChangeWindowScalingIfNeeded();
+ ChangeWindowScalingIfNeeded();
// window scaling quality may have changed at this point
if (!strEqual(setup.window_scaling_quality, video.window_scaling_quality))
// window scaling quality may have changed at this point
if (!strEqual(setup.window_scaling_quality, video.window_scaling_quality))
@@
-5329,7
+5333,7
@@
static void execSetupGraphics(void)
SDLSetScreenRenderingMode(setup.screen_rendering_mode);
// screen vsync mode may have changed at this point
SDLSetScreenRenderingMode(setup.screen_rendering_mode);
// screen vsync mode may have changed at this point
-
SDLSetScreenVsyncMode(setup.vsync_mode
);
+
ChangeVsyncModeIfNeeded(
);
}
static void execSetupChooseWindowSize(void)
}
static void execSetupChooseWindowSize(void)
@@
-6853,7
+6857,7
@@
static void changeSetupValue(int screen_pos, int setup_info_pos_raw, int dx)
// fullscreen state may have changed at this point
if (si->value == &setup.fullscreen)
// fullscreen state may have changed at this point
if (si->value == &setup.fullscreen)
- ToggleFullscreen
OrChangeWindowScaling
IfNeeded();
+ ToggleFullscreenIfNeeded();
// network mode may have changed at this point
if (si->value == &setup.network_mode)
// network mode may have changed at this point
if (si->value == &setup.network_mode)