Allow rope tinting
authornemo
Sun, 15 Mar 2015 16:14:13 -0400
changeset 10848 231d3e3d3267
parent 10847 b68e35d6e376
child 10855 1af1a54d740b
Allow rope tinting
hedgewars/uGearsList.pas
hedgewars/uGearsRender.pas
--- a/hedgewars/uGearsList.pas	Tue Mar 03 22:22:29 2015 +0300
+++ b/hedgewars/uGearsList.pas	Sun Mar 15 16:14:13 2015 -0400
@@ -342,6 +342,8 @@
                 gear^.Radius:= 3;
                 gear^.Friction:= _450 * _0_01 * cRopePercent;
                 RopePoints.Count:= 0;
+                gear^.Tint:= $D8D8D8FF;
+                gear^.Tag:= 0; // normal rope render
                 end;
         gtMine: begin
                 gear^.ImpactSound:= sndMineImpact;
--- a/hedgewars/uGearsRender.pas	Tue Mar 03 22:22:29 2015 +0300
+++ b/hedgewars/uGearsRender.pas	Sun Mar 15 16:14:13 2015 -0400
@@ -68,7 +68,8 @@
     EnableTexture(false);
     //glEnable(GL_LINE_SMOOTH);
 
-    Tint($70, $70, $70, $FF);
+    
+    Tint(Gear^.Tint shr 24 div 3, Gear^.Tint shr 16 and $FF div 3, Gear^.Tint shr 8 and $FF div 3, Gear^.Tint and $FF);
 
     n:= RopePoints.Count + 2;
 
@@ -79,7 +80,7 @@
 
     glLineWidth(3.0 * cScaleFactor);
     glDrawArrays(GL_LINE_STRIP, 0, n);
-    Tint($D8, $D8, $D8, $FF);
+    Tint(Gear^.Tint);
     glLineWidth(2.0 * cScaleFactor);
     glDrawArrays(GL_LINE_STRIP, 0, n);
 
@@ -169,7 +170,7 @@
 var roplen, i: LongInt;
 begin
     if Gear^.Hedgehog^.Gear = nil then exit;
-    if (cReducedQuality and rqSimpleRope) <> 0 then
+    if (Gear^.Tag = 1) or ((cReducedQuality and rqSimpleRope) <> 0) then
         DrawRopeLinesRQ(Gear)
     else
         begin