1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

[Animation] Improvements to Tween memory management

Using `ObjectID` instead of manually breaking reference cycles.
This commit is contained in:
A Thousand Ships
2024-02-26 10:29:37 +01:00
parent 81f3d43cc1
commit 92814bafb7
2 changed files with 18 additions and 18 deletions

View File

@@ -39,16 +39,18 @@ class Node;
class Tweener : public RefCounted {
GDCLASS(Tweener, RefCounted);
ObjectID tween_id;
public:
virtual void set_tween(const Ref<Tween> &p_tween);
virtual void start() = 0;
virtual bool step(double &r_delta) = 0;
void clear_tween();
protected:
static void _bind_methods();
Ref<Tween> tween;
Ref<Tween> _get_tween();
double elapsed_time = 0;
bool finished = false;
};
@@ -291,7 +293,6 @@ private:
Tween::TransitionType trans_type = Tween::TRANS_MAX;
Tween::EaseType ease_type = Tween::EASE_MAX;
Ref<Tween> tween;
Variant initial_val;
Variant delta_val;
Variant final_val;