minor tweak since health tag was being retinted anyway. make it fade out. also disable unneeded tinted flag, save a handful of ops
authornemo
Mon, 01 Aug 2011 16:45:45 -0400
changeset 5491 3a82724de759
parent 5490 18c6049b5ae3
child 5492 a0455a050ca8
minor tweak since health tag was being retinted anyway. make it fade out. also disable unneeded tinted flag, save a handful of ops
hedgewars/VGSHandlers.inc
hedgewars/uVisualGears.pas
--- a/hedgewars/VGSHandlers.inc	Mon Aug 01 15:37:27 2011 -0400
+++ b/hedgewars/VGSHandlers.inc	Mon Aug 01 16:45:45 2011 -0400
@@ -258,7 +258,11 @@
 if Gear^.FrameTicks <= Steps then
     DeleteVisualGear(Gear)
 else
+    begin
     dec(Gear^.FrameTicks, Steps);
+    if (Gear^.FrameTicks < 501) and (Gear^.FrameTicks mod 5 = 0) then 
+        Gear^.Tint:= (Gear^.Tint and $FFFFFF00) or (((Gear^.Tint and $000000FF) * Gear^.FrameTicks) div 500)
+    end
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
--- a/hedgewars/uVisualGears.pas	Mon Aug 01 15:37:27 2011 -0400
+++ b/hedgewars/uVisualGears.pas	Mon Aug 01 16:45:45 2011 -0400
@@ -433,7 +433,7 @@
     // this layer is on the land level (which is close but behind the screen plane) when stereo
     1: while Gear <> nil do
         begin
-        tinted:= false;
+        //tinted:= false;
         if Gear^.Tint <> $FFFFFFFF then Tint(Gear^.Tint);
         case Gear^.Kind of
             vgtSmokeTrace: if Gear^.State < 8 then DrawSprite(sprSmokeTrace, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.State);
@@ -462,7 +462,8 @@
                                 DrawSprite(sprDroplet, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy - 8, Gear^.Frame);
                 vgtBubble: DrawSprite(sprBubbles, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy - 8, Gear^.Frame);//(RealTicks div 64 + Gear^.Frame) mod 8);
             end;
-        if (Gear^.Tint <> $FFFFFFFF) or tinted then Tint($FF,$FF,$FF,$FF);
+        //if (Gear^.Tint <> $FFFFFFFF) or tinted then Tint($FF,$FF,$FF,$FF);
+        if (Gear^.Tint <> $FFFFFFFF) then Tint($FF,$FF,$FF,$FF);
         Gear:= Gear^.NextGear
        end;
     // this layer is on the screen plane (depth = 0) when stereo