Fix simple team hats (32×64) not tinting correctly while on rope or using blowtorch
authorWuzzy <Wuzzy2@mail.ru>
Sat, 17 Mar 2018 04:02:37 +0100
changeset 13238 bb73d6d3348a
parent 13237 2a3c52c49e8e
child 13239 6fa6626eb273
Fix simple team hats (32×64) not tinting correctly while on rope or using blowtorch
hedgewars/uGearsRender.pas
--- a/hedgewars/uGearsRender.pas	Sat Mar 17 02:16:16 2018 +0100
+++ b/hedgewars/uGearsRender.pas	Sat Mar 17 04:02:37 2018 +0100
@@ -490,10 +490,14 @@
                                 begin
                                 DrawTextureRotatedF(curhat, 1.0, -1.0, -6.0, ox, oy, 0, i, 32, 32,
                                     i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle);
-                                if curhat^.w > 64 then
+                                if (curhat^.w > 64) or ((curhat^.w = 64) and (curhat^.h = 32)) then
                                     begin
+                                    if ((curhat^.w = 64) and (curhat^.h = 32)) then
+                                        tx := 1
+                                    else
+                                        tx := 32;
                                     Tint(HH^.Team^.Clan^.Color shl 8 or $FF);
-                                    DrawTextureRotatedF(curhat, 1.0, -1.0, -6.0, ox, oy, 32, i, 32, 32,
+                                    DrawTextureRotatedF(curhat, 1.0, -1.0, -6.0, ox, oy, tx, i, 32, 32,
                                         i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle);
                                     untint
                                     end
@@ -521,14 +525,18 @@
                                 sign,
                                 32,
                                 32);
-                            if curhat^.w > 64 then
+                            if (curhat^.w > 64) or ((curhat^.w = 64) and (curhat^.h = 32)) then
                                 begin
+                                if ((curhat^.w = 64) and (curhat^.h = 32)) then
+                                    tx := 1
+                                else
+                                    tx := 32;
                                 Tint(HH^.Team^.Clan^.Color shl 8 or $FF);
                                 DrawTextureF(curhat,
                                     1,
                                     sx,
                                     sy - 5,
-                                    32,
+                                    tx,
                                     sign,
                                     32,
                                     32);