Skip to content

Commit

Permalink
Fixed: loadPatchCompositeDefs failed to pass the non-drawable flag
Browse files Browse the repository at this point in the history
from an IWAD original texture to any replacement in a PWAD. Fixes
the problem of supposedly non-drawable Materials being stripped of
this property after loading a PWAD which duplicates the content of
TEXTURE1 in its entirety (e.g., 2002ado.wad).
  • Loading branch information
danij-deng committed Sep 17, 2011
1 parent a0cb481 commit 56e7fca
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion doomsday/engine/portable/src/r_data.c
Expand Up @@ -1848,11 +1848,14 @@ static void loadPatchCompositeDefs(void)
if(!Str_CompareIgnoreCase(&orig->name, Str_Text(&custom->name)))
{ // This is a newer version of an IWAD doomtexturedef.
if(!(custom->flags & TXDF_IWAD))
{
hasReplacement = true; // Uses a non-IWAD patch.
}
else if(custom->height == orig->height &&
custom->width == orig->width &&
custom->patchCount == orig->patchCount)
{ // Check the patches.
{
// Check the patches.
short k = 0;

while(k < orig->patchCount && (custom->flags & TXDF_IWAD))
Expand All @@ -1867,12 +1870,17 @@ static void loadPatchCompositeDefs(void)
custom->flags &= ~TXDF_IWAD;
}
else
{
k++;
}
}

hasReplacement = true;
}

// The non-drawable flag must pass to the replacement.
if(hasReplacement && (orig->flags & TXDF_NODRAW))
custom->flags |= TXDF_NODRAW;
break;
}
}
Expand Down

0 comments on commit 56e7fca

Please sign in to comment.