You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Use AHashMap for RBMap nodes and HashMap input_activity
This commit is contained in:
@@ -409,7 +409,7 @@ class AnimationNodeBlendTree : public AnimationRootNode {
|
||||
Vector<StringName> connections;
|
||||
};
|
||||
|
||||
RBMap<StringName, Node, StringName::AlphCompare> nodes;
|
||||
AHashMap<StringName, Node> nodes;
|
||||
|
||||
Vector2 graph_offset;
|
||||
|
||||
|
||||
@@ -774,7 +774,7 @@ void AnimationTree::_update_properties_for_node(const String &p_base_path, Ref<A
|
||||
activity.push_back(a);
|
||||
}
|
||||
input_activity_map[p_base_path] = activity;
|
||||
input_activity_map_get[String(p_base_path).substr(0, String(p_base_path).length() - 1)] = &input_activity_map[p_base_path];
|
||||
input_activity_map_get[String(p_base_path).substr(0, String(p_base_path).length() - 1)] = input_activity_map.get_index(p_base_path);
|
||||
}
|
||||
|
||||
List<PropertyInfo> plist;
|
||||
@@ -961,17 +961,15 @@ real_t AnimationTree::get_connection_activity(const StringName &p_path, int p_co
|
||||
if (!input_activity_map_get.has(p_path)) {
|
||||
return 0;
|
||||
}
|
||||
const LocalVector<Activity> *activity = input_activity_map_get[p_path];
|
||||
|
||||
if (!activity || p_connection < 0 || p_connection >= (int64_t)activity->size()) {
|
||||
int index = input_activity_map_get[p_path];
|
||||
const LocalVector<Activity> &activity = input_activity_map.get_by_index(index).value;
|
||||
|
||||
if (p_connection < 0 || p_connection >= (int64_t)activity.size() || activity[p_connection].last_pass != process_pass) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((*activity)[p_connection].last_pass != process_pass) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return (*activity)[p_connection].activity;
|
||||
return activity[p_connection].activity;
|
||||
}
|
||||
|
||||
void AnimationTree::_bind_methods() {
|
||||
|
||||
@@ -305,8 +305,8 @@ private:
|
||||
uint64_t last_pass = 0;
|
||||
real_t activity = 0.0;
|
||||
};
|
||||
mutable HashMap<StringName, LocalVector<Activity>> input_activity_map;
|
||||
mutable HashMap<StringName, LocalVector<Activity> *> input_activity_map_get;
|
||||
mutable AHashMap<StringName, LocalVector<Activity>> input_activity_map;
|
||||
mutable AHashMap<StringName, int> input_activity_map_get;
|
||||
|
||||
NodePath animation_player;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user