Skip to content

Commit

Permalink
move skip option to one level higher; document
Browse files Browse the repository at this point in the history
  • Loading branch information
Gargaj committed Mar 7, 2021
1 parent 8707888 commit 5905381
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -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,
Expand Down
7 changes: 4 additions & 3 deletions src/main.cpp
Expand Up @@ -100,6 +100,10 @@ int main( int argc, const char *argv[] )

FFT::Create();

bool skipSetupDialog = false;
if ( options.has<jsonxx::Boolean>( "skipSetupDialog" ) )
skipSetupDialog = options.get<jsonxx::Boolean>( "skipSetupDialog" );

SetupDialog::SETTINGS settings;
settings.sFFT.bUseRecordingDevice = true;
settings.sFFT.pDeviceID = NULL;
Expand All @@ -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<jsonxx::Object>( "window" ) )
{
if ( options.get<jsonxx::Object>( "window" ).has<jsonxx::Number>( "width" ) )
Expand All @@ -128,8 +131,6 @@ int main( int argc, const char *argv[] )
settings.sRenderer.nHeight = options.get<jsonxx::Object>( "window" ).get<jsonxx::Number>( "height" );
if ( options.get<jsonxx::Object>( "window" ).has<jsonxx::Boolean>( "fullscreen" ) )
settings.sRenderer.windowMode = options.get<jsonxx::Object>( "window" ).get<jsonxx::Boolean>( "fullscreen" ) ? RENDERER_WINDOWMODE_FULLSCREEN : RENDERER_WINDOWMODE_WINDOWED;
if ( options.get<jsonxx::Object>( "window" ).has<jsonxx::Boolean>( "skipSetupDialog" ) )
skipSetupDialog = options.get<jsonxx::Object>( "window" ).get<jsonxx::Boolean>( "skipSetupDialog" );
}
if ( !skipSetupDialog )
{
Expand Down

0 comments on commit 5905381

Please sign in to comment.