summaryrefslogtreecommitdiffstats
path: root/core/src
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-02-08 23:41:44 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-02-08 23:41:44 +0100
commit88a0900bc5486da860580a108c2d13519573e85a (patch)
treef63ef03e79cd1f02b4f2000742a048334c8e84bb /core/src
parent9865592546a0dc191f6669a50c63fc36ac6d6127 (diff)
downloadRustAndDust-88a0900bc5486da860580a108c2d13519573e85a.zip
RustAndDust-88a0900bc5486da860580a108c2d13519573e85a.tar.gz
Support 2 sets of pawns depending of Config.graphics
Diffstat (limited to 'core/src')
-rw-r--r--core/src/ch/asynk/tankontank/TankOnTank.java24
-rw-r--r--core/src/ch/asynk/tankontank/game/battles/Factory.java22
2 files changed, 33 insertions, 13 deletions
diff --git a/core/src/ch/asynk/tankontank/TankOnTank.java b/core/src/ch/asynk/tankontank/TankOnTank.java
index ac3e5ce..40e4240 100644
--- a/core/src/ch/asynk/tankontank/TankOnTank.java
+++ b/core/src/ch/asynk/tankontank/TankOnTank.java
@@ -87,10 +87,18 @@ public class TankOnTank extends Game
manager.load("data/map_a.png", Texture.class);
if (config.battle.getMapType() == Factory.MapType.MAP_B)
manager.load("data/map_b.png", Texture.class);
+ switch (config.graphics) {
+ case MINE:
+ manager.load("data/units0.atlas", TextureAtlas.class);
+ manager.load("data/unit-overlays0.atlas", TextureAtlas.class);
+ break;
+ case ORIGINAL:
+ manager.load("data/units1.atlas", TextureAtlas.class);
+ manager.load("data/unit-overlays1.atlas", TextureAtlas.class);
+ break;
+ }
manager.load("data/hex.png", Texture.class);
manager.load("data/hud.atlas", TextureAtlas.class);
- manager.load("data/units.atlas", TextureAtlas.class);
- manager.load("data/unit-overlays.atlas", TextureAtlas.class);
manager.load("data/hex-overlays.atlas", TextureAtlas.class);
manager.load("data/dice.png", Texture.class);
manager.load("data/infantry_fire.png", Texture.class);
@@ -115,10 +123,18 @@ public class TankOnTank extends Game
manager.unload("data/map_a.png");
if (config.battle.getMapType() == Factory.MapType.MAP_B)
manager.unload("data/map_b.png");
+ switch (config.graphics) {
+ case MINE:
+ manager.unload("data/units0.atlas");
+ manager.unload("data/unit-overlays0.atlas");
+ break;
+ case ORIGINAL:
+ manager.unload("data/units1.atlas");
+ manager.unload("data/unit-overlays1.atlas");
+ break;
+ }
manager.unload("data/hex.png");
manager.unload("data/hud.atlas");
- manager.unload("data/units.atlas");
- manager.unload("data/unit-overlays.atlas");
manager.unload("data/hex-overlays.atlas");
manager.unload("data/dice.png");
manager.unload("data/infantry_fire.png");
diff --git a/core/src/ch/asynk/tankontank/game/battles/Factory.java b/core/src/ch/asynk/tankontank/game/battles/Factory.java
index db81537..57328ad 100644
--- a/core/src/ch/asynk/tankontank/game/battles/Factory.java
+++ b/core/src/ch/asynk/tankontank/game/battles/Factory.java
@@ -61,9 +61,17 @@ public class Factory implements Board.TileBuilder, Disposable
{
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);
+ switch (game.config.graphics) {
+ case MINE:
+ this.pawnsAtlas = game.manager.get("data/units0.atlas", TextureAtlas.class);
+ this.pawnOverlaysAtlas = game.manager.get("data/unit-overlays0.atlas", TextureAtlas.class);
+ break;
+ case ORIGINAL:
+ this.pawnsAtlas = game.manager.get("data/units1.atlas", TextureAtlas.class);
+ this.pawnOverlaysAtlas = game.manager.get("data/unit-overlays1.atlas", TextureAtlas.class);
+ break;
+ }
this.assetsLoaded = true;
}
@@ -122,7 +130,6 @@ public class Factory implements Board.TileBuilder, Disposable
public Unit getUnit(UnitId id)
{
- boolean regular = game.config.regularPawns;
Unit u = null;
UnitType ut = UnitType.HARD_TARGET;
UnitType utHq = UnitType.HARD_TARGET_HQ;
@@ -142,7 +149,7 @@ public class Factory implements Board.TileBuilder, Disposable
u = new Unit(Army.GE, id, ut, 2, 9, 2, "ge-panzer-iv", "ge-head", pawnsAtlas, pawnOverlaysAtlas);
break;
case GE_PANZER_IV_HQ:
- u = new Unit(Army.GE, id, utHq, 2, 9, 2, "ge-panzer-iv-hq", "ge-head", pawnsAtlas, pawnOverlaysAtlas);
+ u = new Unit(Army.GE, id, utHq, 2, 9, 2, "ge-panzer-iv", "ge-head", pawnsAtlas, pawnOverlaysAtlas);
break;
case GE_TIGER:
u = new Unit(Army.GE, id, ut, 3, 11, 1, "ge-tiger", "ge-head", pawnsAtlas, pawnOverlaysAtlas);
@@ -163,20 +170,17 @@ public class Factory implements Board.TileBuilder, Disposable
u = new Unit(Army.US, id, ut, 3, 10, 2, "us-pershing", "us-head", pawnsAtlas, pawnOverlaysAtlas);
break;
case US_PERSHING_HQ:
- u = new Unit(Army.US, id, utHq, 3, 10, 2, "us-pershing-hq", "us-head", pawnsAtlas, pawnOverlaysAtlas);
+ u = new Unit(Army.US, id, utHq, 3, 10, 2, "us-pershing", "us-head", pawnsAtlas, pawnOverlaysAtlas);
break;
case US_PRIEST:
ut = UnitType.ARTILLERY;
u = new Unit(Army.US, id, ut, 5, 8, 1, "us-priest", "us-head", pawnsAtlas, pawnOverlaysAtlas);
break;
case US_SHERMAN:
- if (regular)
u = new Unit(Army.US, id, ut, 2, 9, 2, "us-sherman", "us-head", pawnsAtlas, pawnOverlaysAtlas);
- else
- u = new Unit(Army.US, id, ut, 2, 9, 2, "us-sherman-values", "us-sherman-head", pawnsAtlas, pawnOverlaysAtlas);
break;
case US_SHERMAN_HQ:
- u = new Unit(Army.US, id, utHq, 2, 9, 2, "us-sherman-hq", "us-head", pawnsAtlas, pawnOverlaysAtlas);
+ u = new Unit(Army.US, id, utHq, 2, 9, 2, "us-sherman", "us-head", pawnsAtlas, pawnOverlaysAtlas);
break;
case US_WOLVERINE:
u = new Unit(Army.US, id, ut, 3, 8, 3, "us-wolverine", "us-head", pawnsAtlas, pawnOverlaysAtlas);