From 2ee595419c89a494203f61aa2cadc7c60c8927b4 Mon Sep 17 00:00:00 2001 From: James R Date: Sat, 9 Mar 2024 15:35:06 -0800 Subject: [PATCH] Let texture loading skip some textures - Set numtextures correctly if textures are skipped (no textures are skipped in this commit) --- src/r_textures.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/r_textures.c b/src/r_textures.c index 971b63ab9..ea1033c84 100644 --- a/src/r_textures.c +++ b/src/r_textures.c @@ -1491,13 +1491,6 @@ void R_LoadTextures(void) for (w = 0; w < numwadfiles; w++) { newtextures += R_CountTextures((UINT16)w); - -#ifdef DEVELOP - if (w == mainwads) - { - maintextures = newtextures; - } -#endif } // If no textures found by this point, bomb out @@ -1509,9 +1502,16 @@ void R_LoadTextures(void) for (i = 0, w = 0; w < numwadfiles; w++) { i = R_DefineTextures(i, w); + +#ifdef DEVELOP + if (w == mainwads) + { + maintextures = i; + } +#endif } - R_FinishLoadingTextures(newtextures); + R_FinishLoadingTextures(i); #ifdef DEVELOP R_CheckTextureDuplicates(0, maintextures); @@ -1523,7 +1523,7 @@ void R_LoadTexturesPwad(UINT16 wadnum) INT32 newtextures = R_CountTextures(wadnum); R_AllocateTextures(newtextures); - R_DefineTextures(numtextures, wadnum); + newtextures = R_DefineTextures(numtextures, wadnum); R_FinishLoadingTextures(newtextures); }