# HG changeset patch
# User Carli@Carli-PC
# Date 1243516593 -7200
# Node ID 01d940e2b1a108d4b64030a888a255e0dd1955a5
# Parent  868b7eff614ce2cd8716ec2fed3342d85ca5870e
Shader GL_NEAREST-bug fixed

diff -r 868b7eff614c -r 01d940e2b1a1 engine/src/C4Landscape.cpp
--- a/engine/src/C4Landscape.cpp	Wed May 27 18:48:53 2009 +0200
+++ b/engine/src/C4Landscape.cpp	Thu May 28 15:16:33 2009 +0200
@@ -287,7 +287,7 @@
 	}
 
 void C4Landscape::Draw(C4TargetFacet &cgo, int32_t iPlayer)
-	{ //return;  DAS IST DER ZEICHENCODE!!
+	{
 	if (Modulation) Application.DDraw->ActivateBlitModulation(Modulation);
   // do relights
   DoRelights();
@@ -299,7 +299,7 @@
 	    for (int i=0;i<C4M_MaxTexIndex+1;i++)
 	    {
 	    	Game.Material.Tex[i]=0;
-			if(Game.TextureMap.GetEntry(i))
+	    	if(Game.TextureMap.GetEntry(i))
 				if(Game.TextureMap.GetEntry(i)->getPattern().getSurface())
 					Game.Material.Tex[i]=(*Game.TextureMap.GetEntry(i)->getPattern().getSurface()->ppTex)->texName;
 	    };
diff -r 868b7eff614c -r 01d940e2b1a1 planet/Material.c4g/earth.jpg
Binary file planet/Material.c4g/earth.jpg has changed
diff -r 868b7eff614c -r 01d940e2b1a1 planet/Material.c4g/ice2.jpg
Binary file planet/Material.c4g/ice2.jpg has changed
diff -r 868b7eff614c -r 01d940e2b1a1 planet/Material.c4g/tunnel.jpg
Binary file planet/Material.c4g/tunnel.jpg has changed
diff -r 868b7eff614c -r 01d940e2b1a1 planet/Material.c4g/water.jpg
Binary file planet/Material.c4g/water.jpg has changed
diff -r 868b7eff614c -r 01d940e2b1a1 standard/src/StdGL.cpp
--- a/standard/src/StdGL.cpp	Wed May 27 18:48:53 2009 +0200
+++ b/standard/src/StdGL.cpp	Thu May 28 15:16:33 2009 +0200
@@ -297,6 +297,11 @@
 		}
 	if (!fExact && !DDrawCfg.PointFiltering)
 		{
+		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+		}
+	if (DDrawCfg.Shader)
+		{
 		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
 		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
 		}
@@ -468,8 +473,14 @@
 			glBindTexture(GL_TEXTURE_2D, pTex->texName);
 			if (Zoom != 1.0);// && !DDrawCfg.PointFiltering)
 				{
-				glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-				glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+					if(DDrawCfg.Shader)
+					{
+						glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+						glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+					} else {
+						glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+						glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+					};
 				}
 			if (sfcSource2)
 				{
diff -r 868b7eff614c -r 01d940e2b1a1 standard/src/StdSurface2.cpp
--- a/standard/src/StdSurface2.cpp	Wed May 27 18:48:53 2009 +0200
+++ b/standard/src/StdSurface2.cpp	Thu May 28 15:16:33 2009 +0200
@@ -1444,8 +1444,8 @@
 			glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
 			glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
 			// Default, changed in PerformBlt if necessary
-			glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-			glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+			glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+			glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
 			glTexImage2D(GL_TEXTURE_2D, 0, 4, iSize, iSize, 0, GL_BGRA, lpDDraw->byByteCnt == 2 ? GL_UNSIGNED_SHORT_4_4_4_4_REV : GL_UNSIGNED_INT_8_8_8_8_REV, texLock.pBits);
 			}
 		else
# HG changeset patch
# User Carli@Carli-PC
# Date 1243532073 -7200
# Node ID 255f010bb5fcf07cad9524dfe4a8133a8df175fc
# Parent  936d68cf1ee74886b6150c3e0b989726f4085f4b
For Guenther: without shaders it does not interpolate landscape texture

diff -r 936d68cf1ee7 -r 255f010bb5fc standard/src/StdGL.cpp
--- a/standard/src/StdGL.cpp	Thu May 28 19:20:21 2009 +0200
+++ b/standard/src/StdGL.cpp	Thu May 28 19:34:33 2009 +0200
@@ -297,6 +297,11 @@
 		}
 	if (!fExact && !DDrawCfg.PointFiltering)
 		{
+		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+		}
+	if (DDrawCfg.Shader)
+		{
 		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
 		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
 		}
@@ -449,8 +454,14 @@
 				glActiveTexture(GL_TEXTURE0);
 			CTexRef *pTex = *(sfcSource->ppTex + iY * sfcSource->iTexX + iX);
 			glBindTexture(GL_TEXTURE_2D, pTex->texName);
-			glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-			glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+			if (DDrawCfg.Shader)
+			{
+				glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+				glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+			} else {
+				glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+				glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+			};
 
 			// get current blitting offset in texture (beforing any last-tex-size-changes)
 			int iBlitX=iTexSize*iX;
diff -r 936d68cf1ee7 -r 255f010bb5fc standard/src/StdSurface2.cpp
--- a/standard/src/StdSurface2.cpp	Thu May 28 19:20:21 2009 +0200
+++ b/standard/src/StdSurface2.cpp	Thu May 28 19:34:33 2009 +0200
@@ -1443,8 +1443,8 @@
 			glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
 			glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
 			// Default, changed in PerformBlt if necessary
-			glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-			glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+			glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+			glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
 			glTexImage2D(GL_TEXTURE_2D, 0, 4, iSize, iSize, 0, GL_BGRA, lpDDraw->byByteCnt == 2 ? GL_UNSIGNED_SHORT_4_4_4_4_REV : GL_UNSIGNED_INT_8_8_8_8_REV, texLock.pBits);
 			}
 		else
