- Fixed: Textures with dimensions <= 0 are invalid and should be treated as NULL
textures. They also must be set to dimensions other than (0,0) to avoid division by zero errors. - Fixed: Random spawners did not handle the MF_DROPPED flag. SVN r1602 (trunk)
This commit is contained in:
parent
0c4c90ac89
commit
8034b0558e
3 changed files with 17 additions and 2 deletions
|
|
@ -1146,7 +1146,7 @@ FMultiPatchTexture::FMultiPatchTexture (FScanner &sc, int usetype)
|
|||
sc.MustGetNumber();
|
||||
Height = sc.Number;
|
||||
UseType = usetype;
|
||||
|
||||
|
||||
if (sc.CheckString("{"))
|
||||
{
|
||||
while (!sc.CheckString("}"))
|
||||
|
|
@ -1200,7 +1200,7 @@ FMultiPatchTexture::FMultiPatchTexture (FScanner &sc, int usetype)
|
|||
Parts = new TexPart[NumParts];
|
||||
memcpy(Parts, &parts[0], NumParts * sizeof(*Parts));
|
||||
|
||||
CalcBitSize ();
|
||||
//CalcBitSize ();
|
||||
|
||||
// If this texture is just a wrapper around a single patch, we can simply
|
||||
// forward GetPixels() and GetColumn() calls to that patch.
|
||||
|
|
@ -1216,6 +1216,16 @@ FMultiPatchTexture::FMultiPatchTexture (FScanner &sc, int usetype)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Width <= 0 || Height <= 0)
|
||||
{
|
||||
UseType = FTexture::TEX_Null;
|
||||
Printf("Texture %s has invalid dimensions (%d, %d)\n", Name, Width, Height);
|
||||
Width = Height = 1;
|
||||
}
|
||||
CalcBitSize ();
|
||||
|
||||
|
||||
sc.SetCMode(false);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue