Add param option full

pull/41/head
FlightlessMango 4 years ago
parent b9ae979a05
commit 29bacea97f

@ -240,6 +240,16 @@ parse_overlay_env(struct overlay_params *params,
// Get config options // Get config options
parseConfigFile(); 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) { for (auto& it : options) {
#define OVERLAY_PARAM_BOOL(name) \ #define OVERLAY_PARAM_BOOL(name) \
if (it.first == #name) { \ if (it.first == #name) { \
@ -262,7 +272,15 @@ parse_overlay_env(struct overlay_params *params,
while ((num = parse_string(env, key, value)) != 0) { while ((num = parse_string(env, key, value)) != 0) {
env += num; 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) \ #define OVERLAY_PARAM_BOOL(name) \
if (!strcmp(#name, key)) { \ if (!strcmp(#name, key)) { \
params->enabled[OVERLAY_PARAM_ENABLED_##name] = \ params->enabled[OVERLAY_PARAM_ENABLED_##name] = \
@ -280,6 +298,7 @@ parse_overlay_env(struct overlay_params *params,
fprintf(stderr, "Unknown option '%s'\n", key); fprintf(stderr, "Unknown option '%s'\n", key);
} }
} }
// if font_size is used and height has not been changed from default // if font_size is used and height has not been changed from default
// increase height as needed based on font_size // increase height as needed based on font_size

@ -47,6 +47,7 @@ extern "C" {
OVERLAY_PARAM_BOOL(ram) \ OVERLAY_PARAM_BOOL(ram) \
OVERLAY_PARAM_BOOL(vram) \ OVERLAY_PARAM_BOOL(vram) \
OVERLAY_PARAM_BOOL(crosshair) \ OVERLAY_PARAM_BOOL(crosshair) \
OVERLAY_PARAM_BOOL(full) \
OVERLAY_PARAM_CUSTOM(fps_sampling_period) \ OVERLAY_PARAM_CUSTOM(fps_sampling_period) \
OVERLAY_PARAM_CUSTOM(output_file) \ OVERLAY_PARAM_CUSTOM(output_file) \
OVERLAY_PARAM_CUSTOM(position) \ OVERLAY_PARAM_CUSTOM(position) \
@ -92,6 +93,7 @@ struct overlay_params {
uint32_t crosshair_size; uint32_t crosshair_size;
bool help; bool help;
bool no_display; bool no_display;
bool full;
unsigned width; unsigned width;
unsigned height; unsigned height;
unsigned offset_x; unsigned offset_x;

Loading…
Cancel
Save