--- a/hedgewars/uGears.pas Tue Jan 13 18:56:14 2009 +0000
+++ b/hedgewars/uGears.pas Tue Jan 13 18:58:18 2009 +0000
@@ -939,24 +939,24 @@
begin
if ((Gear^.State and not gstWinner) = 0)
or (bShowFinger and ((Gear^.State and gstHHDriven) <> 0)) then
- begin
- t:= hwRound(Gear^.Y) - cHHRadius - 12 + WorldDy;
- if (cTagsMask and 1) <> 0 then
begin
- dec(t, HealthTagTex^.h + 2);
- DrawCentered(hwRound(Gear^.X) + WorldDx, t, HealthTagTex)
+ t:= hwRound(Gear^.Y) - cHHRadius - 12 + WorldDy;
+ if (cTagsMask and 1) <> 0 then
+ begin
+ dec(t, HealthTagTex^.h + 2);
+ DrawCentered(hwRound(Gear^.X) + WorldDx, t, HealthTagTex)
+ end;
+ if (cTagsMask and 2) <> 0 then
+ begin
+ dec(t, NameTagTex^.h + 2);
+ DrawCentered(hwRound(Gear^.X) + WorldDx, t, NameTagTex)
+ end;
+ if (cTagsMask and 4) <> 0 then
+ begin
+ dec(t, Team^.NameTagTex^.h + 2);
+ DrawCentered(hwRound(Gear^.X) + WorldDx, t, Team^.NameTagTex)
+ end
end;
- if (cTagsMask and 2) <> 0 then
- begin
- dec(t, NameTagTex^.h + 2);
- DrawCentered(hwRound(Gear^.X) + WorldDx, t, NameTagTex)
- end;
- if (cTagsMask and 4) <> 0 then
- begin
- dec(t, Team^.NameTagTex^.h + 2);
- DrawCentered(hwRound(Gear^.X) + WorldDx, t, Team^.NameTagTex)
- end
- end;
if (Gear^.State and gstHHDriven) <> 0 then // Current hedgehog
begin
if bShowFinger and ((Gear^.State and gstHHDriven) <> 0) then
--- a/hedgewars/uWorld.pas Tue Jan 13 18:56:14 2009 +0000
+++ b/hedgewars/uWorld.pas Tue Jan 13 18:58:18 2009 +0000
@@ -224,6 +224,28 @@
glEnable(GL_TEXTURE_2D)
end;
+// Attack bar
+if CurrentTeam <> nil then
+ case AttackBar of
+(* 1: begin
+ r:= StuffPoz[sPowerBar];
+ {$WARNINGS OFF}
+ r.w:= (CurrentHedgehog^.Gear^.Power * 256) div cPowerDivisor;
+ {$WARNINGS ON}
+ DrawSpriteFromRect(r, cScreenWidth - 272, cScreenHeight - 48, 16, 0, Surface);
+ end;*)
+ 2: with CurrentHedgehog^ do
+ begin
+ tdx:= hwSign(Gear^.dX) * Sin(Gear^.Angle * Pi / cMaxAngle);
+ tdy:= - Cos(Gear^.Angle * Pi / cMaxAngle);
+ for i:= (Gear^.Power * 24) div cPowerDivisor downto 0 do
+ DrawSprite(sprPower,
+ hwRound(Gear^.X) + system.round(WorldDx + tdx * (24 + i * 2)) - 16,
+ hwRound(Gear^.Y) + system.round(WorldDy + tdy * (24 + i * 2)) - 12,
+ i)
+ end
+ end;
+
DrawGears;
DrawVisualGears(1);
@@ -252,27 +274,6 @@
DrawSprite(sprFrame, t - 4, cScreenHeight - 48, 0);
end;
-// Attack bar
-if CurrentTeam <> nil then
- case AttackBar of
-(* 1: begin
- r:= StuffPoz[sPowerBar];
- {$WARNINGS OFF}
- r.w:= (CurrentHedgehog^.Gear^.Power * 256) div cPowerDivisor;
- {$WARNINGS ON}
- DrawSpriteFromRect(r, cScreenWidth - 272, cScreenHeight - 48, 16, 0, Surface);
- end;
-*) 2: with CurrentHedgehog^ do
- begin
- tdx:= hwSign(Gear^.dX) * Sin(Gear^.Angle * Pi / cMaxAngle);
- tdy:= - Cos(Gear^.Angle * Pi / cMaxAngle);
- for i:= (Gear^.Power * 24) div cPowerDivisor downto 0 do
- DrawSprite(sprPower, hwRound(Gear^.X) + system.round(WorldDx + tdx * (24 + i * 2)) - 16,
- hwRound(Gear^.Y) + system.round(WorldDy + tdy * (24 + i * 2)) - 12,
- i)
- end
- end;
-
// Target
if TargetPoint.X <> NoPointX then DrawSprite(sprTargetP, TargetPoint.X + WorldDx - 16, TargetPoint.Y + WorldDy - 16, 0);