summaryrefslogtreecommitdiffstats
path: root/scene/3d
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2023-12-18 15:46:56 +0100
committerkobewi <kobewi4e@gmail.com>2024-01-09 16:11:47 +0100
commit0e8f90f4c8b4b353d3ac372e5f00493a2f0bd136 (patch)
tree9b83683d86b94f9fdf7d6d58594d2b28d88a13ab /scene/3d
parent8297ec949bad8029372da13e1d4e36599989b5ae (diff)
downloadredot-engine-0e8f90f4c8b4b353d3ac372e5f00493a2f0bd136.tar.gz
Update deferred calls to use Callables
Diffstat (limited to 'scene/3d')
-rw-r--r--scene/3d/bone_attachment_3d.cpp2
-rw-r--r--scene/3d/navigation_region_3d.cpp3
-rw-r--r--scene/3d/node_3d.cpp5
-rw-r--r--scene/3d/skeleton_3d.cpp1
-rw-r--r--scene/3d/soft_body_3d.cpp4
5 files changed, 6 insertions, 9 deletions
diff --git a/scene/3d/bone_attachment_3d.cpp b/scene/3d/bone_attachment_3d.cpp
index 45de9b907c..5683fb7306 100644
--- a/scene/3d/bone_attachment_3d.cpp
+++ b/scene/3d/bone_attachment_3d.cpp
@@ -150,7 +150,7 @@ void BoneAttachment3D::_check_bind() {
if (bone_idx != -1) {
sk->connect(SNAME("bone_pose_changed"), callable_mp(this, &BoneAttachment3D::on_bone_pose_update));
bound = true;
- call_deferred(SNAME("on_bone_pose_update"), bone_idx);
+ callable_mp(this, &BoneAttachment3D::on_bone_pose_update).call_deferred(bone_idx);
}
}
}
diff --git a/scene/3d/navigation_region_3d.cpp b/scene/3d/navigation_region_3d.cpp
index 94c0a2279a..fa5c8f820d 100644
--- a/scene/3d/navigation_region_3d.cpp
+++ b/scene/3d/navigation_region_3d.cpp
@@ -258,7 +258,7 @@ void NavigationRegion3D::bake_navigation_mesh(bool p_on_thread) {
void NavigationRegion3D::_bake_finished(Ref<NavigationMesh> p_navigation_mesh) {
if (!Thread::is_main_thread()) {
- call_deferred(SNAME("_bake_finished"), p_navigation_mesh);
+ callable_mp(this, &NavigationRegion3D::_bake_finished).call_deferred(p_navigation_mesh);
return;
}
@@ -308,7 +308,6 @@ void NavigationRegion3D::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_travel_cost"), &NavigationRegion3D::get_travel_cost);
ClassDB::bind_method(D_METHOD("bake_navigation_mesh", "on_thread"), &NavigationRegion3D::bake_navigation_mesh, DEFVAL(true));
- ClassDB::bind_method(D_METHOD("_bake_finished", "navigation_mesh"), &NavigationRegion3D::_bake_finished);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "navigation_mesh", PROPERTY_HINT_RESOURCE_TYPE, "NavigationMesh"), "set_navigation_mesh", "get_navigation_mesh");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "enabled"), "set_enabled", "is_enabled");
diff --git a/scene/3d/node_3d.cpp b/scene/3d/node_3d.cpp
index cb8279d534..c4d1e6bef7 100644
--- a/scene/3d/node_3d.cpp
+++ b/scene/3d/node_3d.cpp
@@ -30,7 +30,6 @@
#include "node_3d.h"
-#include "core/object/message_queue.h"
#include "scene/3d/visual_instance_3d.h"
#include "scene/main/viewport.h"
#include "scene/property_utils.h"
@@ -124,7 +123,7 @@ void Node3D::_propagate_transform_changed(Node3D *p_origin) {
get_tree()->xform_change_list.add(&xform_change);
} else {
// This should very rarely happen, but if it does at least make sure the notification is received eventually.
- MessageQueue::get_singleton()->push_callable(callable_mp(this, &Node3D::_propagate_transform_changed_deferred));
+ callable_mp(this, &Node3D::_propagate_transform_changed_deferred).call_deferred();
}
}
_set_dirty_bits(DIRTY_GLOBAL_TRANSFORM);
@@ -568,7 +567,7 @@ void Node3D::update_gizmos() {
return;
}
data.gizmos_dirty = true;
- MessageQueue::get_singleton()->push_callable(callable_mp(this, &Node3D::_update_gizmos));
+ callable_mp(this, &Node3D::_update_gizmos).call_deferred();
#endif
}
diff --git a/scene/3d/skeleton_3d.cpp b/scene/3d/skeleton_3d.cpp
index 445c1003b5..ec5f8187a9 100644
--- a/scene/3d/skeleton_3d.cpp
+++ b/scene/3d/skeleton_3d.cpp
@@ -30,7 +30,6 @@
#include "skeleton_3d.h"
-#include "core/object/message_queue.h"
#include "core/variant/type_info.h"
#include "scene/3d/physics_body_3d.h"
#include "scene/resources/surface_tool.h"
diff --git a/scene/3d/soft_body_3d.cpp b/scene/3d/soft_body_3d.cpp
index db2c0e1387..3f1878f30f 100644
--- a/scene/3d/soft_body_3d.cpp
+++ b/scene/3d/soft_body_3d.cpp
@@ -416,8 +416,8 @@ void SoftBody3D::_draw_soft_mesh() {
/// Necessary in order to render the mesh correctly (Soft body nodes are in global space)
simulation_started = true;
- call_deferred(SNAME("set_as_top_level"), true);
- call_deferred(SNAME("set_transform"), Transform3D());
+ callable_mp((Node3D *)this, &Node3D::set_as_top_level).call_deferred(true);
+ callable_mp((Node3D *)this, &Node3D::set_transform).call_deferred(Transform3D());
}
_update_physics_server();