diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 0b6ac745d6..8e8e1e718e 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -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. diff --git a/src/g_shared/a_randomspawner.cpp b/src/g_shared/a_randomspawner.cpp index e54f31756a..579ccb30d2 100644 --- a/src/g_shared/a_randomspawner.cpp +++ b/src/g_shared/a_randomspawner.cpp @@ -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; diff --git a/src/textures/multipatchtexture.cpp b/src/textures/multipatchtexture.cpp index 3af98f224a..995046936a 100644 --- a/src/textures/multipatchtexture.cpp +++ b/src/textures/multipatchtexture.cpp @@ -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); }