mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-28 23:13:02 +00:00
Add a --fullscreen
CLI option
This commit is contained in:
parent
f39d9ad096
commit
fd74e20373
3 changed files with 12 additions and 2 deletions
|
@ -7,6 +7,7 @@ void parse_cli_opts(int argc, char* argv[])
|
|||
{
|
||||
// Initialize options with false values.
|
||||
gCLIOpts.SkipIntro = 0;
|
||||
gCLIOpts.FullScreen = 0;
|
||||
|
||||
// Scan arguments for options
|
||||
if (argc > 1)
|
||||
|
@ -16,6 +17,9 @@ void parse_cli_opts(int argc, char* argv[])
|
|||
{
|
||||
if (strcmp(argv[i], "--skip-intro") == 0) // Skip Peach Intro
|
||||
gCLIOpts.SkipIntro = 1;
|
||||
|
||||
if (strcmp(argv[i], "--fullscreen") == 0) // Open game in fullscreen
|
||||
gCLIOpts.FullScreen = 1;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@
|
|||
struct PCCLIOptions
|
||||
{
|
||||
u8 SkipIntro;
|
||||
u8 FullScreen;
|
||||
};
|
||||
|
||||
extern struct PCCLIOptions gCLIOpts;
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "gfx_window_manager_api.h"
|
||||
#include "gfx_screen_config.h"
|
||||
#include "../configfile.h"
|
||||
#include "../cliopts.h"
|
||||
|
||||
#include "src/pc/controller/controller_keyboard.h"
|
||||
|
||||
|
@ -113,6 +114,10 @@ static void gfx_sdl_init(void) {
|
|||
|
||||
window_flags = SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE;
|
||||
|
||||
if (gCLIOpts.FullScreen) {
|
||||
configFullscreen = true;
|
||||
}
|
||||
|
||||
if (configFullscreen) {
|
||||
window_flags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue