Make vgtHealth use Tint
authornemo
Mon, 01 Aug 2011 15:37:27 -0400
changeset 5490 18c6049b5ae3
parent 5489 f7ec6e5ad054
child 5491 3a82724de759
Make vgtHealth use Tint
hedgewars/uGears.pas
hedgewars/uVisualGears.pas
--- a/hedgewars/uGears.pas	Mon Aug 01 13:29:01 2011 -0400
+++ b/hedgewars/uGears.pas	Mon Aug 01 15:37:27 2011 -0400
@@ -1069,7 +1069,7 @@
                 while i < vampDmg do
                     begin
                     vg:= AddVisualGear(hwRound(CurrentHedgehog^.Gear^.X), hwRound(CurrentHedgehog^.Gear^.Y), vgtHealth);
-                    if vg <> nil then vg^.Frame:= 10;
+                    if vg <> nil then vg^.Tint:= $FF0000FF;
                     inc(i, 5);
                     end;
                 end
--- a/hedgewars/uVisualGears.pas	Mon Aug 01 13:29:01 2011 -0400
+++ b/hedgewars/uVisualGears.pas	Mon Aug 01 15:37:27 2011 -0400
@@ -245,6 +245,7 @@
     vgtHealth: begin
                 dx:= 0.001 * random(45);
                 dy:= 0.001 * (random(20) + 25);
+                Tint:= $00FF00FF; // default to green
                 if random(2) = 0 then dx := -dx;
                 Frame:= 0;
                 FrameTicks:= random(750) + 1250;
@@ -482,14 +483,7 @@
                              end;
             vgtSmallDamageTag: DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
             vgtHealthTag: if Gear^.Tex <> nil then DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
-            vgtHealth: begin
-                       tinted:= true;
-                       case Gear^.Frame div 10 of
-                           0:Tint(0, $FF, 0, round(Gear^.FrameTicks * $FF / 1000));
-                           1:Tint($FF, 0, 0, round(Gear^.FrameTicks * $FF / 1000));
-                       end;
-                       DrawSprite(sprHealth, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy - 8, 0);
-                       end;
+            vgtHealth: DrawSprite(sprHealth, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy - 8, 0);
         end;
         if (cReducedQuality and rqAntiBoom) = 0 then
             case Gear^.Kind of