diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-31 22:51:20 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-31 22:51:20 +0100 |
commit | bb042480e91388ebff166efb9b609c5a1e86af87 (patch) | |
tree | 5fd235f2cf13acac5e1fa7d05cd153e76dffb23e /core/src/ch/asynk | |
parent | d6a77e6139d40f2a10a20954c7516b55fc90af46 (diff) | |
download | RustAndDust-bb042480e91388ebff166efb9b609c5a1e86af87.zip RustAndDust-bb042480e91388ebff166efb9b609c5a1e86af87.tar.gz |
Borad,Pawn: getRotateAnimation(float, ...) do not need Vector3 Pool anymore
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Board.java | 16 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Pawn.java | 4 |
2 files changed, 3 insertions, 17 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Board.java b/core/src/ch/asynk/tankontank/engine/Board.java index 0b9c39e..6707b21 100644 --- a/core/src/ch/asynk/tankontank/engine/Board.java +++ b/core/src/ch/asynk/tankontank/engine/Board.java @@ -13,9 +13,6 @@ import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.glutils.ShapeRenderer; -import com.badlogic.gdx.utils.Pool; -import com.badlogic.gdx.math.Vector2; -import com.badlogic.gdx.math.Vector3; import com.badlogic.gdx.math.Matrix4; import ch.asynk.tankontank.engine.gfx.Image; @@ -60,13 +57,6 @@ public abstract class Board implements Disposable public float slope; // north-west side slope : (dh / (float) dw) } - private final Pool<Vector3> vector3Pool = new Pool<Vector3>() { - @Override - protected Vector3 newObject() { - return new Vector3(); - } - }; - private Config cfg; private Tile[] tiles; private SearchBoard searchBoard; @@ -391,13 +381,9 @@ public abstract class Board implements Disposable protected void rotatePawn(final Pawn pawn, Orientation o, RunnableAnimation whenDone) { - Vector3 p = pawn.getPosition(); - Vector3 v = vector3Pool.obtain(); - v.set(p.x, p.y, o.r()); - AnimationSequence seq = pawn.getRotateAnimation(v, 1); + AnimationSequence seq = pawn.getRotateAnimation(o.r(), 1); seq.addAnimation(whenDone); addAnimation(seq); - vector3Pool.free(v); pawn.rotate(o); } diff --git a/core/src/ch/asynk/tankontank/engine/Pawn.java b/core/src/ch/asynk/tankontank/engine/Pawn.java index 38510e2..9bab3be 100644 --- a/core/src/ch/asynk/tankontank/engine/Pawn.java +++ b/core/src/ch/asynk/tankontank/engine/Pawn.java @@ -236,11 +236,11 @@ public abstract class Pawn implements Moveable, Disposable return hasOverlayEnabled(); } - public AnimationSequence getRotateAnimation(Vector3 v, int size) + public AnimationSequence getRotateAnimation(float z, int size) { prevPosition.set(position); AnimationSequence seq = AnimationSequence.get(1 + size); - seq.addAnimation(MoveToAnimation.get(this, v, MOVE_TIME)); + seq.addAnimation(MoveToAnimation.get(this, position.x, position.y, z, MOVE_TIME)); return seq; } |