diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-02-21 18:28:45 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-02-28 14:24:09 +0100 |
commit | 01afc442c73661df677c2b93f4037a21992ee45b (patch) | |
tree | 9a5b0b68cb022873ba31929fe6a785ddf5c0555c /scene/animation/animation_cache.cpp | |
parent | a439131c2b06b3d452e5be13530b6d2caa72c1aa (diff) |
Signals: Port connect calls to use callable_mp
Remove now unnecessary bindings of signal callbacks in the public API.
There might be some false positives that need rebinding if they were
meant to be public.
No regular expressions were harmed in the making of this commit.
(Nah, just kidding.)
Diffstat (limited to 'scene/animation/animation_cache.cpp')
-rw-r--r-- | scene/animation/animation_cache.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/scene/animation/animation_cache.cpp b/scene/animation/animation_cache.cpp index 16b6813bbe..9ed8155bdc 100644 --- a/scene/animation/animation_cache.cpp +++ b/scene/animation/animation_cache.cpp @@ -56,7 +56,7 @@ void AnimationCache::_clear_cache() { while (connected_nodes.size()) { - connected_nodes.front()->get()->disconnect_compat("tree_exiting", this, "_node_exit_tree"); + connected_nodes.front()->get()->disconnect("tree_exiting", callable_mp(this, &AnimationCache::_node_exit_tree)); connected_nodes.erase(connected_nodes.front()); } path_cache.clear(); @@ -174,7 +174,7 @@ void AnimationCache::_update_cache() { if (!connected_nodes.has(path.node)) { connected_nodes.insert(path.node); - path.node->connect_compat("tree_exiting", this, "_node_exit_tree", Node::make_binds(path.node), CONNECT_ONESHOT); + path.node->connect("tree_exiting", callable_mp(this, &AnimationCache::_node_exit_tree), Node::make_binds(path.node), CONNECT_ONESHOT); } } @@ -313,18 +313,15 @@ void AnimationCache::set_animation(const Ref<Animation> &p_animation) { _clear_cache(); if (animation.is_valid()) - animation->disconnect_compat("changed", this, "_animation_changed"); + animation->disconnect("changed", callable_mp(this, &AnimationCache::_animation_changed)); animation = p_animation; if (animation.is_valid()) - animation->connect_compat("changed", this, "_animation_changed"); + animation->connect("changed", callable_mp(this, &AnimationCache::_animation_changed)); } void AnimationCache::_bind_methods() { - - ClassDB::bind_method(D_METHOD("_node_exit_tree"), &AnimationCache::_node_exit_tree); - ClassDB::bind_method(D_METHOD("_animation_changed"), &AnimationCache::_animation_changed); } void AnimationCache::set_root(Node *p_root) { |