Browse Source

Fixed artifacts exposed (not really caused) by a0d18b527fb1. GL_CLAMP is deprecated in OpenGL ES. Image::Filter and Image::Wrap did not have reasonable default.

rude 15 years ago
parent
commit
1eca14ed9e

+ 8 - 0
src/modules/graphics/Image.cpp

@@ -24,6 +24,14 @@ namespace love
 {
 {
 namespace graphics
 namespace graphics
 {
 {
+	Image::Filter::Filter() : min(FILTER_LINEAR), mag(FILTER_LINEAR)
+	{
+	}
+
+	Image::Wrap::Wrap() : s(WRAP_CLAMP), t(WRAP_CLAMP)
+	{
+	}
+
 	Image::~Image()
 	Image::~Image()
 	{
 	{
 	}
 	}

+ 2 - 0
src/modules/graphics/Image.h

@@ -51,12 +51,14 @@ namespace graphics
 
 
 		struct Filter
 		struct Filter
 		{
 		{
+			Filter();
 			FilterMode min;
 			FilterMode min;
 			FilterMode mag;
 			FilterMode mag;
 		};
 		};
 
 
 		struct Wrap
 		struct Wrap
 		{
 		{
+			Wrap();
 			WrapMode s;
 			WrapMode s;
 			WrapMode t;
 			WrapMode t;
 		};
 		};

+ 4 - 4
src/modules/graphics/opengl/Image.cpp

@@ -198,7 +198,7 @@ namespace opengl
 		switch(w.s)
 		switch(w.s)
 		{
 		{
 		case WRAP_CLAMP:
 		case WRAP_CLAMP:
-			gs = GL_CLAMP;
+			gs = GL_CLAMP_TO_EDGE;
 			break;
 			break;
 		case WRAP_REPEAT:
 		case WRAP_REPEAT:
 		default:
 		default:
@@ -209,7 +209,7 @@ namespace opengl
 		switch(w.t)
 		switch(w.t)
 		{
 		{
 		case WRAP_CLAMP:
 		case WRAP_CLAMP:
-			gt = GL_CLAMP;
+			gt = GL_CLAMP_TO_EDGE;
 			break;
 			break;
 		case WRAP_REPEAT:
 		case WRAP_REPEAT:
 		default:
 		default:
@@ -236,7 +236,7 @@ namespace opengl
 
 
 		switch(gs)
 		switch(gs)
 		{
 		{
-		case GL_CLAMP:
+		case GL_CLAMP_TO_EDGE:
 			w.s = WRAP_CLAMP;
 			w.s = WRAP_CLAMP;
 			break;
 			break;
 		case GL_REPEAT:
 		case GL_REPEAT:
@@ -247,7 +247,7 @@ namespace opengl
 
 
 		switch(gt)
 		switch(gt)
 		{
 		{
-		case GL_CLAMP:
+		case GL_CLAMP_TO_EDGE:
 			w.t = WRAP_CLAMP;
 			w.t = WRAP_CLAMP;
 			break;
 			break;
 		case GL_REPEAT:
 		case GL_REPEAT: