hedgewars/GearDrawing.inc
changeset 3445 1ce844170014
parent 3440 dee31c5149e0
child 3460 d957d5f7b58d
--- a/hedgewars/GearDrawing.inc	Fri May 07 09:57:12 2010 +0000
+++ b/hedgewars/GearDrawing.inc	Fri May 07 10:54:07 2010 +0000
@@ -184,8 +184,17 @@
                            DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + dAngle);
                    with HH^ do
                        if (HatTex <> nil) then
+                           begin
                            DrawRotatedTextureF(HatTex, 1.0, -1.0, -6.0, sx, sy, 0, i, 32, 32,
                                i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle);
+                           if HatTex^.w > 32 then
+                               begin
+                               Tint(HH^.Team^.Clan^.Color);
+                               DrawRotatedTextureF(HatTex, 1.0, -1.0, -6.0, sx, sy, 32, i, 32, 32,
+                                   i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle);
+                               Tint($FF, $FF, $FF, $FF)
+                               end
+                           end
                    end;
                 DrawAltWeapon(Gear, sx, sy);
                 defaultPos:= false
@@ -199,14 +208,29 @@
                         0);
                 with HH^ do
                     if (HatTex <> nil) then
-                       DrawTextureF(HatTex,
-                           1,
-                           sx,
-                           hwRound(Gear^.Y) - 8 + WorldDy,
-                           0,
-                           hwSign(Gear^.dX),
-                           32,
-                           32);
+                        begin
+                        DrawTextureF(HatTex,
+                            1,
+                            sx,
+                            hwRound(Gear^.Y) - 8 + WorldDy,
+                            0,
+                            hwSign(Gear^.dX),
+                            32,
+                            32);
+                        if HatTex^.w > 32 then
+                            begin
+                            Tint(HH^.Team^.Clan^.Color);
+                            DrawTextureF(HatTex,
+                                1,
+                                sx,
+                                hwRound(Gear^.Y) - 8 + WorldDy,
+                                32,
+                                hwSign(Gear^.dX),
+                                32,
+                                32);
+                            Tint($FF, $FF, $FF, $FF)
+                            end
+                        end;
                 defaultPos:= false
                 end;
             gtShover: DrawRotated(sprHandBaseball, hx, hy, hwSign(Gear^.dX), aangle + 180);
@@ -478,6 +502,7 @@
     if (HatTex <> nil)
     and (HatVisibility > 0) then
         if DefaultPos then
+            begin
             DrawTextureF(HatTex,
                 HatVisibility,
                 sx,
@@ -485,8 +510,23 @@
                 (RealTicks div 128 + Gear^.Pos) mod 19,
                 hwSign(Gear^.dX),
                 32,
-                32)
+                32);
+            if HatTex^.w > 32 then
+                begin
+                Tint(HH^.Team^.Clan^.Color);
+                DrawTextureF(HatTex,
+                    HatVisibility,
+                    sx,
+                    hwRound(Gear^.Y) - 8 + WorldDy,
+                    (RealTicks div 128 + Gear^.Pos) mod 19 + 32,
+                    hwSign(Gear^.dX),
+                    32,
+                    32);
+                Tint($FF, $FF, $FF, $FF)
+                end
+            end
         else
+            begin
             DrawTextureF(HatTex,
                 HatVisibility,
                 sx,
@@ -495,6 +535,20 @@
                 hwSign(Gear^.dX)*m,
                 32,
                 32);
+            if HatTex^.w > 32 then
+                begin
+                Tint(HH^.Team^.Clan^.Color);
+                DrawTextureF(HatTex,
+                    HatVisibility,
+                    sx,
+                    hwRound(Gear^.Y) - 8 + WorldDy,
+                    32,
+                    hwSign(Gear^.dX)*m,
+                    32,
+                    32);
+                Tint($FF, $FF, $FF, $FF)
+                end
+            end
     end;
 if (Gear^.State and gstHHDriven) <> 0 then
     begin