From 40a3e878f79fe0b645796fdfabb99a9006051eee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sat, 4 Oct 2014 15:38:42 +0200 Subject: Tile: implements Disposable --- core/src/ch/asynk/tankontank/engine/Tile.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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; -- cgit v1.1-2-g2b99