hedgewars/uGearsRender.pas
changeset 10866 c1f75780c56f
parent 10848 231d3e3d3267
child 10867 36ca7a39f34d
--- a/hedgewars/uGearsRender.pas	Fri Mar 20 15:00:52 2015 -0400
+++ b/hedgewars/uGearsRender.pas	Sun Mar 22 21:40:16 2015 +0100
@@ -36,6 +36,7 @@
             rounded   : array[0..MAXROPEPOINTS + 2] of TVertex2f;
          end;
 procedure RenderGear(Gear: PGear; x, y: LongInt);
+procedure DrawHHOrder();
 
 var RopePoints: record
                 Count: Longword;
@@ -215,6 +216,48 @@
     end;
 end;
 
+procedure DrawHHOrder();
+var HHGear: PGear;
+    hh: PHedgehog;
+    c, i, t, x, y, sprH, sprW, fSprOff: LongInt;
+begin
+t:= LocalTeam;
+
+if not CurrentTeam^.ExtDriven then
+    for i:= 0 to Pred(TeamsCount) do
+        if (TeamsArray[i] = CurrentTeam) then
+            t:= i;
+
+if TeamsArray[t] <> nil then
+    begin
+    sprH:= SpritesData[sprBigDigit].Height;
+    sprW:= SpritesData[sprBigDigit].Width;
+    fSprOff:= sprW div 4 + SpritesData[sprFrame].Width div 4 - 1; // - 1 for overlap to avoid artifacts
+    i:= 0;
+    c:= 0;
+        repeat
+        hh:= @TeamsArray[t]^.Hedgehogs[i];
+        inc(i);
+        if (hh <> nil) and (hh^.Gear <> nil) then
+            begin
+            inc(c);
+            HHGear:= hh^.Gear;
+            x:= hwRound(HHGear^.X) + WorldDx;
+            y:= hwRound(HHGear^.Y) + WorldDy - 2;
+            if (SpeechHogNumber <> c) or ((RealTicks and 512) < 256) then
+                begin
+                DrawTextureF(SpritesData[sprFrame].Texture, 0.5, x - fSprOff, y, 0, 1, SpritesData[sprFrame].Width, SpritesData[sprFrame].Height);
+                DrawTextureF(SpritesData[sprFrame].Texture, 0.5, x + fSprOff, y, 1, 1, SpritesData[sprFrame].Width, SpritesData[sprFrame].Height);
+                DrawTextureF(SpritesData[sprBigDigit].Texture, 0.5, x, y, c, 1, sprW, sprH);
+                end
+            else
+                DrawCircle(x, y, 20, 3, 0, $FF, 0, $60);
+            end;
+        until (i > cMaxHHIndex);
+    end
+
+end;
+
 
 procedure DrawHH(Gear: PGear; ox, oy: LongInt);
 var i, t: LongInt;