Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions gui/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,20 @@ int SDL_main(int argc, const char **argv)
{
// Default to full screen unless "-w" is specified
int override_fs = -1;
int override_fs_cursor = -1;
for (int i = 1, consumed; i < argc; i += consumed) {
consumed = -1;
if (!strcmp(argv[i], "-w") || !strcmp(argv[i], "--window")) {
override_fs = 0;
consumed = 1;
} else if (!strcmp(argv[i], "-f") || !strcmp(argv[i], "--fullscreen")) {
override_fs = 1;
consumed = 1;
} else if (!strcmp(argv[i], "--show-cursor")) {
override_fs_cursor = 1;
consumed = 1;
} else if (!strcmp(argv[i], "--no-cursor")) {
override_fs_cursor = 0;
consumed = 1;
} else if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) {
display_cli_help(argv);
Expand Down Expand Up @@ -57,6 +64,10 @@ int SDL_main(int argc, const char **argv)
vpi_config.fullscreen = override_fs;
}

if(override_fs_cursor != -1) {
vpi_config.cursor_in_fullscreen = override_fs_cursor;
}

// Initialize UI system
vui_context_t *vui = vui_alloc(SCREEN_WIDTH, SCREEN_HEIGHT);

Expand Down Expand Up @@ -92,5 +103,7 @@ void display_cli_help(const char **argv) {
vpilog("Options:\n");
vpilog(" -w, --window Run Vanilla in a window (overrides config)\n");
vpilog(" -f, --fullscreen Run Vanilla full screen (overrides config)\n");
vpilog(" --show-cursor Run Vanilla with the cursor visible (overrides config)\n");
vpilog(" --no-cursor Run Vanilla without the cursor visible (overrides config)\n");
vpilog(" -h, --help Show this help message\n");
}