Add a fade out when in lag for snow.
authornemo
Mon, 05 Sep 2011 15:32:58 -0400
changeset 5787 f2caf41f2984
parent 5786 ffe2401e287f
child 5788 0837a4cac4c7
Add a fade out when in lag for snow.
hedgewars/uGearsRender.pas
--- a/hedgewars/uGearsRender.pas	Mon Sep 05 15:05:46 2011 -0400
+++ b/hedgewars/uGearsRender.pas	Mon Sep 05 15:32:58 2011 -0400
@@ -1071,14 +1071,18 @@
                         //DrawTexture(x, y, SpritesData[sprVampiric].Texture, 0.1);
                         Tint($FF, $FF, $FF, $FF);
                         end
-                    else if not isInLag then
+                    else //if not isInLag then
                         begin
+                        if isInLag and (Gear^.FlightTime < 256) then inc(Gear^.FlightTime, 8)
+                        else if not isInLag and (Gear^.FlightTime > 0) then dec(Gear^.FlightTime, 8);
+                        if Gear^.FlightTime > 0 then Tint($FF, $FF, $FF, $FF-min(255,Gear^.FlightTime));
                         if vobVelocity = 0 then
                             DrawSprite(sprFlake, x, y, Gear^.Timer)
                         else
-                            DrawRotatedF(sprFlake, x, y, Gear^.Timer, 1, Gear^.DirAngle)
+                            DrawRotatedF(sprFlake, x, y, Gear^.Timer, 1, Gear^.DirAngle);
 //DrawSprite(sprFlake, x-SpritesData[sprFlake].Width div 2, y-SpritesData[sprFlake].Height div 2, Gear^.Timer)
 //DrawRotatedF(sprFlake, x-SpritesData[sprFlake].Width div 2, y-SpritesData[sprFlake].Height div 2, Gear^.Timer, 1, Gear^.DirAngle);
+                        if Gear^.FlightTime > 0 then Tint($FF, $FF, $FF, $FF);
                         end;
        gtStructure: DrawSprite(sprTarget, x - 16, y - 16, 0);
           gtTardis: if Gear^.Pos <> 4 then