diff options
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Tile.java | 11 |
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; |