diff options
Diffstat (limited to 'main/main.cpp')
-rw-r--r-- | main/main.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/main/main.cpp b/main/main.cpp index 6764332f16..9076d110bd 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -571,8 +571,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph List<String>::Element *I = args.front(); - I = args.front(); - while (I) { I->get() = unescape_cmdline(I->get().strip_edges()); I = I->next(); @@ -1969,7 +1967,7 @@ bool Main::start() { for (int i = 0; i < _doc_data_class_path_count; i++) { // Custom modules are always located by absolute path. String path = _doc_data_class_paths[i].path; - if (path.is_rel_path()) { + if (path.is_relative_path()) { path = doc_tool_path.plus_file(path); } String name = _doc_data_class_paths[i].name; @@ -2127,11 +2125,11 @@ bool Main::start() { if (!project_manager && !editor) { // game if (game_path != "" || script != "") { //autoload - Map<StringName, ProjectSettings::AutoloadInfo> autoloads = ProjectSettings::get_singleton()->get_autoload_list(); + OrderedHashMap<StringName, ProjectSettings::AutoloadInfo> autoloads = ProjectSettings::get_singleton()->get_autoload_list(); //first pass, add the constants so they exist before any script is loaded - for (Map<StringName, ProjectSettings::AutoloadInfo>::Element *E = autoloads.front(); E; E = E->next()) { - const ProjectSettings::AutoloadInfo &info = E->get(); + for (OrderedHashMap<StringName, ProjectSettings::AutoloadInfo>::Element E = autoloads.front(); E; E = E.next()) { + const ProjectSettings::AutoloadInfo &info = E.get(); if (info.is_singleton) { for (int i = 0; i < ScriptServer::get_language_count(); i++) { @@ -2142,8 +2140,8 @@ bool Main::start() { //second pass, load into global constants List<Node *> to_add; - for (Map<StringName, ProjectSettings::AutoloadInfo>::Element *E = autoloads.front(); E; E = E->next()) { - const ProjectSettings::AutoloadInfo &info = E->get(); + for (OrderedHashMap<StringName, ProjectSettings::AutoloadInfo>::Element E = autoloads.front(); E; E = E.next()) { + const ProjectSettings::AutoloadInfo &info = E.get(); RES res = ResourceLoader::load(info.path); ERR_CONTINUE_MSG(res.is_null(), "Can't autoload: " + info.path); @@ -2203,7 +2201,7 @@ bool Main::start() { //standard helpers that can be changed from main config String stretch_mode = GLOBAL_DEF_BASIC("display/window/stretch/mode", "disabled"); - String stretch_aspect = GLOBAL_DEF_BASIC("display/window/stretch/aspect", "ignore"); + 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)); @@ -2242,6 +2240,10 @@ bool Main::start() { DisplayServer::get_singleton()->window_set_title(appname); #endif + // Define a very small minimum window size to prevent bugs such as GH-37242. + // It can still be overridden by the user in a script. + DisplayServer::get_singleton()->window_set_min_size(Size2i(64, 64)); + bool snap_controls = GLOBAL_DEF("gui/common/snap_controls_to_pixels", true); sml->get_root()->set_snap_controls_to_pixels(snap_controls); @@ -2262,7 +2264,7 @@ bool Main::start() { "display/window/stretch/mode", PROPERTY_HINT_ENUM, "disabled,canvas_items,viewport")); - GLOBAL_DEF_BASIC("display/window/stretch/aspect", "ignore"); + GLOBAL_DEF_BASIC("display/window/stretch/aspect", "keep"); ProjectSettings::get_singleton()->set_custom_property_info("display/window/stretch/aspect", PropertyInfo(Variant::STRING, "display/window/stretch/aspect", |