diff options
Diffstat (limited to 'main/main.cpp')
-rw-r--r-- | main/main.cpp | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/main/main.cpp b/main/main.cpp index add37def8c..f8088cba1c 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -827,7 +827,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph if (I->next()) { String vm = I->next()->get(); - if (vm.find("x") == -1) { // invalid parameter format + if (!vm.contains("x")) { // invalid parameter format OS::get_singleton()->print("Invalid resolution '%s', it should be e.g. '1280x720'.\n", vm.utf8().get_data()); @@ -858,7 +858,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph if (I->next()) { String vm = I->next()->get(); - if (vm.find(",") == -1) { // invalid parameter format + if (!vm.contains(",")) { // invalid parameter format OS::get_singleton()->print("Invalid position '%s', it should be e.g. '80,128'.\n", vm.utf8().get_data()); @@ -940,7 +940,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph } else if (I->get() == "--debug-server") { if (I->next()) { debug_server_uri = I->next()->get(); - if (debug_server_uri.find("://") == -1) { // wrong address + if (!debug_server_uri.contains("://")) { // wrong address OS::get_singleton()->print("Invalid debug server uri. It should be of the form <protocol>://<bind_address>:<port>.\n"); goto error; } @@ -1073,7 +1073,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph } else if (I->get() == "--remote-debug") { if (I->next()) { debug_uri = I->next()->get(); - if (debug_uri.find("://") == -1) { // wrong address + if (!debug_uri.contains("://")) { // wrong address OS::get_singleton()->print( "Invalid debug host address, it should be of the form <protocol>://<host/IP>:<port>.\n"); goto error; @@ -1130,7 +1130,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph if (!remotefs.is_empty()) { file_access_network_client = memnew(FileAccessNetworkClient); int port; - if (remotefs.find(":") != -1) { + if (remotefs.contains(":")) { port = remotefs.get_slicec(':', 1).to_int(); remotefs = remotefs.get_slicec(':', 0); } else { @@ -1310,12 +1310,14 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph 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 + "0,7680,1,or_greater")); // 8K resolution + 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 + "0,4320,1,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); @@ -1325,13 +1327,13 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph PropertyInfo(Variant::INT, "display/window/size/window_width_override", PROPERTY_HINT_RANGE, - "0,7680,or_greater")); // 8K resolution + "0,7680,1,or_greater")); // 8K resolution 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/window_height_override", PROPERTY_HINT_RANGE, - "0,4320,or_greater")); // 8K resolution + "0,4320,1,or_greater")); // 8K resolution if (use_custom_res) { if (!force_res) { @@ -1728,15 +1730,11 @@ Error Main::setup2(Thread::ID p_main_tid_override) { if (show_logo) { //boot logo! const bool boot_logo_image = GLOBAL_DEF("application/boot_splash/show_image", true); const String boot_logo_path = String(GLOBAL_DEF("application/boot_splash/image", String())).strip_edges(); - const RenderingServer::SplashStretchMode boot_stretch_mode = - (RenderingServer::SplashStretchMode)(int)GLOBAL_DEF("application/boot_splash/stretch_mode", RenderingServer::SPLASH_STRETCH_MODE_KEEP); + const bool boot_logo_scale = GLOBAL_DEF("application/boot_splash/fullsize", true); const bool boot_logo_filter = GLOBAL_DEF("application/boot_splash/use_filter", true); - - ProjectSettings::get_singleton()->set_custom_property_info("application/boot_splash/stretch_mode", - PropertyInfo(Variant::INT, "application/boot_splash/stretch_mode", - PROPERTY_HINT_ENUM, "Disabled,Keep,Keep Width,Keep Height,Cover,Expand")); // Sync with RenderingServer::SplashStretchMode. ProjectSettings::get_singleton()->set_custom_property_info("application/boot_splash/image", - PropertyInfo(Variant::STRING, "application/boot_splash/image", + PropertyInfo(Variant::STRING, + "application/boot_splash/image", PROPERTY_HINT_FILE, "*.png")); Ref<Image> boot_logo; @@ -1764,8 +1762,9 @@ Error Main::setup2(Thread::ID p_main_tid_override) { const Color boot_bg_color = GLOBAL_DEF("application/boot_splash/bg_color", boot_splash_bg_color); #endif if (boot_logo.is_valid()) { - RenderingServer::get_singleton()->set_boot_image(boot_logo, boot_bg_color, - boot_stretch_mode, boot_logo_filter); + RenderingServer::get_singleton()->set_boot_image(boot_logo, boot_bg_color, boot_logo_scale, + boot_logo_filter); + } else { #ifndef NO_DEFAULT_BOOT_LOGO MAIN_PRINT("Main: Create bootsplash"); @@ -1778,7 +1777,7 @@ Error Main::setup2(Thread::ID p_main_tid_override) { MAIN_PRINT("Main: ClearColor"); RenderingServer::get_singleton()->set_default_clear_color(boot_bg_color); MAIN_PRINT("Main: Image"); - RenderingServer::get_singleton()->set_boot_image(splash, boot_bg_color, RenderingServer::SPLASH_STRETCH_MODE_DISABLED); + RenderingServer::get_singleton()->set_boot_image(splash, boot_bg_color, false); #endif } |