summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2023-06-27 23:02:02 +0200
committerGitHub <noreply@github.com>2023-06-27 23:02:02 +0200
commit16508ead86c13051a1a701a64a63325cd647db53 (patch)
tree29d1f990c62225992efa69267dbfe89762c2d818
parent5e2f03fc99df0c5d1de59b8713953e8b5644688c (diff)
parent70ca65914345971dccb80e8b68846f38c2739769 (diff)
downloadredot-engine-16508ead86c13051a1a701a64a63325cd647db53.tar.gz
Merge pull request #78745 from RandomShaper/fix_node_pr
Fix node processing order
-rw-r--r--scene/main/node.cpp14
-rw-r--r--scene/main/scene_tree.cpp12
2 files changed, 14 insertions, 12 deletions
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index 515bd60cca..9ebd8f00a8 100644
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -933,9 +933,11 @@ void Node::set_process_thread_group_order(int p_order) {
if (data.process_thread_group_order == p_order) {
return;
}
- // Make sure we are in SceneTree and an actual process owner
+
+ data.process_thread_group_order = p_order;
+
+ // Not yet in the tree (or not a group owner, in whose case this is pointless but harmless); trivial update.
if (!is_inside_tree() || data.process_thread_group_owner != this) {
- data.process_thread_group_order = p_order;
return;
}
@@ -951,8 +953,8 @@ void Node::set_process_priority(int p_priority) {
if (data.process_priority == p_priority) {
return;
}
- // Make sure we are in SceneTree and an actual process owner
if (!is_inside_tree()) {
+ // Not yet in the tree; trivial update.
data.process_priority = p_priority;
return;
}
@@ -973,8 +975,8 @@ void Node::set_physics_process_priority(int p_priority) {
if (data.physics_process_priority == p_priority) {
return;
}
- // Make sure we are in SceneTree and an actual physics_process owner
if (!is_inside_tree()) {
+ // Not yet in the tree; trivial update.
data.physics_process_priority = p_priority;
return;
}
@@ -997,11 +999,11 @@ void Node::set_process_thread_group(ProcessThreadGroup p_mode) {
}
if (!is_inside_tree()) {
+ // Not yet in the tree; trivial update.
data.process_thread_group = p_mode;
return;
}
- // Mode changed, must update everything.
_remove_tree_from_process_thread_group();
if (data.process_thread_group != PROCESS_THREAD_GROUP_INHERIT) {
_remove_process_group();
@@ -1031,7 +1033,7 @@ Node::ProcessThreadGroup Node::get_process_thread_group() const {
void Node::set_process_thread_messages(BitField<ProcessThreadMessages> p_flags) {
ERR_THREAD_GUARD
- if (data.process_thread_group_order == p_flags) {
+ if (data.process_thread_messages == p_flags) {
return;
}
diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp
index 481ed14707..9a7f34d277 100644
--- a/scene/main/scene_tree.cpp
+++ b/scene/main/scene_tree.cpp
@@ -932,19 +932,19 @@ void SceneTree::_process_group(ProcessGroup *p_group, bool p_physics) {
}
if (p_physics) {
- if (n->is_physics_processing()) {
- n->notification(Node::NOTIFICATION_PHYSICS_PROCESS);
- }
if (n->is_physics_processing_internal()) {
n->notification(Node::NOTIFICATION_INTERNAL_PHYSICS_PROCESS);
}
- } else {
- if (n->is_processing()) {
- n->notification(Node::NOTIFICATION_PROCESS);
+ if (n->is_physics_processing()) {
+ n->notification(Node::NOTIFICATION_PHYSICS_PROCESS);
}
+ } else {
if (n->is_processing_internal()) {
n->notification(Node::NOTIFICATION_INTERNAL_PROCESS);
}
+ if (n->is_processing()) {
+ n->notification(Node::NOTIFICATION_PROCESS);
+ }
}
}