Add a `--fullscreen` CLI option
This commit is contained in:
parent
4095ee3fb9
commit
8cacc39769
|
@ -6,7 +6,8 @@ struct PCCLIOptions gCLIOpts;
|
|||
void parse_cli_opts(int argc, char* argv[])
|
||||
{
|
||||
// Initialize options with false values.
|
||||
gCLIOpts.SkipIntro = 0;
|
||||
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,8 +3,9 @@
|
|||
struct PCCLIOptions
|
||||
{
|
||||
u8 SkipIntro;
|
||||
u8 FullScreen;
|
||||
};
|
||||
|
||||
extern struct PCCLIOptions gCLIOpts;
|
||||
|
||||
void parse_cli_opts(int argc, char* argv[]);
|
||||
void parse_cli_opts(int argc, char* argv[]);
|
||||
|
|
|
@ -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 New Issue