Browse Source

Fixed up some code.

Alex Szpakowski 9 years ago
parent
commit
6036454a20

+ 8 - 0
src/modules/graphics/opengl/Canvas.cpp

@@ -361,6 +361,14 @@ bool Canvas::setWrap(const Texture::Wrap &w)
 		wrap.s = wrap.t = WRAP_CLAMP;
 	}
 
+	if (!gl.isClampZeroTextureWrapSupported())
+	{
+		if (wrap.s == WRAP_CLAMP_ZERO)
+			wrap.s = WRAP_CLAMP;
+		if (wrap.t == WRAP_CLAMP_ZERO)
+			wrap.t = WRAP_CLAMP;
+	}
+
 	gl.bindTexture(texture);
 	gl.setTextureWrap(wrap);
 

+ 9 - 1
src/modules/graphics/opengl/Image.cpp

@@ -531,8 +531,16 @@ bool Image::setWrap(const Texture::Wrap &w)
 		wrap.s = wrap.t = WRAP_CLAMP;
 	}
 
+	if (!gl.isClampZeroTextureWrapSupported())
+	{
+		if (wrap.s == WRAP_CLAMP_ZERO)
+			wrap.s = WRAP_CLAMP;
+		if (wrap.t == WRAP_CLAMP_ZERO)
+			wrap.t = WRAP_CLAMP;
+	}
+
 	gl.bindTexture(texture);
-	gl.setTextureWrap(w);
+	gl.setTextureWrap(wrap);
 
 	return success;
 }

+ 0 - 3
src/modules/graphics/opengl/OpenGL.cpp

@@ -604,9 +604,6 @@ void OpenGL::setTextureFilter(graphics::Texture::Filter &f)
 
 GLint OpenGL::getGLWrapMode(Texture::WrapMode wmode)
 {
-	if (wmode == Texture::WRAP_CLAMP_ZERO && !isClampZeroTextureWrapSupported())
-		wmode = Texture::WRAP_CLAMP;
-
 	switch (wmode)
 	{
 	case Texture::WRAP_CLAMP: