From 769f5c4b0a5696770af2488890aeb807676f8f71 Mon Sep 17 00:00:00 2001 From: "BADIM-PC\\Vadim" Date: Tue, 28 Nov 2017 09:05:34 +0300 Subject: [PATCH] "tic80 -fullscreen" command line needed #418 --- src/console.c | 2 ++ src/studio.c | 10 +++++----- src/studio.h | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/console.c b/src/console.c index 88bb59d..ea6ca91 100644 --- a/src/console.c +++ b/src/console.c @@ -2868,6 +2868,8 @@ void initConsole(Console* console, tic_mem* tic, FileSystem* fs, Config* config, config->data.noSound = true; else if(strcmp(argv[i], "-surf") == 0) console->startSurf = true; + else if(strcmp(argv[i], "-fullscreen") == 0) + goFullscreen(); } } diff --git a/src/studio.c b/src/studio.c index 266dcf0..456e410 100644 --- a/src/studio.c +++ b/src/studio.c @@ -1371,7 +1371,7 @@ static void processMouse() } } -static void onFullscreen() +void goFullscreen() { studio.fullscreen = !studio.fullscreen; SDL_SetWindowFullscreen(studio.window, studio.fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0); @@ -1555,12 +1555,12 @@ static bool processShortcuts(SDL_KeyboardEvent* event) studio.gamepad.backProcessed = true; return true; case SDLK_F11: - onFullscreen(); + goFullscreen(); return true; case SDLK_RETURN: if(mod & KMOD_RALT) { - onFullscreen(); + goFullscreen(); return true; } break; @@ -1627,11 +1627,11 @@ static bool processShortcuts(SDL_KeyboardEvent* event) return true; } break; - case SDLK_F11: onFullscreen(); return true; + case SDLK_F11: goFullscreen(); return true; case SDLK_RETURN: if(mod & KMOD_RALT) { - onFullscreen(); + goFullscreen(); return true; } else if(mod & TIC_MOD_CTRL) diff --git a/src/studio.h b/src/studio.h index 16c3ada..a8b0588 100644 --- a/src/studio.h +++ b/src/studio.h @@ -199,3 +199,4 @@ void gotoCode(); void gotoSurf(); void exitFromGameMenu(); void runProject(); +void goFullscreen();