summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-03-14 17:28:01 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2016-03-14 17:28:01 +0100
commitd7df2eb811b11eab996728c7dfe0a01aae2eb9df (patch)
treeb7ec5b0a19a4f2679b8403caec188db7c46a4127 /core/src/ch/asynk
parentcfa344dbffa0488a9c72efdb481b8cdf87f0ac11 (diff)
downloadRustAndDust-d7df2eb811b11eab996728c7dfe0a01aae2eb9df.zip
RustAndDust-d7df2eb811b11eab996728c7dfe0a01aae2eb9df.tar.gz
TankFireAnimation: set(...) set region dimensions
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r--core/src/ch/asynk/rustanddust/engine/gfx/animations/TankFireAnimation.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/src/ch/asynk/rustanddust/engine/gfx/animations/TankFireAnimation.java b/core/src/ch/asynk/rustanddust/engine/gfx/animations/TankFireAnimation.java
index 582bc1c..656ae51 100644
--- a/core/src/ch/asynk/rustanddust/engine/gfx/animations/TankFireAnimation.java
+++ b/core/src/ch/asynk/rustanddust/engine/gfx/animations/TankFireAnimation.java
@@ -22,6 +22,8 @@ public class TankFireAnimation implements Disposable, Animation, Pool.Poolable
private static final float EXPLOSION_FRAME_DURATION = 0.07f;
private TextureRegion fireRegion;
+ private int _w;
+ private int _h;
private float fire_a;
private float fire_x;
private float fire_y;
@@ -68,6 +70,8 @@ public class TankFireAnimation implements Disposable, Animation, Pool.Poolable
public TankFireAnimation()
{
this.fireRegion = new TextureRegion(FireAnimation.tankFire.frames[0]);
+ this._w = this.fireRegion.getRegionWidth();
+ this._h = this.fireRegion.getRegionHeight();
}
private void set(float volume, Moveable m, float x0, float y0, float x1, float y1, float halfWidth)
@@ -106,6 +110,7 @@ public class TankFireAnimation implements Disposable, Animation, Pool.Poolable
this.end_time = (hit_time + explosion_duration);
// fire vars
+ this.fireRegion.setRegion(0, 0, _w, _h);
this.fire_a = a;
this.fire_x = x0;
this.fire_y = y0;