From 77f33564ba4ca8d6a4e5de32ba813b22053724f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sun, 21 Sep 2014 17:31:34 +0200 Subject: GameScreen: dispose ShapeRenderer and SpriteBatch --- core/src/ch/asynk/tankontank/screens/GameScreen.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/core/src/ch/asynk/tankontank/screens/GameScreen.java b/core/src/ch/asynk/tankontank/screens/GameScreen.java index c88cbaf..6204446 100644 --- a/core/src/ch/asynk/tankontank/screens/GameScreen.java +++ b/core/src/ch/asynk/tankontank/screens/GameScreen.java @@ -44,9 +44,10 @@ public class GameScreen implements Screen private final TankOnTank game; private float maxZoomOut; - final SpriteBatch mapBatch; - final OrthographicCamera cam; - final FitViewport mapViewport; + private final SpriteBatch mapBatch; + private final OrthographicCamera cam; + private final FitViewport mapViewport; + private final ShapeRenderer debugShapes; private Map map; private Label fps; @@ -76,6 +77,8 @@ public class GameScreen implements Screen mapViewport = new FitViewport(map.getWidth(), map.getHeight(), cam); mapViewport.update(Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), true); + debugShapes = new ShapeRenderer(); + Pawn.Orientation o = Pawn.Orientation.EAST; addUnit(1, 7, o, UnitType.GE_AT_GUN); addUnit(1, 6, o, UnitType.GE_INFANTRY); @@ -202,7 +205,6 @@ public class GameScreen implements Screen if (true) { Gdx.gl.glEnable(GL20.GL_BLEND); - ShapeRenderer debugShapes = new ShapeRenderer(); debugShapes.setAutoShapeType(true); debugShapes.setProjectionMatrix(cam.combined); debugShapes.begin(); @@ -230,6 +232,8 @@ public class GameScreen implements Screen map.dispose(); GameFactory.dispose(); game.unloadAssets(); + mapBatch.dispose(); + debugShapes.dispose(); } @Override -- cgit v1.1-2-g2b99