Fix rounding error in sky colour causing visible lines
authornemo
Fri, 26 Aug 2011 21:49:10 -0400
changeset 5689 48ef34701751
parent 5688 fba59d6b5b6c
child 5690 f6e0c5bd8020
Fix rounding error in sky colour causing visible lines
hedgewars/uGears.pas
hedgewars/uLandObjects.pas
--- a/hedgewars/uGears.pas	Fri Aug 26 21:38:11 2011 -0400
+++ b/hedgewars/uGears.pas	Fri Aug 26 21:49:10 2011 -0400
@@ -863,7 +863,7 @@
                         
                         ChangeToSDClouds;
                         ChangeToSDFlakes;
-                        glClearColor(SDSkyColor.r / 255, SDSkyColor.g / 255, SDSkyColor.b / 255, 0.99);
+                        glClearColor(SDSkyColor.r * (SDTint/255) / 255, SDSkyColor.g * (SDTint/255) / 255, SDSkyColor.b * (SDTint/255) / 255, 0.99);
                         end;
                     AddCaption(trmsg[sidSuddenDeath], cWhiteColor, capgrpGameState);
                     playSound(sndSuddenDeath);
--- a/hedgewars/uLandObjects.pas	Fri Aug 26 21:38:11 2011 -0400
+++ b/hedgewars/uLandObjects.pas	Fri Aug 26 21:49:10 2011 -0400
@@ -424,9 +424,9 @@
             SkyColor.b:= t
             end;
         glClearColor(SkyColor.r / 255, SkyColor.g / 255, SkyColor.b / 255, 0.99);
-        SDSkyColor.r:= byte(SkyColor.r * SDTint div 255);
-        SDSkyColor.g:= byte(SkyColor.g * SDTint div 255);
-        SDSkyColor.b:= byte(SkyColor.b * SDTint div 255);
+        SDSkyColor.r:= SkyColor.r;
+        SDSkyColor.g:= SkyColor.g;
+        SDSkyColor.b:= SkyColor.b;
         end
     else if key = 'border' then
         begin
@@ -661,9 +661,9 @@
                 RQSkyColor.b:= t
                 end;
             glClearColor(RQSkyColor.r / 255, RQSkyColor.g / 255, RQSkyColor.b / 255, 0.99);
-            SDSkyColor.r:= byte(RQSkyColor.r * SDTint div 255);
-            SDSkyColor.g:= byte(RQSkyColor.g * SDTint div 255);
-            SDSkyColor.b:= byte(RQSkyColor.b * SDTint div 255);
+            SDSkyColor.r:= RQSkyColor.r;
+            SDSkyColor.g:= RQSkyColor.g;
+            SDSkyColor.b:= RQSkyColor.b;
             end
         end
     end;