Skip to content

Commit

Permalink
Fix wording of some error checks in setCanvas.
Browse files Browse the repository at this point in the history
  • Loading branch information
slime73 committed Jul 15, 2024
1 parent b99fce2 commit 72af731
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/modules/graphics/Graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1050,10 +1050,10 @@ void Graphics::setRenderTargets(const RenderTargets &rts)
firstcolorformat = rts.colors[0].texture->getPixelFormat();

if (!firsttex->isRenderTarget())
throw love::Exception("Texture must be created as a render target to be used in setRenderTargets.");
throw love::Exception("Texture must be created as a canvas to be used in setCanvas.");

if (isPixelFormatDepthStencil(firstcolorformat))
throw love::Exception("Depth/stencil format textures must be used with the 'depthstencil' field of the table passed into setRenderTargets.");
throw love::Exception("Depth/stencil format textures must be used with the 'depthstencil' field of the table passed into setCanvas.");

if (firsttarget.mipmap < 0 || firsttarget.mipmap >= firsttex->getMipmapCount())
throw love::Exception("Invalid mipmap level %d.", firsttarget.mipmap + 1);
Expand All @@ -1074,7 +1074,7 @@ void Graphics::setRenderTargets(const RenderTargets &rts)
int slice = rts.colors[i].slice;

if (!c->isRenderTarget())
throw love::Exception("Texture must be created as a render target to be used in setRenderTargets.");
throw love::Exception("Texture must be created as a canvas to be used in setCanvas.");

if (mip < 0 || mip >= c->getMipmapCount())
throw love::Exception("Invalid mipmap level %d.", mip + 1);
Expand All @@ -1089,7 +1089,7 @@ void Graphics::setRenderTargets(const RenderTargets &rts)
throw love::Exception("All textures must have the same MSAA value.");

if (isPixelFormatDepthStencil(format))
throw love::Exception("Depth/stencil format textures must be used with the 'depthstencil' field of the table passed into setRenderTargets.");
throw love::Exception("Depth/stencil format textures must be used with the 'depthstencil' field of the table passed into setCanvas.");

if (isPixelFormatSRGB(format))
hasSRGBtexture = true;
Expand All @@ -1102,10 +1102,10 @@ void Graphics::setRenderTargets(const RenderTargets &rts)
int slice = rts.depthStencil.slice;

if (!c->isRenderTarget())
throw love::Exception("Texture must be created as a render target to be used in setRenderTargets.");
throw love::Exception("Texture must be created as a canvas to be used in setCanvas.");

if (!isPixelFormatDepthStencil(c->getPixelFormat()))
throw love::Exception("Only depth/stencil format textures can be used with the 'depthstencil' field of the table passed into setRenderTargets.");
throw love::Exception("Only depth/stencil format textures can be used with the 'depthstencil' field of the table passed into setCanvas.");

if (c->getPixelWidth(mip) != pixelw || c->getPixelHeight(mip) != pixelh)
throw love::Exception("All Textures must have the same pixel dimensions.");
Expand Down

0 comments on commit 72af731

Please sign in to comment.