From 29bacea97fc00ae0178be01ec463cdc76a8ae03f Mon Sep 17 00:00:00 2001 From: FlightlessMango Date: Wed, 12 Feb 2020 16:52:54 +0100 Subject: [PATCH] Add param option full --- src/overlay_params.cpp | 21 ++++++++++++++++++++- src/overlay_params.h | 2 ++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/overlay_params.cpp b/src/overlay_params.cpp index a3957b2b..5e7e72e6 100644 --- a/src/overlay_params.cpp +++ b/src/overlay_params.cpp @@ -240,6 +240,16 @@ parse_overlay_env(struct overlay_params *params, // Get config options parseConfigFile(); + if (options.find("full") != options.end() && options.find("full")->second != "0") { + #define OVERLAY_PARAM_BOOL(name) \ + params->enabled[OVERLAY_PARAM_ENABLED_##name] = 1; + #define OVERLAY_PARAM_CUSTOM(name) //define _CUSTOM to nothing so they are left alone + OVERLAY_PARAMS + #undef OVERLAY_PARAM_BOOL + #undef OVERLAY_PARAM_CUSTOM + params->enabled[OVERLAY_PARAM_ENABLED_crosshair] = 0; + options.erase("full"); + } for (auto& it : options) { #define OVERLAY_PARAM_BOOL(name) \ if (it.first == #name) { \ @@ -262,7 +272,15 @@ parse_overlay_env(struct overlay_params *params, while ((num = parse_string(env, key, value)) != 0) { env += num; - + if (!strcmp("full", key)) { + #define OVERLAY_PARAM_BOOL(name) \ + params->enabled[OVERLAY_PARAM_ENABLED_##name] = 1; + #define OVERLAY_PARAM_CUSTOM(name) //define _CUSTOM to nothing so they are left alone + OVERLAY_PARAMS + #undef OVERLAY_PARAM_BOOL + #undef OVERLAY_PARAM_CUSTOM + params->enabled[OVERLAY_PARAM_ENABLED_crosshair] = 0; + } #define OVERLAY_PARAM_BOOL(name) \ if (!strcmp(#name, key)) { \ params->enabled[OVERLAY_PARAM_ENABLED_##name] = \ @@ -280,6 +298,7 @@ parse_overlay_env(struct overlay_params *params, fprintf(stderr, "Unknown option '%s'\n", key); } } + // if font_size is used and height has not been changed from default // increase height as needed based on font_size diff --git a/src/overlay_params.h b/src/overlay_params.h index 0e2f64c9..3ead937d 100644 --- a/src/overlay_params.h +++ b/src/overlay_params.h @@ -47,6 +47,7 @@ extern "C" { OVERLAY_PARAM_BOOL(ram) \ OVERLAY_PARAM_BOOL(vram) \ OVERLAY_PARAM_BOOL(crosshair) \ + OVERLAY_PARAM_BOOL(full) \ OVERLAY_PARAM_CUSTOM(fps_sampling_period) \ OVERLAY_PARAM_CUSTOM(output_file) \ OVERLAY_PARAM_CUSTOM(position) \ @@ -92,6 +93,7 @@ struct overlay_params { uint32_t crosshair_size; bool help; bool no_display; + bool full; unsigned width; unsigned height; unsigned offset_x;