mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge pull request #2454 from Gymnasiast/scale-factor-console
Add console option to set window scale, fixes #2356
This commit is contained in:
commit
c9c390fe3f
|
@ -530,6 +530,9 @@ static int cc_get(const utf8 **argv, int argc)
|
|||
console_printf("location %d %d", mapCoord.x, mapCoord.y);
|
||||
}
|
||||
}
|
||||
else if (strcmp(argv[0], "window_scale") == 0) {
|
||||
console_printf("window_scale %.3f", gConfigGeneral.window_scale);
|
||||
}
|
||||
else {
|
||||
console_writeline_warning("Invalid variable.");
|
||||
}
|
||||
|
@ -686,6 +689,14 @@ static int cc_set(const utf8 **argv, int argc)
|
|||
console_execute_silent("get location");
|
||||
}
|
||||
}
|
||||
else if (strcmp(argv[0], "window_scale") == 0 && invalidArguments(&invalidArgs, double_valid[0])) {
|
||||
float newScale = (float)(0.001*trunc(1000*double_val[0]));
|
||||
gConfigGeneral.window_scale = clamp(newScale, 0.1f, 5.0f);
|
||||
config_save_default();
|
||||
gfx_invalidate_screen();
|
||||
platform_trigger_resize();
|
||||
console_execute_silent("get window_scale");
|
||||
}
|
||||
else if (invalidArgs) {
|
||||
console_writeline_error("Invalid arguments.");
|
||||
}
|
||||
|
@ -911,7 +922,8 @@ utf8* console_variable_table[] = {
|
|||
"console_small_font",
|
||||
"test_unfinished_tracks",
|
||||
"no_test_crashes",
|
||||
"location"
|
||||
"location",
|
||||
"window_scale"
|
||||
};
|
||||
utf8* console_window_table[] = {
|
||||
"object_selection",
|
||||
|
|
Loading…
Reference in New Issue