diff options
33 files changed, 143 insertions, 86 deletions
diff --git a/core/error_macros.h b/core/error_macros.h index 4a3ea28957..e4d7609e04 100644 --- a/core/error_macros.h +++ b/core/error_macros.h @@ -502,11 +502,11 @@ void _err_print_index_error(const char *p_function, const char *p_file, int p_li * * The current function returns `m_retval`. */ -#define ERR_FAIL_V(m_retval) \ - if (1) { \ - _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Method/Function Failed, returning: " __STR(m_value)); \ - return m_retval; \ - } else \ +#define ERR_FAIL_V(m_retval) \ + if (1) { \ + _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Method/Function Failed, returning: " __STR(m_retval)); \ + return m_retval; \ + } else \ ((void)0) /** @@ -515,11 +515,11 @@ void _err_print_index_error(const char *p_function, const char *p_file, int p_li * * Prints `m_msg`, and the current function returns `m_retval`. */ -#define ERR_FAIL_V_MSG(m_retval, m_msg) \ - if (1) { \ - _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Method/Function Failed, returning: " __STR(m_value), DEBUG_STR(m_msg)); \ - return m_retval; \ - } else \ +#define ERR_FAIL_V_MSG(m_retval, m_msg) \ + if (1) { \ + _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Method/Function Failed, returning: " __STR(m_retval), DEBUG_STR(m_msg)); \ + return m_retval; \ + } else \ ((void)0) /** diff --git a/core/register_core_types.cpp b/core/register_core_types.cpp index 07a252ad31..b0ba8ed194 100644 --- a/core/register_core_types.cpp +++ b/core/register_core_types.cpp @@ -100,7 +100,7 @@ extern void unregister_variant_methods(); void register_core_types() { //consistency check - ERR_FAIL_COND(sizeof(Callable) > 16); + static_assert(sizeof(Callable) <= 16); ObjectDB::setup(); ResourceCache::setup(); diff --git a/core/variant_parser.cpp b/core/variant_parser.cpp index 12fd9976bd..d2ee0b71c9 100644 --- a/core/variant_parser.cpp +++ b/core/variant_parser.cpp @@ -532,6 +532,10 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream, value = false; else if (id == "null" || id == "nil") value = Variant(); + else if (id == "inf") + value = Math_INF; + else if (id == "nan") + value = Math_NAN; else if (id == "Vector2") { Vector<float> args; @@ -1499,8 +1503,10 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str case Variant::FLOAT: { String s = rtosfix(p_variant.operator real_t()); - if (s.find(".") == -1 && s.find("e") == -1) - s += ".0"; + if (s != "inf" && s != "nan") { + if (s.find(".") == -1 && s.find("e") == -1) + s += ".0"; + } p_store_string_func(p_store_string_ud, s); } break; case Variant::STRING: { diff --git a/doc/classes/ARVRPositionalTracker.xml b/doc/classes/ARVRPositionalTracker.xml index 9225717978..640b721d37 100644 --- a/doc/classes/ARVRPositionalTracker.xml +++ b/doc/classes/ARVRPositionalTracker.xml @@ -54,6 +54,13 @@ Returns the world-space controller position. </description> </method> + <method name="get_tracker_id" qualifiers="const"> + <return type="int"> + </return> + <description> + Returns the internal tracker ID. This uniquely identifies the tracker per tracker type and matches the ID you need to specify for nodes such as the [ARVRController] and [ARVRAnchor] nodes. + </description> + </method> <method name="get_tracks_orientation" qualifiers="const"> <return type="bool"> </return> diff --git a/doc/classes/ConcavePolygonShape.xml b/doc/classes/ConcavePolygonShape.xml index 21f2f681b9..47f2276c63 100644 --- a/doc/classes/ConcavePolygonShape.xml +++ b/doc/classes/ConcavePolygonShape.xml @@ -5,6 +5,7 @@ </brief_description> <description> Concave polygon shape resource, which can be set into a [PhysicsBody] or area. This shape is created by feeding a list of triangles. + Note: when used for collision, [ConcavePolygonShape] is intended to work with static [PhysicsBody] nodes like [StaticBody] and will not work with [KinematicBody] or [RigidBody] with a mode other than Static. </description> <tutorials> </tutorials> diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index eb15bc2ad9..717130728d 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -328,7 +328,7 @@ <return type="float"> </return> <description> - Returns the time elapsed since the last physics-bound frame (see [method _physics_process]). This is always a constant value in physics processing unless the frames per second is changed via [member Engine.target_fps]. + Returns the time elapsed since the last physics-bound frame (see [method _physics_process]). This is always a constant value in physics processing unless the frames per second is changed via [member Engine.iterations_per_second]. </description> </method> <method name="get_position_in_parent" qualifiers="const"> @@ -747,7 +747,7 @@ <argument index="0" name="enable" type="bool"> </argument> <description> - Enables or disables physics (i.e. fixed framerate) processing. When a node is being processed, it will receive a [constant NOTIFICATION_PHYSICS_PROCESS] at a fixed (usually 60 FPS, see [member Engine.target_fps] to change) interval (and the [method _physics_process] callback will be called if exists). Enabled automatically if [method _physics_process] is overridden. Any calls to this before [method _ready] will be ignored. + Enables or disables physics (i.e. fixed framerate) processing. When a node is being processed, it will receive a [constant NOTIFICATION_PHYSICS_PROCESS] at a fixed (usually 60 FPS, see [member Engine.iterations_per_second] to change) interval (and the [method _physics_process] callback will be called if exists). Enabled automatically if [method _physics_process] is overridden. Any calls to this before [method _ready] will be ignored. </description> </method> <method name="set_physics_process_internal"> diff --git a/doc/classes/SpringArm.xml b/doc/classes/SpringArm.xml index f426cfc352..780ed5077d 100644 --- a/doc/classes/SpringArm.xml +++ b/doc/classes/SpringArm.xml @@ -18,14 +18,14 @@ <argument index="0" name="RID" type="RID"> </argument> <description> - Adds the object with the given [RID] to the list of objects excluded from the collision check. + Adds the [PhysicsBody] object with the given [RID] to the list of [PhysicsBody] objects excluded from the collision check. </description> </method> <method name="clear_excluded_objects"> <return type="void"> </return> <description> - Clears the list of objects excluded from the collision check. + Clears the list of [PhysicsBody] objects excluded from the collision check. </description> </method> <method name="get_hit_length"> @@ -41,7 +41,7 @@ <argument index="0" name="RID" type="RID"> </argument> <description> - Removes the given [RID] from the list of objects excluded from the collision check. + Removes the given [RID] from the list of [PhysicsBody] objects excluded from the collision check. </description> </method> </methods> diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index 1d94b9618d..27203b3eed 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -307,7 +307,7 @@ Error OS_Unix::execute(const String &p_path, const List<String> &p_arguments, bo if (p_pipe_mutex) { p_pipe_mutex->lock(); } - (*r_pipe) += buf; + (*r_pipe) += String::utf8(buf); if (p_pipe_mutex) { p_pipe_mutex->unlock(); } diff --git a/drivers/vulkan/rendering_device_vulkan.cpp b/drivers/vulkan/rendering_device_vulkan.cpp index 2bf8a16091..8cea8ebb86 100644 --- a/drivers/vulkan/rendering_device_vulkan.cpp +++ b/drivers/vulkan/rendering_device_vulkan.cpp @@ -6862,7 +6862,7 @@ void RenderingDeviceVulkan::initialize(VulkanContext *p_context) { max_descriptors_per_pool = GLOBAL_DEF("rendering/vulkan/descriptor_pools/max_descriptors_per_pool", 64); //check to make sure DescriptorPoolKey is good - ERR_FAIL_COND(sizeof(uint64_t) * 3 < UNIFORM_TYPE_MAX * sizeof(uint16_t)); + static_assert(sizeof(uint64_t) * 3 >= UNIFORM_TYPE_MAX * sizeof(uint16_t)); draw_list = NULL; draw_list_count = 0; diff --git a/drivers/vulkan/vulkan_context.cpp b/drivers/vulkan/vulkan_context.cpp index 7068f707e6..90d32c9703 100644 --- a/drivers/vulkan/vulkan_context.cpp +++ b/drivers/vulkan/vulkan_context.cpp @@ -358,8 +358,39 @@ Error VulkanContext::_create_physical_device() { free(physical_devices); ERR_FAIL_V(ERR_CANT_CREATE); } - /* for now, just grab the first physical device */ - gpu = physical_devices[0]; + + /*Find the first discrete GPU with the most VRAM.*/ + { + print_line("Selecting primary GPU."); + VkPhysicalDeviceProperties device_properties; + VkPhysicalDeviceMemoryProperties memory_properties; + gpu = physical_devices[0]; + uint32_t largest_vram_size = 0; + VkPhysicalDeviceType gpu_type = VK_PHYSICAL_DEVICE_TYPE_OTHER; + for (uint32_t i = 0; i < gpu_count; i++) { + vkGetPhysicalDeviceProperties(physical_devices[i], &device_properties); + + /*Skip virtual and CPU devices for now.*/ + if (device_properties.deviceType > VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU) { + continue; + } + + vkGetPhysicalDeviceMemoryProperties(physical_devices[i], &memory_properties); + + /*Total all heaps in case of 3GB+1GB configurations and similar.*/ + uint32_t memory_size = 0; + for (uint32_t j = 0; j < memory_properties.memoryHeapCount; j++) { + memory_size += memory_properties.memoryHeaps[j].size; + } + + if ((device_properties.deviceType >= gpu_type) || (device_properties.deviceType == gpu_type && memory_size > largest_vram_size)) { + gpu = physical_devices[i]; + gpu_type = device_properties.deviceType; + largest_vram_size = memory_size; + print_line(device_properties.deviceName); + } + } + } free(physical_devices); /* Look for device extensions */ diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index f877aab577..250fa6b3e0 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -694,7 +694,7 @@ void EditorFileDialog::update_file_name() { String base_name = file_str.get_basename(); Vector<String> filter_substr = filter_str.split(";"); if (filter_substr.size() >= 2) { - file_str = base_name + "." + filter_substr[1].strip_edges().to_lower(); + file_str = base_name + "." + filter_substr[0].strip_edges().lstrip("*.").to_lower(); } else { file_str = base_name + "." + filter_str.get_extension().strip_edges().to_lower(); } @@ -1392,6 +1392,7 @@ void EditorFileDialog::_bind_methods() { ClassDB::bind_method(D_METHOD("is_showing_hidden_files"), &EditorFileDialog::is_showing_hidden_files); ClassDB::bind_method(D_METHOD("_update_file_name"), &EditorFileDialog::update_file_name); ClassDB::bind_method(D_METHOD("_update_dir"), &EditorFileDialog::update_dir); + ClassDB::bind_method(D_METHOD("_update_file_list"), &EditorFileDialog::update_file_list); ClassDB::bind_method(D_METHOD("_thumbnail_done"), &EditorFileDialog::_thumbnail_done); ClassDB::bind_method(D_METHOD("set_display_mode", "mode"), &EditorFileDialog::set_display_mode); ClassDB::bind_method(D_METHOD("get_display_mode"), &EditorFileDialog::get_display_mode); diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 3f99048ba6..14831f11e9 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -1358,7 +1358,7 @@ void EditorInspector::_parse_added_editors(VBoxContainer *current_vbox, Ref<Edit if (ep) { ep->object = object; - ep->connect("property_changed", callable_mp(this, &EditorInspector::_property_changed)); + ep->connect("property_changed", callable_mp(this, &EditorInspector::_property_changed), make_binds(StringName(), false)); ep->connect("property_keyed", callable_mp(this, &EditorInspector::_property_keyed)); ep->connect("property_keyed_with_value", callable_mp(this, &EditorInspector::_property_keyed_with_value)); ep->connect("property_checked", callable_mp(this, &EditorInspector::_property_checked)); @@ -1770,9 +1770,9 @@ void EditorInspector::update_tree() { if (ep) { - ep->connect("property_changed", callable_mp(this, &EditorInspector::_property_changed)); + ep->connect("property_changed", callable_mp(this, &EditorInspector::_property_changed), make_binds(StringName(), false)); if (p.usage & PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED) { - ep->connect("property_changed", callable_mp(this, &EditorInspector::_property_changed_update_all), varray(), CONNECT_DEFERRED); + ep->connect("property_changed", callable_mp(this, &EditorInspector::_property_changed_update_all), make_binds(StringName(), false), CONNECT_DEFERRED); } ep->connect("property_keyed", callable_mp(this, &EditorInspector::_property_keyed)); ep->connect("property_keyed_with_value", callable_mp(this, &EditorInspector::_property_keyed_with_value)); @@ -2052,16 +2052,16 @@ void EditorInspector::_edit_set(const String &p_name, const Variant &p_value, bo } } -void EditorInspector::_property_changed(const String &p_path, const Variant &p_value, const String &p_name, bool changing) { +void EditorInspector::_property_changed(const String &p_path, const Variant &p_value, const String &p_name, bool p_changing) { // The "changing" variable must be true for properties that trigger events as typing occurs, - // like "text_changed" signal. eg: Text property of Label, Button, RichTextLabel, etc. - if (changing) + // like "text_changed" signal. E.g. text property of Label, Button, RichTextLabel, etc. + if (p_changing) this->changing++; _edit_set(p_path, p_value, false, p_name); - if (changing) + if (p_changing) this->changing--; if (restart_request_props.has(p_path)) { diff --git a/editor/editor_inspector.h b/editor/editor_inspector.h index 7ad55a13ad..7a1542d30f 100644 --- a/editor/editor_inspector.h +++ b/editor/editor_inspector.h @@ -302,7 +302,7 @@ class EditorInspector : public ScrollContainer { void _edit_set(const String &p_name, const Variant &p_value, bool p_refresh_all, const String &p_changed_field); - void _property_changed(const String &p_path, const Variant &p_value, const String &p_name = "", bool changing = false); + void _property_changed(const String &p_path, const Variant &p_value, const String &p_name = "", bool p_changing = false); void _property_changed_update_all(const String &p_path, const Variant &p_value, const String &p_name = "", bool p_changing = false); void _multiple_properties_changed(Vector<String> p_paths, Array p_values); void _property_keyed(const String &p_path, bool p_advance); diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp index 4ae6ced35b..0d00a1c1f7 100644 --- a/editor/editor_properties_array_dict.cpp +++ b/editor/editor_properties_array_dict.cpp @@ -165,10 +165,10 @@ EditorPropertyDictionaryObject::EditorPropertyDictionaryObject() { ///////////////////// ARRAY /////////////////////////// -void EditorPropertyArray::_property_changed(const String &p_prop, Variant p_value, const String &p_name, bool changing) { +void EditorPropertyArray::_property_changed(const String &p_property, Variant p_value, const StringName &p_name, bool p_changing) { - if (p_prop.begins_with("indices")) { - int idx = p_prop.get_slice("/", 1).to_int(); + if (p_property.begins_with("indices")) { + int idx = p_property.get_slice("/", 1).to_int(); Variant array = object->get_array(); array.set(idx, p_value); emit_changed(get_edited_property(), array, "", true); @@ -213,7 +213,7 @@ void EditorPropertyArray::_change_type_menu(int p_index) { update_property(); } -void EditorPropertyArray::_object_id_selected(const String &p_property, ObjectID p_id) { +void EditorPropertyArray::_object_id_selected(const StringName &p_property, ObjectID p_id) { emit_signal("object_id_selected", p_property, p_id); } @@ -359,7 +359,7 @@ void EditorPropertyArray::update_property() { prop->set_object_and_property(object.ptr(), prop_name); prop->set_label(itos(i + offset)); prop->set_selectable(false); - prop->connect("property_changed", callable_mp(this, &EditorPropertyArray::_property_changed)); + prop->connect("property_changed", callable_mp(this, &EditorPropertyArray::_property_changed), make_binds(StringName(), false)); prop->connect("object_id_selected", callable_mp(this, &EditorPropertyArray::_object_id_selected)); prop->set_h_size_flags(SIZE_EXPAND_FILL); @@ -528,16 +528,16 @@ EditorPropertyArray::EditorPropertyArray() { ///////////////////// DICTIONARY /////////////////////////// -void EditorPropertyDictionary::_property_changed(const String &p_prop, Variant p_value, const String &p_name, bool changing) { +void EditorPropertyDictionary::_property_changed(const String &p_property, Variant p_value, const StringName &p_name, bool p_changing) { - if (p_prop == "new_item_key") { + if (p_property == "new_item_key") { object->set_new_item_key(p_value); - } else if (p_prop == "new_item_value") { + } else if (p_property == "new_item_value") { object->set_new_item_value(p_value); - } else if (p_prop.begins_with("indices")) { - int idx = p_prop.get_slice("/", 1).to_int(); + } else if (p_property.begins_with("indices")) { + int idx = p_property.get_slice("/", 1).to_int(); Dictionary dict = object->get_dict(); Variant key = dict.get_key_at_index(idx); dict[key] = p_value; @@ -932,7 +932,7 @@ void EditorPropertyDictionary::update_property() { } prop->set_selectable(false); - prop->connect("property_changed", callable_mp(this, &EditorPropertyDictionary::_property_changed)); + prop->connect("property_changed", callable_mp(this, &EditorPropertyDictionary::_property_changed), make_binds(StringName(), false)); prop->connect("object_id_selected", callable_mp(this, &EditorPropertyDictionary::_object_id_selected)); HBoxContainer *hb = memnew(HBoxContainer); @@ -969,7 +969,7 @@ void EditorPropertyDictionary::update_property() { } } -void EditorPropertyDictionary::_object_id_selected(const String &p_property, ObjectID p_id) { +void EditorPropertyDictionary::_object_id_selected(const StringName &p_property, ObjectID p_id) { emit_signal("object_id_selected", p_property, p_id); } diff --git a/editor/editor_properties_array_dict.h b/editor/editor_properties_array_dict.h index d4f8abf583..3850cf0c6b 100644 --- a/editor/editor_properties_array_dict.h +++ b/editor/editor_properties_array_dict.h @@ -100,11 +100,11 @@ class EditorPropertyArray : public EditorProperty { void _page_changed(double p_page); void _length_changed(double p_page); void _edit_pressed(); - void _property_changed(const String &p_prop, Variant p_value, const String &p_name = String(), bool changing = false); + void _property_changed(const String &p_property, Variant p_value, const StringName &p_name = StringName(), bool p_changing = false); void _change_type(Object *p_button, int p_index); void _change_type_menu(int p_index); - void _object_id_selected(const String &p_property, ObjectID p_id); + void _object_id_selected(const StringName &p_property, ObjectID p_id); void _remove_pressed(int p_index); protected: @@ -135,12 +135,12 @@ class EditorPropertyDictionary : public EditorProperty { void _page_changed(double p_page); void _edit_pressed(); - void _property_changed(const String &p_prop, Variant p_value, const String &p_name = String(), bool changing = false); + void _property_changed(const String &p_property, Variant p_value, const StringName &p_name = StringName(), bool p_changing = false); void _change_type(Object *p_button, int p_index); void _change_type_menu(int p_index); void _add_key_value(); - void _object_id_selected(const String &p_property, ObjectID p_id); + void _object_id_selected(const StringName &p_property, ObjectID p_id); protected: static void _bind_methods(); diff --git a/editor/editor_settings.h b/editor/editor_settings.h index 4caa494d59..d4dd19ee10 100644 --- a/editor/editor_settings.h +++ b/editor/editor_settings.h @@ -117,7 +117,7 @@ private: void _get_property_list(List<PropertyInfo> *p_list) const; void _add_property_info_bind(const Dictionary &p_info); - void _load_defaults(Ref<ConfigFile> p_extra_config = NULL); + void _load_defaults(Ref<ConfigFile> p_extra_config = Ref<ConfigFile>()); void _load_default_text_editor_theme(); bool _save_text_editor_theme(String p_file); bool _is_default_text_editor_theme(String p_theme_name); diff --git a/editor/editor_visual_profiler.cpp b/editor/editor_visual_profiler.cpp index 1999fccddf..e9638148e2 100644 --- a/editor/editor_visual_profiler.cpp +++ b/editor/editor_visual_profiler.cpp @@ -824,7 +824,7 @@ EditorVisualProfiler::EditorVisualProfiler() { frame_delay->set_wait_time(0.1); frame_delay->set_one_shot(true); add_child(frame_delay); - frame_delay->connect("timeout", callable_mp(this, &EditorVisualProfiler::_update_frame)); + frame_delay->connect("timeout", callable_mp(this, &EditorVisualProfiler::_update_frame), make_binds(false)); plot_delay = memnew(Timer); plot_delay->set_wait_time(0.1); diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index cc62e93268..6c69f46941 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -323,7 +323,7 @@ void FileSystemDock::_notification(int p_what) { file_list_popup->connect("id_pressed", callable_mp(this, &FileSystemDock::_file_list_rmb_option)); tree_popup->connect("id_pressed", callable_mp(this, &FileSystemDock::_tree_rmb_option)); - current_path->connect("text_entered", callable_mp(this, &FileSystemDock::_navigate_to_path)); + current_path->connect("text_entered", callable_mp(this, &FileSystemDock::_navigate_to_path), make_binds(false)); always_show_folders = bool(EditorSettings::get_singleton()->get("docks/filesystem/always_show_folders")); @@ -1406,8 +1406,8 @@ bool FileSystemDock::_check_existing() { return true; } -void FileSystemDock::_move_operation_confirm(const String &p_to_path, bool overwrite) { - if (!overwrite) { +void FileSystemDock::_move_operation_confirm(const String &p_to_path, bool p_overwrite) { + if (!p_overwrite) { to_move_path = p_to_path; bool can_move = _check_existing(); if (!can_move) { @@ -2620,7 +2620,7 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { move_dialog = memnew(EditorDirDialog); move_dialog->get_ok()->set_text(TTR("Move")); add_child(move_dialog); - move_dialog->connect("dir_selected", callable_mp(this, &FileSystemDock::_move_operation_confirm)); + move_dialog->connect("dir_selected", callable_mp(this, &FileSystemDock::_move_operation_confirm), make_binds(false)); rename_dialog = memnew(ConfirmationDialog); VBoxContainer *rename_dialog_vb = memnew(VBoxContainer); diff --git a/editor/filesystem_dock.h b/editor/filesystem_dock.h index 1969f85e72..00f8cd9d50 100644 --- a/editor/filesystem_dock.h +++ b/editor/filesystem_dock.h @@ -222,7 +222,7 @@ private: void _duplicate_operation_confirm(); void _move_with_overwrite(); bool _check_existing(); - void _move_operation_confirm(const String &p_to_path, bool overwrite = false); + void _move_operation_confirm(const String &p_to_path, bool p_overwrite = false); void _tree_rmb_option(int p_option); void _file_list_rmb_option(int p_option); diff --git a/editor/groups_editor.cpp b/editor/groups_editor.cpp index 650aaa9043..b4c9a01f2a 100644 --- a/editor/groups_editor.cpp +++ b/editor/groups_editor.cpp @@ -659,6 +659,7 @@ void GroupsEditor::_show_group_dialog() { } void GroupsEditor::_bind_methods() { + ClassDB::bind_method("update_tree", &GroupsEditor::update_tree); } GroupsEditor::GroupsEditor() { diff --git a/editor/inspector_dock.h b/editor/inspector_dock.h index 016aee12cf..61b3239169 100644 --- a/editor/inspector_dock.h +++ b/editor/inspector_dock.h @@ -105,7 +105,7 @@ class InspectorDock : public VBoxContainer { void _warning_pressed(); void _resource_created(); - void _resource_selected(const RES &p_res, const String &p_property = ""); + void _resource_selected(const RES &p_res, const String &p_property); void _edit_forward(); void _edit_back(); void _menu_collapseall(); diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index ea5da1d9ac..80b7e6ffc8 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -1360,7 +1360,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { filter->set_h_size_flags(SIZE_EXPAND_FILL); filter->connect("text_entered", callable_mp(this, &EditorAssetLibrary::_search_text_entered)); search = memnew(Button(TTR("Search"))); - search->connect("pressed", callable_mp(this, &EditorAssetLibrary::_search)); + search->connect("pressed", callable_mp(this, &EditorAssetLibrary::_search), make_binds(0)); search_hb->add_child(search); if (!p_templates_only) diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp index 288aeb5c4a..5d615c7553 100644 --- a/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/editor/plugins/sprite_frames_editor_plugin.cpp @@ -990,7 +990,7 @@ SpriteFramesEditor::SpriteFramesEditor() { empty2->connect("pressed", callable_mp(this, &SpriteFramesEditor::_empty2_pressed)); move_up->connect("pressed", callable_mp(this, &SpriteFramesEditor::_up_pressed)); move_down->connect("pressed", callable_mp(this, &SpriteFramesEditor::_down_pressed)); - file->connect("files_selected", callable_mp(this, &SpriteFramesEditor::_file_load_request)); + file->connect("files_selected", callable_mp(this, &SpriteFramesEditor::_file_load_request), make_binds(-1)); loading_scene = false; sel = -1; diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index e7b7c05901..4104e01612 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -2978,7 +2978,7 @@ class VisualShaderNodePluginDefaultEditor : public VBoxContainer { Ref<Resource> parent_resource; public: - void _property_changed(const String &prop, const Variant &p_value, const String &p_field, bool p_changing = false) { + void _property_changed(const StringName &p_property, const Variant &p_value, const StringName &p_field = StringName(), bool p_changing = false) { if (p_changing) return; @@ -2986,13 +2986,13 @@ public: UndoRedo *undo_redo = EditorNode::get_singleton()->get_undo_redo(); updating = true; - undo_redo->create_action(TTR("Edit Visual Property") + ": " + prop, UndoRedo::MERGE_ENDS); - undo_redo->add_do_property(node.ptr(), prop, p_value); - undo_redo->add_undo_property(node.ptr(), prop, node->get(prop)); + undo_redo->create_action(TTR("Edit Visual Property") + ": " + p_property, UndoRedo::MERGE_ENDS); + undo_redo->add_do_property(node.ptr(), p_property, p_value); + undo_redo->add_undo_property(node.ptr(), p_property, node->get(p_property)); if (p_value.get_type() == Variant::OBJECT) { - RES prev_res = node->get(prop); + RES prev_res = node->get(p_property); RES curr_res = p_value; if (curr_res.is_null()) { @@ -3072,7 +3072,7 @@ public: p_properties[i]->connect("resource_selected", callable_mp(this, &VisualShaderNodePluginDefaultEditor::_resource_selected)); } - properties[i]->connect("property_changed", callable_mp(this, &VisualShaderNodePluginDefaultEditor::_property_changed)); + properties[i]->connect("property_changed", callable_mp(this, &VisualShaderNodePluginDefaultEditor::_property_changed), make_binds(StringName(), false)); properties[i]->set_object_and_property(node.ptr(), p_names[i]); properties[i]->update_property(); properties[i]->set_name_split_ratio(0); diff --git a/editor/project_settings_editor.h b/editor/project_settings_editor.h index 9054991dfd..52e7612acd 100644 --- a/editor/project_settings_editor.h +++ b/editor/project_settings_editor.h @@ -119,7 +119,7 @@ class ProjectSettingsEditor : public AcceptDialog { void _item_del(); void _update_actions(); void _save(); - void _add_item(int p_item, Ref<InputEvent> p_exiting_event = NULL); + void _add_item(int p_item, Ref<InputEvent> p_exiting_event = Ref<InputEvent>()); void _edit_item(Ref<InputEvent> p_exiting_event); void _action_check(String p_action); diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index b6741ccaec..c5ebf40482 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -1127,7 +1127,7 @@ void SceneTreeDock::_notification(int p_what) { } break; case NOTIFICATION_ENTER_TREE: { - clear_inherit_confirm->connect("confirmed", callable_mp(this, &SceneTreeDock::_tool_selected), varray(TOOL_SCENE_CLEAR_INHERITANCE_CONFIRM)); + clear_inherit_confirm->connect("confirmed", callable_mp(this, &SceneTreeDock::_tool_selected), make_binds(TOOL_SCENE_CLEAR_INHERITANCE_CONFIRM, false)); } break; case NOTIFICATION_EXIT_TREE: { @@ -2739,7 +2739,7 @@ void SceneTreeDock::_update_create_root_dialog() { void SceneTreeDock::_favorite_root_selected(const String &p_class) { selected_favorite_root = p_class; - _tool_selected(TOOL_CREATE_FAVORITE, false); + _tool_selected(TOOL_CREATE_FAVORITE); } void SceneTreeDock::_feature_profile_changed() { diff --git a/main/tests/test_string.cpp b/main/tests/test_string.cpp index eef3d9b84c..84731746fa 100644 --- a/main/tests/test_string.cpp +++ b/main/tests/test_string.cpp @@ -1172,7 +1172,7 @@ MainLoop *test() { /** A character length != wchar_t may be forced, so the tests won't work */ - ERR_FAIL_COND_V(sizeof(CharType) != sizeof(wchar_t), NULL); + static_assert(sizeof(CharType) == sizeof(wchar_t)); int count = 0; int passed = 0; diff --git a/modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathLocator.cs b/modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathLocator.cs index 5965e0fbcf..77740f0e53 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathLocator.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathLocator.cs @@ -218,20 +218,29 @@ namespace GodotTools.Ides.Rider private static void CollectPathsFromRegistry(string registryKey, List<string> installPaths) { + using (var key = Registry.CurrentUser.OpenSubKey(registryKey)) + { + CollectPathsFromRegistry(installPaths, key); + } using (var key = Registry.LocalMachine.OpenSubKey(registryKey)) { - if (key == null) return; - foreach (var subkeyName in key.GetSubKeyNames().Where(a => a.Contains("Rider"))) + CollectPathsFromRegistry(installPaths, key); + } + } + + private static void CollectPathsFromRegistry(List<string> installPaths, RegistryKey key) + { + if (key == null) return; + foreach (var subkeyName in key.GetSubKeyNames().Where(a => a.Contains("Rider"))) + { + using (var subkey = key.OpenSubKey(subkeyName)) { - using (var subkey = key.OpenSubKey(subkeyName)) - { - var folderObject = subkey?.GetValue("InstallLocation"); - if (folderObject == null) continue; - var folder = folderObject.ToString(); - var possiblePath = Path.Combine(folder, @"bin\rider64.exe"); - if (File.Exists(possiblePath)) - installPaths.Add(possiblePath); - } + var folderObject = subkey?.GetValue("InstallLocation"); + if (folderObject == null) continue; + var folder = folderObject.ToString(); + var possiblePath = Path.Combine(folder, @"bin\rider64.exe"); + if (File.Exists(possiblePath)) + installPaths.Add(possiblePath); } } } diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index 299c469bf4..037f78c7af 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -982,10 +982,10 @@ Error OS_JavaScript::initialize(const VideoMode &p_desired, int p_video_driver, SET_EM_CALLBACK(GODOT_CANVAS_SELECTOR, mousedown, mouse_button_callback) SET_EM_CALLBACK(EMSCRIPTEN_EVENT_TARGET_WINDOW, mouseup, mouse_button_callback) SET_EM_CALLBACK(EMSCRIPTEN_EVENT_TARGET_WINDOW, wheel, wheel_callback) - SET_EM_CALLBACK(EMSCRIPTEN_EVENT_TARGET_WINDOW, touchstart, touch_press_callback) - SET_EM_CALLBACK(EMSCRIPTEN_EVENT_TARGET_WINDOW, touchmove, touchmove_callback) - SET_EM_CALLBACK(EMSCRIPTEN_EVENT_TARGET_WINDOW, touchend, touch_press_callback) - SET_EM_CALLBACK(EMSCRIPTEN_EVENT_TARGET_WINDOW, touchcancel, touch_press_callback) + SET_EM_CALLBACK(GODOT_CANVAS_SELECTOR, touchstart, touch_press_callback) + SET_EM_CALLBACK(GODOT_CANVAS_SELECTOR, touchmove, touchmove_callback) + SET_EM_CALLBACK(GODOT_CANVAS_SELECTOR, touchend, touch_press_callback) + SET_EM_CALLBACK(GODOT_CANVAS_SELECTOR, touchcancel, touch_press_callback) SET_EM_CALLBACK(GODOT_CANVAS_SELECTOR, keydown, keydown_callback) SET_EM_CALLBACK(GODOT_CANVAS_SELECTOR, keypress, keypress_callback) SET_EM_CALLBACK(GODOT_CANVAS_SELECTOR, keyup, keyup_callback) diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 7f4392c624..6757f60a06 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -2724,7 +2724,7 @@ Error OS_Windows::execute(const String &p_path, const List<String> &p_arguments, if (p_pipe_mutex) { p_pipe_mutex->lock(); } - (*r_pipe) += buf; + (*r_pipe) += String::utf8(buf); if (p_pipe_mutex) { p_pipe_mutex->unlock(); } diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp index 1419fb561e..a8860c3d81 100644 --- a/scene/2d/camera_2d.cpp +++ b/scene/2d/camera_2d.cpp @@ -128,9 +128,9 @@ Transform2D Camera2D::get_camera_transform() { } else { if (v_ofs < 0) { - camera_pos.y = new_camera_pos.y + screen_size.y * 0.5 * drag_margin[MARGIN_TOP] * v_ofs; - } else { camera_pos.y = new_camera_pos.y + screen_size.y * 0.5 * drag_margin[MARGIN_BOTTOM] * v_ofs; + } else { + camera_pos.y = new_camera_pos.y + screen_size.y * 0.5 * drag_margin[MARGIN_TOP] * v_ofs; } v_offset_changed = false; diff --git a/servers/arvr/arvr_positional_tracker.cpp b/servers/arvr/arvr_positional_tracker.cpp index 9acc36a139..a64e36b6a2 100644 --- a/servers/arvr/arvr_positional_tracker.cpp +++ b/servers/arvr/arvr_positional_tracker.cpp @@ -38,6 +38,7 @@ void ARVRPositionalTracker::_bind_methods() { // this class is read only from GDScript, so we only have access to getters.. ClassDB::bind_method(D_METHOD("get_type"), &ARVRPositionalTracker::get_type); + ClassDB::bind_method(D_METHOD("get_tracker_id"), &ARVRPositionalTracker::get_tracker_id); ClassDB::bind_method(D_METHOD("get_name"), &ARVRPositionalTracker::get_name); ClassDB::bind_method(D_METHOD("get_joy_id"), &ARVRPositionalTracker::get_joy_id); ClassDB::bind_method(D_METHOD("get_tracks_orientation"), &ARVRPositionalTracker::get_tracks_orientation); diff --git a/servers/visual/rasterizer_rd/rasterizer_canvas_rd.cpp b/servers/visual/rasterizer_rd/rasterizer_canvas_rd.cpp index 54f330ecdd..78fff0c381 100644 --- a/servers/visual/rasterizer_rd/rasterizer_canvas_rd.cpp +++ b/servers/visual/rasterizer_rd/rasterizer_canvas_rd.cpp @@ -2480,7 +2480,7 @@ RasterizerCanvasRD::RasterizerCanvasRD(RasterizerStorageRD *p_storage) { state.time = 0; - ERR_FAIL_COND(sizeof(PushConstant) != 128); + static_assert(sizeof(PushConstant) == 128); } bool RasterizerCanvasRD::free(RID p_rid) { |