summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-10-04 15:38:42 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-10-04 15:38:42 +0200
commit40a3e878f79fe0b645796fdfabb99a9006051eee (patch)
tree2523da48687553fe177022d521c675b07fc6f9c3
parentc5d03a7bc3ec6b23c23d7920485bb222f11903ab (diff)
downloadRustAndDust-40a3e878f79fe0b645796fdfabb99a9006051eee.zip
RustAndDust-40a3e878f79fe0b645796fdfabb99a9006051eee.tar.gz
Tile: implements Disposable
-rw-r--r--core/src/ch/asynk/tankontank/engine/Tile.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Tile.java b/core/src/ch/asynk/tankontank/engine/Tile.java
index 3495ada..b47548c 100644
--- a/core/src/ch/asynk/tankontank/engine/Tile.java
+++ b/core/src/ch/asynk/tankontank/engine/Tile.java
@@ -3,6 +3,8 @@ package ch.asynk.tankontank.engine;
import java.util.Iterator;
import java.util.ArrayDeque;
+import com.badlogic.gdx.utils.Disposable;
+
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
@@ -11,7 +13,7 @@ import com.badlogic.gdx.math.Vector2;
import ch.asynk.tankontank.engine.gfx.Drawable;
import ch.asynk.tankontank.engine.gfx.StackedImages;
-public abstract class Tile implements Drawable
+public abstract class Tile implements Drawable, Disposable
{
private Vector2 center;
private StackedImages overlays;
@@ -35,6 +37,13 @@ public abstract class Tile implements Drawable
this.overlays.centerOn(x, y);
}
+ @Override
+ public void dispose()
+ {
+ if(stack != null) stack.clear();
+ overlays.dispose();
+ }
+
public Vector2 getCenter()
{
return center;