summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/src/ch/asynk/tankontank/engine/Board.java22
1 files changed, 16 insertions, 6 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Board.java b/core/src/ch/asynk/tankontank/engine/Board.java
index f1f5ca0..14f670f 100644
--- a/core/src/ch/asynk/tankontank/engine/Board.java
+++ b/core/src/ch/asynk/tankontank/engine/Board.java
@@ -81,6 +81,22 @@ public abstract class Board implements Disposable
{
}
+ @Override
+ public void dispose()
+ {
+ image.dispose();
+ for (int i = 0; i < (cfg.cols * cfg.rows); i++)
+ tiles[i].dispose();
+ tilesToDraw.clear();
+ pawnsToDraw.clear();
+ for (int i = 0, n = nextAnimations.size(); i < n; i++)
+ nextAnimations.get(i).dispose();
+ animations.clear();
+ for (int i = 0, n = animations.size(); i < n; i++)
+ animations.get(i).dispose();
+ animations.clear();
+ }
+
public Board(TileBuilder tileBuilder, Config cfg, Texture texture)
{
image = new Image(texture);
@@ -104,12 +120,6 @@ public abstract class Board implements Disposable
}
}
- @Override
- public void dispose()
- {
- image.dispose();
- }
-
public Tile getTile(GridPoint2 coords)
{
return getTile(coords.x, coords.y);