Warn when images cannot be used for a cubemap.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5836 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2021-05-09 13:00:49 +00:00
parent b8667546c9
commit 43bff54529

View file

@ -13529,7 +13529,7 @@ static struct pendingtextureinfo *Image_LoadCubemapTextureData(const char *nicen
int bb,bw,bh, bd; int bb,bw,bh, bd;
Image_BlockSizeForEncoding(format, &bb, &bw, &bh, &bd); Image_BlockSizeForEncoding(format, &bb, &bw, &bh, &bd);
if (needsflipping && (bw!=1 || bh!=1 || bd!=1)) if (needsflipping && (bw!=1 || bh!=1 || bd!=1))
/*can't do it*/; Con_Printf(CON_WARNING"%s: %s requires flipping, which is unsupported with pixel format %s\n", nicename, fname, Image_FormatName(format)); /*can't do it*/
else if (width == height && (!mips || width == mips->mip[0].width)) //cubemaps must be square and all the same size (npot is fine though) else if (width == height && (!mips || width == mips->mip[0].width)) //cubemaps must be square and all the same size (npot is fine though)
{ //(skies have a fallback for invalid sizes, but it'll run a bit slower) { //(skies have a fallback for invalid sizes, but it'll run a bit slower)
@ -13556,6 +13556,13 @@ static struct pendingtextureinfo *Image_LoadCubemapTextureData(const char *nicen
BZ_Free(buf); BZ_Free(buf);
goto nextface; goto nextface;
} }
else
{
if (mips)
Con_Printf(CON_WARNING"%s: %s has inconsistent dimensions (%i*%i, must be %i*%i)\n", nicename, fname, width, height, mips->mip[0].width, mips->mip[0].height);
else
Con_Printf(CON_WARNING"%s: %s has inconsistent dimensions (%i*%i, must be square)\n", nicename, fname, width, height);
}
BZ_Free(data); BZ_Free(data);
} }
BZ_Free(buf); BZ_Free(buf);