From 59053815ae8f967476e6b68137357ad7f9d8bb3b Mon Sep 17 00:00:00 2001 From: Gargaj Date: Sun, 7 Mar 2021 13:52:50 +0100 Subject: [PATCH] move skip option to one level higher; document --- README.md | 1 + src/main.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7107148..66a00e6 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ You can configure Bonzomatic by creating a `config.json` and placing it next to The file can have the following contents: (all fields are optional) ``` javascript { + "skipSetupDialog": true, // If true, setup dialog will be suppressed - all values you provide below will be used without validation (at your own risk!) "window":{ // default window size / state; if there's a setup dialog, it will override it "width":1920, "height":1080, diff --git a/src/main.cpp b/src/main.cpp index a1b7e60..b8493ef 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -100,6 +100,10 @@ int main( int argc, const char *argv[] ) FFT::Create(); + bool skipSetupDialog = false; + if ( options.has( "skipSetupDialog" ) ) + skipSetupDialog = options.get( "skipSetupDialog" ); + SetupDialog::SETTINGS settings; settings.sFFT.bUseRecordingDevice = true; settings.sFFT.pDeviceID = NULL; @@ -119,7 +123,6 @@ int main( int argc, const char *argv[] ) settings.sRenderer.nHeight = 1080; settings.sRenderer.windowMode = RENDERER_WINDOWMODE_FULLSCREEN; - bool skipSetupDialog = false; if ( options.has( "window" ) ) { if ( options.get( "window" ).has( "width" ) ) @@ -128,8 +131,6 @@ int main( int argc, const char *argv[] ) settings.sRenderer.nHeight = options.get( "window" ).get( "height" ); if ( options.get( "window" ).has( "fullscreen" ) ) settings.sRenderer.windowMode = options.get( "window" ).get( "fullscreen" ) ? RENDERER_WINDOWMODE_FULLSCREEN : RENDERER_WINDOWMODE_WINDOWED; - if ( options.get( "window" ).has( "skipSetupDialog" ) ) - skipSetupDialog = options.get( "window" ).get( "skipSetupDialog" ); } if ( !skipSetupDialog ) {