mirror of https://github.com/sm64pc/sm64pc.git
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:
parent
2c8382e60e
commit
5145f2a897
|
@ -97,6 +97,7 @@ static void gfx_sdl_set_fullscreen(bool fullscreen) {
|
||||||
|
|
||||||
static void gfx_sdl_init(void) {
|
static void gfx_sdl_init(void) {
|
||||||
Uint32 window_flags = 0;
|
Uint32 window_flags = 0;
|
||||||
|
u8 Fullscreen;
|
||||||
|
|
||||||
SDL_Init(SDL_INIT_VIDEO);
|
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;
|
window_flags = SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE;
|
||||||
|
|
||||||
|
Fullscreen = configFullscreen;
|
||||||
if (gCLIOpts.FullScreen == 1)
|
if (gCLIOpts.FullScreen == 1)
|
||||||
configFullscreen = true;
|
Fullscreen = true;
|
||||||
else if (gCLIOpts.FullScreen == 2)
|
else if (gCLIOpts.FullScreen == 2)
|
||||||
configFullscreen = false;
|
Fullscreen = false;
|
||||||
|
|
||||||
if (configFullscreen) {
|
if (Fullscreen) {
|
||||||
window_flags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
|
window_flags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue