Browse Source

Fix a potentially uninitialized value in love.graphics code. Minor cleanup.

Alex Szpakowski 6 years ago
parent
commit
0c2153e0ca

+ 0 - 2
src/modules/graphics/Canvas.cpp

@@ -45,8 +45,6 @@ Canvas::Canvas(const Settings &settings)
 		depth = settings.layers;
 		depth = settings.layers;
 	else if (texType == TEXTURE_2D_ARRAY)
 	else if (texType == TEXTURE_2D_ARRAY)
 		layers = settings.layers;
 		layers = settings.layers;
-	else
-		layers = 1;
 
 
 	if (width <= 0 || height <= 0 || layers <= 0)
 	if (width <= 0 || height <= 0 || layers <= 0)
 		throw love::Exception("Canvas dimensions must be greater than 0.");
 		throw love::Exception("Canvas dimensions must be greater than 0.");

+ 1 - 0
src/modules/graphics/Graphics.h

@@ -371,6 +371,7 @@ public:
 		RenderTarget()
 		RenderTarget()
 			: canvas(nullptr)
 			: canvas(nullptr)
 			, slice(0)
 			, slice(0)
+			, mipmap(0)
 		{}
 		{}
 
 
 		bool operator != (const RenderTarget &other) const
 		bool operator != (const RenderTarget &other) const

+ 1 - 1
src/modules/graphics/opengl/OpenGL.cpp

@@ -1654,7 +1654,7 @@ OpenGL::TextureFormat OpenGL::convertPixelFormat(PixelFormat pixelformat, bool r
 		break;
 		break;
 
 
 	default:
 	default:
-		printf("Unhandled pixel format when converting to OpenGL enums!");
+		printf("Unhandled pixel format %d when converting to OpenGL enums!", pixelformat);
 		break;
 		break;
 	}
 	}