Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- make sure that incomplete multipatch textures are technically compl…
…ete.

They need a valid FTexture backing them and should have their name cleared so that nothing references them by accident.
  • Loading branch information
coelckers committed Jun 2, 2020
1 parent 8480a39 commit 8f07ab8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/common/textures/multipatchtexturebuilder.cpp
Expand Up @@ -923,7 +923,10 @@ void FMultipatchTextureBuilder::ResolveAllPatches()
for (auto &b : BuiltTextures)
{
Printf("%s\n", b.Name.GetChars());
// make it hard to find but also ensure that it references valid backing data.
b.texture->SetUseType(ETextureType::Null);
b.texture->SetBase(TexMan.GameByIndex(0)->GetTexture());
b.texture->SetName("");
}
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/rendering/hwrenderer/hw_precache.cpp
Expand Up @@ -104,7 +104,7 @@ void hw_PrecacheTexture(uint8_t *texhitlist, TMap<PClassActor*, bool> &actorhitl
for (int i = 1; i < TexMan.NumTextures(); i++)
{
auto gametex = TexMan.GameByIndex(i);
if (gametex &&
if (gametex && gametex->isValid() &&
gametex->GetTexture()->GetImage() && // only image textures are subject to precaching
gametex->GetUseType() != ETextureType::FontChar && // We do not want to delete font characters here as they are very likely to be needed constantly.
gametex->GetUseType() < ETextureType::Special) // Any texture marked as 'special' is also out.
Expand Down

0 comments on commit 8f07ab8

Please sign in to comment.