Use FImageTexture for thre null texture

FDummyTexture had a big problem: Whenever it was accessed by accident it crashed the app because it wasn't fully implemented.

What it should do is return empty pixels of the given size, and an unextended FImageTexture is doing just that.
This commit is contained in:
Christoph Oelckers 2018-12-10 02:50:22 +01:00
commit 0d07fb2550
4 changed files with 13 additions and 31 deletions

View file

@ -364,7 +364,7 @@ void FMultipatchTextureBuilder::AddTexturesLump(const void *lumpdata, int lumpsi
// It still needs to be created in case someone uses it by name.
offset = LittleLong(directory[1]);
const maptexture_t *tex = (const maptexture_t *)((const uint8_t *)maptex + offset);
FDummyTexture *tex0 = static_cast<FDummyTexture *>(TexMan.ByIndex(0));
FTexture *tex0 = TexMan.ByIndex(0);
tex0->SetSize(SAFESHORT(tex->width), SAFESHORT(tex->height));
}