diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-01-18 13:39:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-18 13:39:57 +0100 |
commit | 7c771ea3101b19600be3c485ddd15da8b2cfb560 (patch) | |
tree | 7ebea7a618ce2120e13a74e59001812c92760e52 /main/main.cpp | |
parent | 0a67b4639699277648a23f5a47d4b023d951bd6d (diff) | |
parent | f107139979d55eaa2f3ddc41f2c7d7895801f2e5 (diff) |
Merge pull request #47522 from madmiraal/rename-test_width-test_height
Diffstat (limited to 'main/main.cpp')
-rw-r--r-- | main/main.cpp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/main/main.cpp b/main/main.cpp index 7350e15ef5..8b58641461 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1306,47 +1306,47 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph // always convert to lower case for consistency in the code rendering_driver = rendering_driver.to_lower(); - GLOBAL_DEF_BASIC("display/window/size/width", 1024); - ProjectSettings::get_singleton()->set_custom_property_info("display/window/size/width", - PropertyInfo(Variant::INT, "display/window/size/width", + GLOBAL_DEF_BASIC("display/window/size/viewport_width", 1024); + ProjectSettings::get_singleton()->set_custom_property_info("display/window/size/viewport_width", + PropertyInfo(Variant::INT, "display/window/size/viewport_width", PROPERTY_HINT_RANGE, "0,7680,or_greater")); // 8K resolution - GLOBAL_DEF_BASIC("display/window/size/height", 600); - ProjectSettings::get_singleton()->set_custom_property_info("display/window/size/height", - PropertyInfo(Variant::INT, "display/window/size/height", + GLOBAL_DEF_BASIC("display/window/size/viewport_height", 600); + ProjectSettings::get_singleton()->set_custom_property_info("display/window/size/viewport_height", + PropertyInfo(Variant::INT, "display/window/size/viewport_height", PROPERTY_HINT_RANGE, "0,4320,or_greater")); // 8K resolution GLOBAL_DEF_BASIC("display/window/size/resizable", true); GLOBAL_DEF_BASIC("display/window/size/borderless", false); GLOBAL_DEF_BASIC("display/window/size/fullscreen", false); GLOBAL_DEF("display/window/size/always_on_top", false); - GLOBAL_DEF("display/window/size/test_width", 0); - ProjectSettings::get_singleton()->set_custom_property_info("display/window/size/test_width", + GLOBAL_DEF("display/window/size/window_width_override", 0); + ProjectSettings::get_singleton()->set_custom_property_info("display/window/size/window_width_override", PropertyInfo(Variant::INT, - "display/window/size/test_width", + "display/window/size/window_width_override", PROPERTY_HINT_RANGE, "0,7680,or_greater")); // 8K resolution - GLOBAL_DEF("display/window/size/test_height", 0); - ProjectSettings::get_singleton()->set_custom_property_info("display/window/size/test_height", + GLOBAL_DEF("display/window/size/window_height_override", 0); + ProjectSettings::get_singleton()->set_custom_property_info("display/window/size/window_height_override", PropertyInfo(Variant::INT, - "display/window/size/test_height", + "display/window/size/window_height_override", PROPERTY_HINT_RANGE, "0,4320,or_greater")); // 8K resolution if (use_custom_res) { if (!force_res) { - window_size.width = GLOBAL_GET("display/window/size/width"); - window_size.height = GLOBAL_GET("display/window/size/height"); - - if (globals->has_setting("display/window/size/test_width") && - globals->has_setting("display/window/size/test_height")) { - int tw = globals->get("display/window/size/test_width"); - if (tw > 0) { - window_size.width = tw; + window_size.width = GLOBAL_GET("display/window/size/viewport_width"); + window_size.height = GLOBAL_GET("display/window/size/viewport_height"); + + if (globals->has_setting("display/window/size/window_width_override") && + globals->has_setting("display/window/size/window_height_override")) { + int desired_width = globals->get("display/window/size/window_width_override"); + if (desired_width > 0) { + window_size.width = desired_width; } - int th = globals->get("display/window/size/test_height"); - if (th > 0) { - window_size.height = th; + int desired_height = globals->get("display/window/size/window_height_override"); + if (desired_height > 0) { + window_size.height = desired_height; } } } @@ -2348,8 +2348,8 @@ bool Main::start() { String stretch_mode = GLOBAL_DEF_BASIC("display/window/stretch/mode", "disabled"); String stretch_aspect = GLOBAL_DEF_BASIC("display/window/stretch/aspect", "keep"); - Size2i stretch_size = Size2i(GLOBAL_DEF_BASIC("display/window/size/width", 0), - GLOBAL_DEF_BASIC("display/window/size/height", 0)); + Size2i stretch_size = Size2i(GLOBAL_DEF_BASIC("display/window/size/viewport_width", 0), + GLOBAL_DEF_BASIC("display/window/size/viewport_height", 0)); real_t stretch_scale = GLOBAL_DEF_BASIC("display/window/stretch/scale", 1.0); Window::ContentScaleMode cs_sm = Window::CONTENT_SCALE_MODE_DISABLED; |