diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-04 15:38:42 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-04 15:38:42 +0200 |
commit | 40a3e878f79fe0b645796fdfabb99a9006051eee (patch) | |
tree | 2523da48687553fe177022d521c675b07fc6f9c3 /core/src | |
parent | c5d03a7bc3ec6b23c23d7920485bb222f11903ab (diff) | |
download | RustAndDust-40a3e878f79fe0b645796fdfabb99a9006051eee.zip RustAndDust-40a3e878f79fe0b645796fdfabb99a9006051eee.tar.gz |
Tile: implements Disposable
Diffstat (limited to 'core/src')
-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; |