Engine:
authorsmaxx
Sun, 22 Aug 2010 16:31:57 +0200
changeset 3751 a70c61c076ae
parent 3750 3aa85b5f3318
child 3752 73c2d7d5643b
Engine: * Added fire trails Graphics: * Added new flame sprites by Aki (for testing)
hedgewars/GSHandlers.inc
hedgewars/GearDrawing.inc
hedgewars/VGSHandlers.inc
hedgewars/uVisualGears.pas
share/hedgewars/Data/Graphics/Flame.png
--- a/hedgewars/GSHandlers.inc	Sat Aug 21 22:54:43 2010 +0200
+++ b/hedgewars/GSHandlers.inc	Sun Aug 22 16:31:57 2010 +0200
@@ -1768,6 +1768,7 @@
 var 
     gX,gY,i: LongInt;
     sticky: Boolean;
+    vgt: PVisualGear;
 begin
     sticky:= (Gear^.State and gsttmpFlag) <> 0;
     if not sticky then AllInactive := false;
@@ -1775,6 +1776,20 @@
     if not TestCollisionYwithGear(Gear, 1) then
     begin
         AllInactive := false;
+
+        if ((GameTicks mod 100) = 0) then
+            begin
+            vgt:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtFire);
+            if vgt <> nil then
+                begin
+                vgt^.dx:= 0;
+                vgt^.dy:= 0;
+                vgt^.FrameTicks:= 1800 div (Gear^.Tag mod 3 + 2);
+                vgt^.State:= gstTmpFlag;
+                end;
+            end;
+
+
         if Gear^.dX.QWordValue > _0_01.QWordValue then
             Gear^.dX := Gear^.dX * _0_995;
         Gear^.dY := Gear^.dY + cGravity;
--- a/hedgewars/GearDrawing.inc	Sat Aug 21 22:54:43 2010 +0200
+++ b/hedgewars/GearDrawing.inc	Sun Aug 22 16:31:57 2010 +0200
@@ -747,7 +747,7 @@
         gtDynamite: DrawSprite2(sprDynamite, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 25 + WorldDy, Gear^.Tag and 1, Gear^.Tag shr 1);
      gtClusterBomb: DrawRotated(sprClusterBomb, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle);
          gtCluster: DrawSprite(sprClusterParticle, hwRound(Gear^.X) - 8 + WorldDx, hwRound(Gear^.Y) - 8 + WorldDy, 0);
-           gtFlame: DrawTextureF(SpritesData[sprFlame].Texture, 2 / (Gear^.Tag mod 3 + 2), hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, (GameTicks div 128 + LongWord(Gear^.Tag)) mod 8, 1, 16, 16);
+           gtFlame: DrawTextureF(SpritesData[sprFlame].Texture, 2 / (Gear^.Tag mod 3 + 2), hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, (GameTicks shr 7 + LongWord(Gear^.Tag)) mod 8, 1, 16, 16);
        gtParachute: begin
                     DrawSprite(sprParachute, hwRound(Gear^.X) - 24 + WorldDx, hwRound(Gear^.Y) - 48 + WorldDy, 0);
                     DrawAltWeapon(Gear, hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy)
--- a/hedgewars/VGSHandlers.inc	Sat Aug 21 22:54:43 2010 +0200
+++ b/hedgewars/VGSHandlers.inc	Sun Aug 22 16:31:57 2010 +0200
@@ -144,11 +144,27 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepFire(Gear: PVisualGear; Steps: Longword);
+var vgt: PVisualGear;
 begin
 Gear^.X:= Gear^.X + Gear^.dX * Steps;
 
 Gear^.Y:= Gear^.Y + Gear^.dY * Steps;// + cGravityf * (Steps * Steps);
-Gear^.dY:= Gear^.dY + cGravityf * Steps;
+if (Gear^.State and gstTmpFlag) = 0 then
+    begin
+    Gear^.dY:= Gear^.dY + cGravityf * Steps;
+    if ((GameTicks mod 100) < Steps + 1) then
+        begin
+        vgt:= AddVisualGear(round(Gear^.X), round(Gear^.Y), vgtFire);
+        if vgt <> nil then
+            begin
+            vgt^.dx:= 0;
+            vgt^.dy:= 0;
+            vgt^.State:= gstTmpFlag;
+            end;
+        end
+    end
+else
+    inc(Steps, Steps);
 
 if Gear^.FrameTicks <= Steps then
        DeleteVisualGear(Gear)
--- a/hedgewars/uVisualGears.pas	Sat Aug 21 22:54:43 2010 +0200
+++ b/hedgewars/uVisualGears.pas	Sun Aug 22 16:31:57 2010 +0200
@@ -386,6 +386,7 @@
 
 procedure DrawVisualGears(Layer: LongWord);
 var Gear: PVisualGear;
+    i: LongInt;
 begin
 Gear:= VisualGearsList;
 case Layer of
@@ -435,7 +436,10 @@
             case Gear^.Kind of
                 vgtExplPart: DrawSprite(sprExplPart, round(Gear^.X) + WorldDx - 16, round(Gear^.Y) + WorldDy - 16, 7 - Gear^.Frame);
                 vgtExplPart2: DrawSprite(sprExplPart2, round(Gear^.X) + WorldDx - 16, round(Gear^.Y) + WorldDy - 16, 7 - Gear^.Frame);
-                vgtFire: DrawSprite(sprFlame, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy, (RealTicks div 64 + Gear^.Frame) mod 8);
+                vgtFire: if (Gear^.State and gstTmpFlag) = 0 then
+                             DrawSprite(sprFlame, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy, (RealTicks shr 6 + Gear^.Frame) mod 8)
+                         else
+                             DrawTextureF(SpritesData[sprFlame].Texture, Gear^.FrameTicks / 900, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, (RealTicks shr 7 + Gear^.Frame) mod 8, 1, 16, 16);
                 vgtBubble: DrawSprite(sprBubbles, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy - 8, Gear^.Frame);//(RealTicks div 64 + Gear^.Frame) mod 8);
                 vgtSteam: DrawSprite(sprExplPart, round(Gear^.X) + WorldDx - 16, round(Gear^.Y) + WorldDy - 16, 7 - Gear^.Frame);
                 vgtAmmo: begin
Binary file share/hedgewars/Data/Graphics/Flame.png has changed