hedgewars/uLandTexture.pas
changeset 10020 67e127027af6
parent 9998 736015b847e3
child 10040 4ac87acbaed9
--- a/hedgewars/uLandTexture.pas	Sun Jan 19 14:58:54 2014 +0100
+++ b/hedgewars/uLandTexture.pas	Sun Jan 19 16:35:06 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;