hedgewars/uLandTexture.pas
changeset 10040 4ac87acbaed9
parent 10015 4feced261c68
parent 10020 67e127027af6
child 10108 c68cf030eded
--- a/hedgewars/uLandTexture.pas	Tue Jan 21 22:44:37 2014 +0100
+++ b/hedgewars/uLandTexture.pas	Tue Jan 21 22:53:15 2014 +0100
@@ -33,6 +33,8 @@
 uses uConsts, GLunit, uTypes, uVariables, uTextures, uDebug, uRender;
 
 const TEXSIZE = 128;
+      // in avoid tile borders stretch the blurry texture by 1 pixel more
+      BLURRYLANDOVERLAP = 1 / TEXSIZE / 2.0; // 1 pixel divided by texsize and blurry land scale factor
 
 type TLandRecord = record
             shouldUpdate, landAdded: boolean;
@@ -181,9 +183,10 @@
             if tex <> nil then
                 if (cReducedQuality and rqBlurryLand) = 0 then
                     DrawTexture(dX + x * TEXSIZE, dY + y * TEXSIZE, tex)
-                else
+                else if (cReducedQuality and rqClampLess) = 0 then
                     DrawTexture(dX + x * TEXSIZE * 2, dY + y * TEXSIZE * 2, tex, 2.0)
-
+                else
+                    DrawTexture2(dX + x * TEXSIZE * 2, dY + y * TEXSIZE * 2, tex, 2.0, BLURRYLANDOVERLAP);
 end;
 
 procedure SetLandTexture;