- do not draw invalid textures.

This commit is contained in:
Christoph Oelckers 2019-10-18 19:29:35 +02:00
parent 9f357248e5
commit 2ed722f329

View file

@ -124,6 +124,7 @@ FHardwareTexture* GLInstance::LoadTexture(FTexture* tex, int textype, int palid)
bool GLInstance::SetTextureInternal(FTexture* tex, int palette, int method, int sampleroverride, float xpanning, float ypanning, FTexture *det, float detscale, FTexture *glow)
{
if (tex->GetWidth() <= 0 || tex->GetHeight() <= 0) return false;
int usepalette = fixpalette >= 1 ? fixpalette - 1 : curbasepal;
int usepalswap = fixpalswap >= 1 ? fixpalswap - 1 : palette;
GLInterface.SetPalette(usepalette);