diff options
Diffstat (limited to 'core/src/ch/asynk/rustanddust/engine')
3 files changed, 10 insertions, 9 deletions
diff --git a/core/src/ch/asynk/rustanddust/engine/HeadedPawn.java b/core/src/ch/asynk/rustanddust/engine/HeadedPawn.java index f60e38e..073f227 100644 --- a/core/src/ch/asynk/rustanddust/engine/HeadedPawn.java +++ b/core/src/ch/asynk/rustanddust/engine/HeadedPawn.java @@ -3,7 +3,7 @@ package ch.asynk.rustanddust.engine; import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.Sprite; import com.badlogic.gdx.graphics.g2d.TextureAtlas; -import com.badlogic.gdx.graphics.g2d.TextureRegion; +import com.badlogic.gdx.graphics.g2d.TextureAtlas.AtlasRegion; import com.badlogic.gdx.graphics.glutils.ShapeRenderer; import com.badlogic.gdx.math.Vector3; @@ -19,10 +19,10 @@ public abstract class HeadedPawn extends Pawn this.orientation = Orientation.KEEP; } - public HeadedPawn(Faction faction, String pawn, String head, TextureAtlas pawns, TextureAtlas overlays) + public HeadedPawn(Faction faction, AtlasRegion body, AtlasRegion head, TextureAtlas overlays) { - super(faction, pawn, pawns, overlays); - this.head = new Sprite(pawns.findRegion(head)); + super(faction, body, overlays); + this.head = new Sprite(head); this.orientation = Orientation.KEEP; this.descr += " " + orientation; } diff --git a/core/src/ch/asynk/rustanddust/engine/Pawn.java b/core/src/ch/asynk/rustanddust/engine/Pawn.java index 43de4f4..ce5fb58 100644 --- a/core/src/ch/asynk/rustanddust/engine/Pawn.java +++ b/core/src/ch/asynk/rustanddust/engine/Pawn.java @@ -7,6 +7,7 @@ import com.badlogic.gdx.utils.Disposable; import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.Sprite; import com.badlogic.gdx.graphics.g2d.TextureAtlas; +import com.badlogic.gdx.graphics.g2d.TextureAtlas.AtlasRegion; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.graphics.glutils.ShapeRenderer; @@ -78,12 +79,12 @@ public abstract class Pawn implements Moveable, Disposable this.attack = new Attack(this); } - public Pawn(Faction faction, String name, TextureAtlas pawns, TextureAtlas overlays) + public Pawn(Faction faction, AtlasRegion body, TextureAtlas overlays) { this(); this.faction = faction; this.descr = descr; - this.sprite = new Sprite(pawns.findRegion(name)); + this.sprite = new Sprite(body); this.overlays = new StackedImages(overlays); } diff --git a/core/src/ch/asynk/rustanddust/engine/gfx/animations/PromoteAnimation.java b/core/src/ch/asynk/rustanddust/engine/gfx/animations/PromoteAnimation.java index 24eac18..e054acb 100644 --- a/core/src/ch/asynk/rustanddust/engine/gfx/animations/PromoteAnimation.java +++ b/core/src/ch/asynk/rustanddust/engine/gfx/animations/PromoteAnimation.java @@ -3,7 +3,7 @@ package ch.asynk.rustanddust.engine.gfx.animations; import java.lang.Math; import com.badlogic.gdx.audio.Sound; -import com.badlogic.gdx.graphics.g2d.TextureAtlas; +import com.badlogic.gdx.graphics.g2d.TextureAtlas.AtlasRegion; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.glutils.ShapeRenderer; @@ -32,9 +32,9 @@ public class PromoteAnimation implements Animation, Drawable private float volume; private float elapsed; - public static void init(TextureAtlas atlas, Sound usSnd, Sound geSnd) + public static void init(AtlasRegion r, Sound usSnd, Sound geSnd) { - region = atlas.findRegion("stars"); + region = r; usSound = usSnd; geSound = geSnd; } |