trying to get tint to behave more as I expect. need to ask Smaxx what he intended here, to avoid too many pointless colour calls
authornemo
Thu, 02 Dec 2010 19:51:30 -0500
changeset 4451 1c342980b4aa
parent 4450 b8d30b0e4829
child 4452 258945553b18
trying to get tint to behave more as I expect. need to ask Smaxx what he intended here, to avoid too many pointless colour calls
hedgewars/uRender.pas
hedgewars/uVisualGears.pas
--- a/hedgewars/uRender.pas	Thu Dec 02 19:19:34 2010 -0500
+++ b/hedgewars/uRender.pas	Thu Dec 02 19:51:30 2010 -0500
@@ -21,6 +21,7 @@
 procedure DrawLine(X0, Y0, X1, Y1, Width: Single; r, g, b, a: Byte);
 procedure DrawFillRect(r: TSDL_Rect);
 procedure DrawCircle(X, Y, Radius, Width: LongInt; r, g, b, a: Byte);
+procedure DrawCircle(X, Y, Radius, Width: LongInt);
 procedure DrawHedgehog(X, Y: LongInt; Dir: LongInt; Pos, Step: LongWord; Angle: real);
 procedure Tint(r, g, b, a: Byte); inline;
 procedure Tint(c: Longword); inline;
@@ -352,6 +353,13 @@
 end;
 
 procedure DrawCircle(X, Y, Radius, Width: LongInt; r, g, b, a: Byte); 
+begin
+    Tint(r, g, b, a);
+    DrawCircle(X, Y, Radius, Width); 
+    Tint($FF, $FF, $FF, $FF);
+end;
+
+procedure DrawCircle(X, Y, Radius, Width: LongInt); 
 var
     i: LongInt;
     CircleVertex: array [0..359] of TVertex2f;
@@ -364,10 +372,8 @@
     glEnable(GL_LINE_SMOOTH);
     glPushMatrix;
     glLineWidth(Width);
-    Tint(r, g, b, a);
     glVertexPointer(2, GL_FLOAT, 0, @CircleVertex[0]);
     glDrawArrays(GL_LINE_LOOP, 0, 360);
-    Tint($FF, $FF, $FF, $FF);
     glPopMatrix;
     glEnable(GL_TEXTURE_2D);
     glDisable(GL_LINE_SMOOTH);
--- a/hedgewars/uVisualGears.pas	Thu Dec 02 19:19:34 2010 -0500
+++ b/hedgewars/uVisualGears.pas	Thu Dec 02 19:51:30 2010 -0500
@@ -386,6 +386,7 @@
                           DrawRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle);
             vgtCloud: DrawSprite(sprCloud, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame);
             end;
+	Tint($FFFFFFFF);
         Gear:= Gear^.NextGear
         end;
     1: while Gear <> nil do
@@ -407,6 +408,7 @@
                             DrawRotatedF(sprFeather, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
                             end;
                  end;
+	Tint($FFFFFFFF);
         Gear:= Gear^.NextGear
         end;
     2: while Gear <> nil do
@@ -472,10 +474,9 @@
             vgtSmallDamageTag: DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
             vgtSpeechBubble: if Gear^.Tex <> nil then DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
             vgtHealthTag: if Gear^.Tex <> nil then DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
-            vgtCircle: DrawCircle(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.State, Gear^.Timer, 
-                      ((Gear^.Tint shr 24) and $FF), ((Gear^.Tint shr 16) and $FF), ((Gear^.Tint shr 8) and $FF), Gear^.Tint and $FF); 
-// Consider adding a version of DrawCircle that does not set Tint internally, and just call it here...
+            vgtCircle: DrawCircle(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.State, Gear^.Timer);
         end;
+	Tint($FFFFFFFF);
         Gear:= Gear^.NextGear
         end
     end