diff options
Diffstat (limited to 'modules')
9 files changed, 63 insertions, 17 deletions
diff --git a/modules/fbx/fbx_document.cpp b/modules/fbx/fbx_document.cpp index 367117edcb..1dbe4c535a 100644 --- a/modules/fbx/fbx_document.cpp +++ b/modules/fbx/fbx_document.cpp @@ -2347,7 +2347,7 @@ PackedByteArray FBXDocument::generate_buffer(Ref<GLTFState> p_state) { return PackedByteArray(); } -Error write_to_filesystem(Ref<GLTFState> p_state, const String &p_path) { +Error FBXDocument::write_to_filesystem(Ref<GLTFState> p_state, const String &p_path) { return ERR_UNAVAILABLE; } diff --git a/modules/fbx/fbx_document.h b/modules/fbx/fbx_document.h index ba48eb11ae..c9256df444 100644 --- a/modules/fbx/fbx_document.h +++ b/modules/fbx/fbx_document.h @@ -53,14 +53,13 @@ public: static String _gen_unique_name(HashSet<String> &unique_names, const String &p_name); public: - Error append_from_file(String p_path, Ref<GLTFState> p_state, uint32_t p_flags = 0, String p_base_path = String()); - Error append_from_buffer(PackedByteArray p_bytes, String p_base_path, Ref<GLTFState> p_state, uint32_t p_flags = 0); - Error append_from_scene(Node *p_node, Ref<GLTFState> p_state, uint32_t p_flags = 0); + Error append_from_file(String p_path, Ref<GLTFState> p_state, uint32_t p_flags = 0, String p_base_path = String()) override; + Error append_from_buffer(PackedByteArray p_bytes, String p_base_path, Ref<GLTFState> p_state, uint32_t p_flags = 0) override; + Error append_from_scene(Node *p_node, Ref<GLTFState> p_state, uint32_t p_flags = 0) override; -public: - Node *generate_scene(Ref<GLTFState> p_state, float p_bake_fps = 30.0f, bool p_trimming = false, bool p_remove_immutable_tracks = true); - PackedByteArray generate_buffer(Ref<GLTFState> p_state); - Error write_to_filesystem(Ref<GLTFState> p_state, const String &p_path); + Node *generate_scene(Ref<GLTFState> p_state, float p_bake_fps = 30.0f, bool p_trimming = false, bool p_remove_immutable_tracks = true) override; + PackedByteArray generate_buffer(Ref<GLTFState> p_state) override; + Error write_to_filesystem(Ref<GLTFState> p_state, const String &p_path) override; protected: static void _bind_methods(); diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 12ff22c878..854c944e14 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -2665,6 +2665,8 @@ static void _find_call_arguments(GDScriptParser::CompletionContext &p_context, c GDScriptParser::DataType base_type = p_base.type; const String quote_style = EDITOR_GET("text_editor/completion/use_single_quotes") ? "'" : "\""; + const bool use_string_names = EDITOR_GET("text_editor/completion/add_string_name_literals"); + const bool use_node_paths = EDITOR_GET("text_editor/completion/add_node_path_literals"); while (base_type.is_set() && !base_type.is_variant()) { switch (base_type.kind) { @@ -2698,8 +2700,14 @@ static void _find_call_arguments(GDScriptParser::CompletionContext &p_context, c List<String> options; obj->get_argument_options(p_method, p_argidx, &options); for (String &opt : options) { + // Handle user preference. if (opt.is_quoted()) { - opt = opt.unquote().quote(quote_style); // Handle user preference. + opt = opt.unquote().quote(quote_style); + if (use_string_names && info.arguments[p_argidx].type == Variant::STRING_NAME) { + opt = opt.indent("&"); + } else if (use_node_paths && info.arguments[p_argidx].type == Variant::NODE_PATH) { + opt = opt.indent("^"); + } } ScriptLanguage::CodeCompletionOption option(opt, ScriptLanguage::CODE_COMPLETION_KIND_FUNCTION); r_result.insert(option.display, option); diff --git a/modules/gdscript/tests/scripts/runtime/features/emit_after_await.gd b/modules/gdscript/tests/scripts/runtime/features/emit_after_await.gd new file mode 100644 index 0000000000..21fd526acc --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/emit_after_await.gd @@ -0,0 +1,12 @@ +# https://github.com/godotengine/godot/issues/89439 +extends Node + +signal my_signal + +func async_func(): + await my_signal + my_signal.emit() + +func test(): + async_func() + my_signal.emit() diff --git a/modules/gdscript/tests/scripts/runtime/features/emit_after_await.out b/modules/gdscript/tests/scripts/runtime/features/emit_after_await.out new file mode 100644 index 0000000000..d73c5eb7cd --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/emit_after_await.out @@ -0,0 +1 @@ +GDTEST_OK diff --git a/modules/gdscript/tests/scripts/runtime/features/emit_one_shot_is_non_recursive.gd b/modules/gdscript/tests/scripts/runtime/features/emit_one_shot_is_non_recursive.gd new file mode 100644 index 0000000000..5c328dcfcd --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/emit_one_shot_is_non_recursive.gd @@ -0,0 +1,22 @@ +# https://github.com/godotengine/godot/issues/89439 + +signal my_signal + +func foo(): + print("Foo") + my_signal.emit() + +func bar(): + print("Bar") + +func baz(): + print("Baz") + +func test(): + @warning_ignore("return_value_discarded") + my_signal.connect(foo, CONNECT_ONE_SHOT) + @warning_ignore("return_value_discarded") + my_signal.connect(bar, CONNECT_ONE_SHOT) + @warning_ignore("return_value_discarded") + my_signal.connect(baz) + my_signal.emit() diff --git a/modules/gdscript/tests/scripts/runtime/features/emit_one_shot_is_non_recursive.out b/modules/gdscript/tests/scripts/runtime/features/emit_one_shot_is_non_recursive.out new file mode 100644 index 0000000000..3399e08878 --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/emit_one_shot_is_non_recursive.out @@ -0,0 +1,5 @@ +GDTEST_OK +Foo +Baz +Bar +Baz diff --git a/modules/gltf/gltf_document.h b/modules/gltf/gltf_document.h index 1001b482cd..1901e89d51 100644 --- a/modules/gltf/gltf_document.h +++ b/modules/gltf/gltf_document.h @@ -311,13 +311,13 @@ private: static float get_max_component(const Color &p_color); public: - Error append_from_file(String p_path, Ref<GLTFState> p_state, uint32_t p_flags = 0, String p_base_path = String()); - Error append_from_buffer(PackedByteArray p_bytes, String p_base_path, Ref<GLTFState> p_state, uint32_t p_flags = 0); - Error append_from_scene(Node *p_node, Ref<GLTFState> p_state, uint32_t p_flags = 0); + virtual Error append_from_file(String p_path, Ref<GLTFState> p_state, uint32_t p_flags = 0, String p_base_path = String()); + virtual Error append_from_buffer(PackedByteArray p_bytes, String p_base_path, Ref<GLTFState> p_state, uint32_t p_flags = 0); + virtual Error append_from_scene(Node *p_node, Ref<GLTFState> p_state, uint32_t p_flags = 0); - Node *generate_scene(Ref<GLTFState> p_state, float p_bake_fps = 30.0f, bool p_trimming = false, bool p_remove_immutable_tracks = true); - PackedByteArray generate_buffer(Ref<GLTFState> p_state); - Error write_to_filesystem(Ref<GLTFState> p_state, const String &p_path); + virtual Node *generate_scene(Ref<GLTFState> p_state, float p_bake_fps = 30.0f, bool p_trimming = false, bool p_remove_immutable_tracks = true); + virtual PackedByteArray generate_buffer(Ref<GLTFState> p_state); + virtual Error write_to_filesystem(Ref<GLTFState> p_state, const String &p_path); public: Error _parse_gltf_state(Ref<GLTFState> p_state, const String &p_search_path); diff --git a/modules/lightmapper_rd/lightmapper_rd.cpp b/modules/lightmapper_rd/lightmapper_rd.cpp index 5d22cb1301..b6f5d6ce57 100644 --- a/modules/lightmapper_rd/lightmapper_rd.cpp +++ b/modules/lightmapper_rd/lightmapper_rd.cpp @@ -233,8 +233,7 @@ Lightmapper::BakeError LightmapperRD::_blit_meshes_into_atlas(int p_max_texture_ MeshInstance &mi = mesh_instances.write[m_i]; Size2i s = Size2i(mi.data.albedo_on_uv2->get_width(), mi.data.albedo_on_uv2->get_height()); sizes.push_back(s); - atlas_size.width = MAX(atlas_size.width, s.width + 2); - atlas_size.height = MAX(atlas_size.height, s.height + 2); + atlas_size = atlas_size.max(s + Size2i(2, 2)); } int max = nearest_power_of_2_templated(atlas_size.width); |