Fix target marker rendering issues in weWrap
authorWuzzy <Wuzzy2@mail.ru>
Tue, 02 Apr 2019 18:59:38 +0200
changeset 14765 f5dadf2b7d03
parent 14764 731c8406bff0
child 14766 7cc768094d66
Fix target marker rendering issues in weWrap
hedgewars/uWorld.pas
--- a/hedgewars/uWorld.pas	Tue Apr 02 15:53:09 2019 +0300
+++ b/hedgewars/uWorld.pas	Tue Apr 02 18:59:38 2019 +0200
@@ -1440,24 +1440,49 @@
         if CurAmmoType = amBee then
             spr:= sprTargetBee
         else
-            begin
             spr:= sprTargetP;
-            Tint(Team^.Clan^.Color shl 8 or $FF);
-            end;
         if replicateToLeft then
             begin
             ShiftWorld(-1);
+            if spr = sprTargetP then
+                begin
+                if IsTooDarkToRead(Team^.Clan^.Color) then
+                    DrawSpriteRotatedF(sprTargetPBackInv, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360)
+                else
+                    DrawSpriteRotatedF(sprTargetPBack, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360);
+                Tint(Team^.Clan^.Color shl 8 or $FF);
+                end;
             DrawSpriteRotatedF(spr, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360);
+            if spr = sprTargetP then
+                untint;
             UnshiftWorld();
             end;
 
         if replicateToRight then
             begin
             ShiftWorld(1);
+            if spr = sprTargetP then
+                begin
+                if IsTooDarkToRead(Team^.Clan^.Color) then
+                    DrawSpriteRotatedF(sprTargetPBackInv, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360)
+                else
+                    DrawSpriteRotatedF(sprTargetPBack, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360);
+                Tint(Team^.Clan^.Color shl 8 or $FF);
+                end;
             DrawSpriteRotatedF(spr, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360);
+            if spr = sprTargetP then
+                untint;
             UnshiftWorld();
             end;
 
+        if spr = sprTargetP then
+            begin
+            if IsTooDarkToRead(Team^.Clan^.Color) then
+                DrawSpriteRotatedF(sprTargetPBackInv, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360)
+            else
+                DrawSpriteRotatedF(sprTargetPBack, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360);
+            Tint(Team^.Clan^.Color shl 8 or $FF);
+            end;
         DrawSpriteRotatedF(spr, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360);
         if spr = sprTargetP then
             untint;