mirror of
https://cagebreak.project-repo.co/cagebreak.git
synced 2026-08-26 23:44:18 +02:00
Add output scaling (#34)
* feat: output scaling * chore: update man file * fix: message when scaling
This commit is contained in:
parent
4077064bc8
commit
29943b50e6
7 changed files with 35 additions and 7 deletions
14
parse.c
14
parse.c
|
|
@ -532,6 +532,7 @@ parse_output_config(char **saveptr, char **errstr) {
|
|||
cfg->output_name = NULL;
|
||||
cfg->refresh_rate = 0;
|
||||
cfg->priority = -1;
|
||||
cfg->scale = NULL;
|
||||
char *name = strtok_r(NULL, " ", saveptr);
|
||||
if(name == NULL) {
|
||||
*errstr =
|
||||
|
|
@ -619,6 +620,19 @@ parse_output_config(char **saveptr, char **errstr) {
|
|||
goto error;
|
||||
}
|
||||
|
||||
char *scale_str = strtok_r(NULL, " ", saveptr);
|
||||
if(scale_str != NULL && strcmp(scale_str, "scale") == 0) {
|
||||
cfg->scale = malloc(sizeof(float));
|
||||
*cfg->scale = parse_float(saveptr, " ");
|
||||
if(*cfg->scale <= 0.0) {
|
||||
*errstr =
|
||||
log_error("Error parsing scale of output configuration for "
|
||||
"output %s, expected positive float",
|
||||
name);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
cfg->output_name = strdup(name);
|
||||
return cfg;
|
||||
error:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue