This commit is contained in:
Rachael Alexanderson 2016-10-26 06:10:52 -04:00
commit 692a0034b4
3 changed files with 17 additions and 9 deletions

View file

@ -297,8 +297,6 @@ FMultiPatchTexture::FMultiPatchTexture (const void *texdef, FPatchLookup *patchl
Printf ("Texture %s is left without any patches\n", Name.GetChars());
}
CheckForHacks ();
DefinitionLump = deflumpnum;
}
@ -1328,7 +1326,7 @@ void FMultiPatchTexture::ResolvePatches()
if (texno == id) // we found ourselves. Try looking for another one with the same name which is not a multipatch texture itself.
{
TArray<FTextureID> list;
TexMan.ListTextures(Inits[i].TexName, list);
TexMan.ListTextures(Inits[i].TexName, list, true);
for (int i = list.Size() - 1; i >= 0; i--)
{
if (list[i] != id && !TexMan[list[i]]->bMultiPatch)
@ -1342,6 +1340,11 @@ void FMultiPatchTexture::ResolvePatches()
if (Inits[i].HasLine) Inits[i].sc.Message(MSG_WARNING, "Texture '%s' references itself as patch\n", Inits[i].TexName.GetChars());
else Printf(TEXTCOLOR_YELLOW "Texture '%s' references itself as patch\n", Inits[i].TexName.GetChars());
}
else
{
// If it could be resolved, just print a developer warning.
DPrintf(DMSG_WARNING, "Resolved self-referencing texture by picking an older entry for %s", Inits[i].TexName.GetChars());
}
}
if (!texno.isValid())
@ -1372,6 +1375,8 @@ void FMultiPatchTexture::ResolvePatches()
delete[] Inits;
Inits = nullptr;
CheckForHacks();
// If this texture is just a wrapper around a single patch, we can simply
// forward GetPixels() and GetColumn() calls to that patch.