hedgewars/uGears.pas
changeset 1251 1f545d9a10ca
parent 1242 4aca5f7b2504
child 1253 79f47495b346
--- a/hedgewars/uGears.pas	Wed Sep 10 14:37:27 2008 +0000
+++ b/hedgewars/uGears.pas	Thu Sep 11 15:30:04 2008 +0000
@@ -843,23 +843,34 @@
 		end;
 	end;
 
-
-if defaultPos then
+with PHedgehog(Gear^.Hedgehog)^ do
 	begin
-	DrawRotatedF(sprHHIdle,
-		hwRound(Gear^.X) + 1 + WorldDx,
-		hwRound(Gear^.Y) - 3 + WorldDy,
-		(RealTicks div 128 + Gear^.Pos) mod 19,
-		hwSign(Gear^.dX),
-		0);
-	DrawTextureF(PHedgehog(Gear^.Hedgehog)^.HatTex,
-		hwRound(Gear^.X) + 1 + WorldDx,
-		hwRound(Gear^.Y) - 8 + WorldDy,
-		(RealTicks div 128 + Gear^.Pos) mod 19,
-		hwSign(Gear^.dX),
-		32);
+	if defaultPos then
+		begin
+		DrawRotatedF(sprHHIdle,
+			hwRound(Gear^.X) + 1 + WorldDx,
+			hwRound(Gear^.Y) - 3 + WorldDy,
+			(RealTicks div 128 + Gear^.Pos) mod 19,
+			hwSign(Gear^.dX),
+			0);
+		if HatVisibility < 1.0 then
+			HatVisibility:= HatVisibility + 0.05;
+		end
+	else
+		if HatVisibility > 0.0 then
+			HatVisibility:= HatVisibility - 0.05;
+
+	if HatVisibility > 0 then
+		DrawTextureF(HatTex,
+			HatVisibility,
+			hwRound(Gear^.X) + 1 + WorldDx,
+			hwRound(Gear^.Y) - 8 + WorldDy,
+			(RealTicks div 128 + Gear^.Pos) mod 19,
+			hwSign(Gear^.dX),
+			32);
 	end;
 
+
 with PHedgehog(Gear^.Hedgehog)^ do
 	begin
 	if ((Gear^.State and not gstWinner) = 0)