summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-09-21 17:31:34 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-09-21 17:31:34 +0200
commit77f33564ba4ca8d6a4e5de32ba813b22053724f3 (patch)
treec20db55f15aad168c65f6bd1b19a7f3be147a9fb /core/src/ch/asynk
parent6bd0aacc67c386b8c2baa31e120b6ae178b9861d (diff)
downloadRustAndDust-77f33564ba4ca8d6a4e5de32ba813b22053724f3.zip
RustAndDust-77f33564ba4ca8d6a4e5de32ba813b22053724f3.tar.gz
GameScreen: dispose ShapeRenderer and SpriteBatch
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r--core/src/ch/asynk/tankontank/screens/GameScreen.java12
1 files 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