summaryrefslogtreecommitdiffstats
path: root/core/src/ch
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/ch')
-rw-r--r--core/src/ch/asynk/tankontank/game/battles/Factory.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/game/battles/Factory.java b/core/src/ch/asynk/tankontank/game/battles/Factory.java
index fc3f2cb..5a594d3 100644
--- a/core/src/ch/asynk/tankontank/game/battles/Factory.java
+++ b/core/src/ch/asynk/tankontank/game/battles/Factory.java
@@ -34,6 +34,7 @@ public class Factory implements Board.TileBuilder, Disposable
FAKE
}
+ public boolean assetsLoaded;
public TextureAtlas hudAtlas;
public TextureAtlas pawnsAtlas;
public TextureAtlas pawnOverlaysAtlas;
@@ -44,6 +45,7 @@ public class Factory implements Board.TileBuilder, Disposable
public Factory(final TankOnTank game)
{
this.game = game;
+ this.assetsLoaded = false;
battles = new Battle[] {
new BattleHeadToHead(this),
new BattleFrontalAssault(this),
@@ -57,15 +59,18 @@ public class Factory implements Board.TileBuilder, Disposable
public void assetsLoaded()
{
+ if (assetsLoaded) return;
this.hudAtlas = game.manager.get("data/hud.atlas", TextureAtlas.class);
this.pawnsAtlas = game.manager.get("data/units.atlas", TextureAtlas.class);
this.pawnOverlaysAtlas = game.manager.get("data/unit-overlays.atlas", TextureAtlas.class);
this.tileOverlaysAtlas = game.manager.get("data/hex-overlays.atlas", TextureAtlas.class);
+ this.assetsLoaded = false;
}
@Override
public void dispose()
{
+ if (!assetsLoaded) return;
hudAtlas.dispose();
pawnsAtlas.dispose();
pawnOverlaysAtlas.dispose();