From c078dfcbe7ae44b2e5ab3e51af90203a44cd5b43 Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Thu, 12 Mar 2020 12:16:11 +0100 Subject: [PATCH] substitute missing patches in textures with "TNT1A0" Also, initialize composite background so that missing patches appear as black areas. --- Source/r_data.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/r_data.c b/Source/r_data.c index d32730af..caea26c8 100644 --- a/Source/r_data.c +++ b/Source/r_data.c @@ -192,6 +192,9 @@ static void R_GenerateComposite(int texnum) // killough 4/9/98: marks to identify transparent regions in merged textures byte *marks = calloc(texture->width, texture->height), *source; + // [crispy] initialize composite background + memset(block, 0, texturecompositesize[texnum]); + for (; --i >=0; patch++) { patch_t *realpatch = W_CacheLumpNum(patch->patch, PU_CACHE); @@ -602,7 +605,7 @@ void R_InitTextures (void) SHORT(mpatch->patch), texture->name); // killough 4/17/98 // [FG] treat missing patches as non-fatal, substitute dummy patch // ++errors; - patch->patch = 0; + patch->patch = (W_CheckNumForName)("TNT1A0", ns_sprites); } }