- 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:
Christoph Oelckers 2009-05-24 07:58:57 +00:00
parent 0c4c90ac89
commit 8034b0558e
3 changed files with 17 additions and 2 deletions

View file

@ -8,6 +8,10 @@
mouse input would be frozen until the mouse was ungrabbed again.
May 23, 2009 (Changes by Graf Zahl)
- 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.
- Fixed: When setting up a deep water sector with Transfer_Heights the floorclip
information of all actors in the sector needs to be updated.

View file

@ -80,6 +80,7 @@ class ARandomSpawner : public AActor
newmobj->target = target;
newmobj->tracer = tracer;
newmobj->CopyFriendliness(this, false);
if (!(flags & MF_DROPPED)) newmobj->flags &= ~MF_DROPPED;
// Special1 is used to count how many recursions we're in.
if (newmobj->IsKindOf(PClass::FindClass("RandomSpawner")))
newmobj->special1 = ++special1;

View file

@ -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);
}