summaryrefslogtreecommitdiffstats
path: root/core/src/ch
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/ch')
-rw-r--r--core/src/ch/asynk/tankontank/engine/Board.java16
-rw-r--r--core/src/ch/asynk/tankontank/engine/Pawn.java4
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;
}