mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Fix a potentially uninitialized value in love.graphics code. Minor cleanup.
This commit is contained in:
@@ -45,8 +45,6 @@ Canvas::Canvas(const Settings &settings)
|
||||
depth = settings.layers;
|
||||
else if (texType == TEXTURE_2D_ARRAY)
|
||||
layers = settings.layers;
|
||||
else
|
||||
layers = 1;
|
||||
|
||||
if (width <= 0 || height <= 0 || layers <= 0)
|
||||
throw love::Exception("Canvas dimensions must be greater than 0.");
|
||||
|
||||
@@ -371,6 +371,7 @@ public:
|
||||
RenderTarget()
|
||||
: canvas(nullptr)
|
||||
, slice(0)
|
||||
, mipmap(0)
|
||||
{}
|
||||
|
||||
bool operator != (const RenderTarget &other) const
|
||||
|
||||
@@ -1654,7 +1654,7 @@ OpenGL::TextureFormat OpenGL::convertPixelFormat(PixelFormat pixelformat, bool r
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("Unhandled pixel format when converting to OpenGL enums!");
|
||||
printf("Unhandled pixel format %d when converting to OpenGL enums!", pixelformat);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user