Fix --fullscreen/--windowed CLI option altering config file.

Previously, when the --fullscreen or --windowed CLI options were set, configFullscreen was overwritten.
This caused the config file to be changed according to the CLI options given when running the executable.
A helper variable that copies configFullscreen stops the game from overwritting the config file.
This commit is contained in:
IvanDSM 2020-05-16 21:53:00 -03:00
parent d936b980df
commit 1031f9f7ea
1 changed files with 5 additions and 3 deletions

View File

@ -97,6 +97,7 @@ static void gfx_sdl_set_fullscreen(bool fullscreen) {
static void gfx_sdl_init(void) {
Uint32 window_flags = 0;
u8 Fullscreen;
SDL_Init(SDL_INIT_VIDEO);
@ -114,12 +115,13 @@ static void gfx_sdl_init(void) {
window_flags = SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE;
Fullscreen = configFullscreen;
if (gCLIOpts.FullScreen == 1)
configFullscreen = true;
Fullscreen = true;
else if (gCLIOpts.FullScreen == 2)
configFullscreen = false;
Fullscreen = false;
if (configFullscreen) {
if (Fullscreen) {
window_flags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
}