Use local scope global var instead
authorunc0rr
Sun, 14 Aug 2011 20:53:52 +0400
changeset 5559 a937d43a032f
parent 5558 49cfd05ccb83
child 5560 d1ebcf4df330
Use local scope global var instead
hedgewars/uRender.pas
--- a/hedgewars/uRender.pas	Sat Aug 13 22:46:47 2011 +0200
+++ b/hedgewars/uRender.pas	Sun Aug 14 20:53:52 2011 +0400
@@ -50,8 +50,6 @@
 
 implementation
 uses uVariables;
-var
-    lastTint: Longword;
 
 procedure DrawSpriteFromRect(Sprite: TSprite; r: TSDL_Rect; X, Y, Height, Position: LongInt);
 begin
@@ -453,11 +451,16 @@
 
 
 procedure Tint(r, g, b, a: Byte); inline;
-var nc, tw: Longword;
+const 
+    lastTint: Longword = 0;
+var 
+    nc, tw: Longword;
 begin
 nc:= (a shl 24) or (b shl 16) or (g shl 8) or r;
+
 if nc = lastTint then
     exit;
+
 if cGrayScale then
     begin
     tw:= round(r * RGB_LUMINANCE_RED + g * RGB_LUMINANCE_GREEN + b * RGB_LUMINANCE_BLUE);