summaryrefslogtreecommitdiff
path: root/scene/main
diff options
context:
space:
mode:
Diffstat (limited to 'scene/main')
-rw-r--r--scene/main/missing_node.cpp4
-rw-r--r--scene/main/missing_node.h2
-rw-r--r--scene/main/scene_tree.cpp12
-rw-r--r--scene/main/shader_globals_override.cpp20
4 files changed, 17 insertions, 21 deletions
diff --git a/scene/main/missing_node.cpp b/scene/main/missing_node.cpp
index 6daa9dec6b..395fdad9e4 100644
--- a/scene/main/missing_node.cpp
+++ b/scene/main/missing_node.cpp
@@ -53,8 +53,8 @@ bool MissingNode::_get(const StringName &p_name, Variant &r_ret) const {
}
void MissingNode::_get_property_list(List<PropertyInfo> *p_list) const {
- for (OrderedHashMap<StringName, Variant>::ConstElement E = properties.front(); E; E = E.next()) {
- p_list->push_back(PropertyInfo(E.value().get_type(), E.key()));
+ for (const KeyValue<StringName, Variant> &E : properties) {
+ p_list->push_back(PropertyInfo(E.value.get_type(), E.key));
}
}
diff --git a/scene/main/missing_node.h b/scene/main/missing_node.h
index b0f9492456..d200fbb47f 100644
--- a/scene/main/missing_node.h
+++ b/scene/main/missing_node.h
@@ -36,7 +36,7 @@
class MissingNode : public Node {
GDCLASS(MissingNode, Node)
- OrderedHashMap<StringName, Variant> properties;
+ HashMap<StringName, Variant> properties;
String original_class;
bool recording_properties = false;
diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp
index 9d80b3cc0f..baa0362f63 100644
--- a/scene/main/scene_tree.cpp
+++ b/scene/main/scene_tree.cpp
@@ -438,9 +438,8 @@ bool SceneTree::process(double p_time) {
if (multiplayer_poll) {
multiplayer->poll();
- const NodePath *rpath = nullptr;
- while ((rpath = custom_multiplayers.next(rpath))) {
- custom_multiplayers[*rpath]->poll();
+ for (KeyValue<NodePath, Ref<MultiplayerAPI>> &E : custom_multiplayers) {
+ E.value->poll();
}
}
@@ -1137,9 +1136,8 @@ Array SceneTree::get_processed_tweens() {
Ref<MultiplayerAPI> SceneTree::get_multiplayer(const NodePath &p_for_path) const {
Ref<MultiplayerAPI> out = multiplayer;
- const NodePath *spath = nullptr;
- while ((spath = custom_multiplayers.next(spath))) {
- const Vector<StringName> snames = (*spath).get_names();
+ for (const KeyValue<NodePath, Ref<MultiplayerAPI>> &E : custom_multiplayers) {
+ const Vector<StringName> snames = E.key.get_names();
const Vector<StringName> tnames = p_for_path.get_names();
if (tnames.size() < snames.size()) {
continue;
@@ -1154,7 +1152,7 @@ Ref<MultiplayerAPI> SceneTree::get_multiplayer(const NodePath &p_for_path) const
}
}
if (valid) {
- out = custom_multiplayers[*spath];
+ out = E.value;
break;
}
}
diff --git a/scene/main/shader_globals_override.cpp b/scene/main/shader_globals_override.cpp
index ed08c45a01..0049359cad 100644
--- a/scene/main/shader_globals_override.cpp
+++ b/scene/main/shader_globals_override.cpp
@@ -229,20 +229,19 @@ void ShaderGlobalsOverride::_activate() {
active = true;
add_to_group(SceneStringNames::get_singleton()->shader_overrides_group_active);
- const StringName *K = nullptr;
- while ((K = overrides.next(K))) {
- Override *o = overrides.getptr(*K);
+ for (const KeyValue<StringName, Override> &E : overrides) {
+ const Override *o = &E.value;
if (o->in_use && o->override.get_type() != Variant::NIL) {
if (o->override.get_type() == Variant::OBJECT) {
RID tex_rid = o->override;
- RS::get_singleton()->global_variable_set_override(*K, tex_rid);
+ RS::get_singleton()->global_variable_set_override(E.key, tex_rid);
} else {
- RS::get_singleton()->global_variable_set_override(*K, o->override);
+ RS::get_singleton()->global_variable_set_override(E.key, o->override);
}
}
- }
- update_configuration_warnings(); //may have activated
+ update_configuration_warnings(); //may have activated
+ }
}
}
@@ -256,11 +255,10 @@ void ShaderGlobalsOverride::_notification(int p_what) {
case Node3D::NOTIFICATION_EXIT_TREE: {
if (active) {
//remove overrides
- const StringName *K = nullptr;
- while ((K = overrides.next(K))) {
- Override *o = overrides.getptr(*K);
+ for (const KeyValue<StringName, Override> &E : overrides) {
+ const Override *o = &E.value;
if (o->in_use) {
- RS::get_singleton()->global_variable_set_override(*K, Variant());
+ RS::get_singleton()->global_variable_set_override(E.key, Variant());
}
}
}