diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-09-20 16:20:30 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-09-20 16:20:30 +0200 |
commit | c1afb49e5ab9f94f637205564637cf5a6895f065 (patch) | |
tree | 25e924975b799b85ad4736790ab90ffd342c92d1 /core/src/ch | |
parent | 91cfff9626feaf590fc6ddc8ce81fe7ea1fcbafe (diff) | |
download | RustAndDust-c1afb49e5ab9f94f637205564637cf5a6895f065.zip RustAndDust-c1afb49e5ab9f94f637205564637cf5a6895f065.tar.gz |
Animation extends Disposable
Diffstat (limited to 'core/src/ch')
5 files changed, 13 insertions, 13 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Layer.java b/core/src/ch/asynk/tankontank/engine/Layer.java index d65f630..c0720c3 100644 --- a/core/src/ch/asynk/tankontank/engine/Layer.java +++ b/core/src/ch/asynk/tankontank/engine/Layer.java @@ -115,11 +115,11 @@ public class Layer nodes.clear(); for (int i = 0, n = animations.size(); i < n; i++) - animations.get(i).free(); + animations.get(i).dispose(); animations.clear(); for (int i = 0, n = nextAnimations.size(); i < n; i++) - nextAnimations.get(i).free(); + nextAnimations.get(i).dispose(); nextAnimations.clear(); batch.dispose(); diff --git a/core/src/ch/asynk/tankontank/engine/gfx/Animation.java b/core/src/ch/asynk/tankontank/engine/gfx/Animation.java index 6d79046..ca32857 100644 --- a/core/src/ch/asynk/tankontank/engine/gfx/Animation.java +++ b/core/src/ch/asynk/tankontank/engine/gfx/Animation.java @@ -1,10 +1,10 @@ package ch.asynk.tankontank.engine.gfx; -public interface Animation +import com.badlogic.gdx.utils.Disposable; + +public interface Animation extends Disposable { public Node getNode(); public boolean act(float delta); - - public void free(); } diff --git a/core/src/ch/asynk/tankontank/engine/gfx/animations/AnimationSequence.java b/core/src/ch/asynk/tankontank/engine/gfx/animations/AnimationSequence.java index 69a9c7a..a933ec1 100644 --- a/core/src/ch/asynk/tankontank/engine/gfx/animations/AnimationSequence.java +++ b/core/src/ch/asynk/tankontank/engine/gfx/animations/AnimationSequence.java @@ -33,12 +33,12 @@ public class AnimationSequence implements Animation, Pool.Poolable public void reset() { for (int i = 0, n = animations.size(); i < n; i++) - animations.get(i).free(); + animations.get(i).dispose(); animations.clear(); } @Override - public void free() + public void dispose() { animationSequencePool.free(this); } diff --git a/core/src/ch/asynk/tankontank/engine/gfx/animations/MoveToAnimation.java b/core/src/ch/asynk/tankontank/engine/gfx/animations/MoveToAnimation.java index d95e33a..54c3033 100644 --- a/core/src/ch/asynk/tankontank/engine/gfx/animations/MoveToAnimation.java +++ b/core/src/ch/asynk/tankontank/engine/gfx/animations/MoveToAnimation.java @@ -29,7 +29,7 @@ public class MoveToAnimation extends TimedAnimation } @Override - public void free() + public void dispose() { moveToAnimationPool.free(this); } @@ -61,14 +61,14 @@ public class MoveToAnimation extends TimedAnimation protected void end() { - free(); + dispose(); } protected void update(float percent) { if (percent == 1f) - node.setCoords(toX, toY, (int) toR); + node.setPosition(toX, toY, (int) toR); else - node.setCoords(fromX + ((toX - fromX) * percent), fromY + ((toY - fromY) * percent), (int) (fromR + ((toR - fromR) * percent))); + node.setPosition(fromX + ((toX - fromX) * percent), fromY + ((toY - fromY) * percent), (int) (fromR + ((toR - fromR) * percent))); } } diff --git a/core/src/ch/asynk/tankontank/engine/gfx/animations/RunnableAnimation.java b/core/src/ch/asynk/tankontank/engine/gfx/animations/RunnableAnimation.java index 5a4f235..bc6768c 100644 --- a/core/src/ch/asynk/tankontank/engine/gfx/animations/RunnableAnimation.java +++ b/core/src/ch/asynk/tankontank/engine/gfx/animations/RunnableAnimation.java @@ -31,7 +31,7 @@ public class RunnableAnimation implements Animation, Pool.Poolable } @Override - public void free() + public void dispose() { runnableAnimationPool.free(this); } @@ -50,7 +50,7 @@ public class RunnableAnimation implements Animation, Pool.Poolable runnable.run(); runnable = null; ran = true; - free(); + dispose(); return true; } |