hedgewars/uMisc.pas
changeset 2290 bf87ca44782e
parent 2279 ef19b949ad30
child 2327 4832b77ec958
--- a/hedgewars/uMisc.pas	Thu Jul 30 17:32:46 2009 +0000
+++ b/hedgewars/uMisc.pas	Thu Jul 30 22:36:57 2009 +0000
@@ -148,7 +148,7 @@
 procedure SendStat(sit: TStatInfoType; s: shortstring);
 function  Str2PChar(const s: shortstring): PChar;
 function NewTexture(width, height: Longword; buf: Pointer): PTexture;
-function  Surface2Tex(surf: PSDL_Surface): PTexture;
+function  Surface2Tex(surf: PSDL_Surface; enableClamp: boolean): PTexture;
 procedure FreeTexture(tex: PTexture);
 function  toPowerOf2(i: Longword): Longword;
 function DecodeBase64(s: shortstring): shortstring;
@@ -347,7 +347,7 @@
 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)
 end;
 
-function Surface2Tex(surf: PSDL_Surface): PTexture;
+function Surface2Tex(surf: PSDL_Surface; enableClamp: boolean): PTexture;
 var modeIntFormat: LongInt;
     modeFormat: LongInt;
 	tw, th, x, y: Longword;
@@ -469,8 +469,11 @@
 if SDL_MustLock(surf) then
 	SDL_UnlockSurface(surf);
 
-//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
-//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+if enableClamp and not cReducedQuality then
+    begin
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE)
+    end;
 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)
 end;