From 8593074d19353439acd729cf02a5ed2400e7f457 Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 14 May 2022 15:43:50 +0100 Subject: [PATCH] ANIMDEFS now only reports the "flats are disabled" warning for ANIMDEFs in the most recently loaded file. Notably, this means there are no warnings produced if an added file contains no errors, reducing even MORE of the friction the addons menu has been experiencing in devbuilds lately. --- src/p_spec.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index 3fe162bb6..cc1a0f8a9 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -164,6 +164,9 @@ void P_ParseAnimationDefintion(SINT8 istexture); * \sa P_FindAnimatedFlat, P_SetupLevelFlatAnims * \author Steven McGranahan (original), Shadow Hog (had to rewrite it to handle multiple WADs), JTE (had to rewrite it to handle multiple WADs _correctly_) */ + +static boolean animdeftempflats = false; // only until ANIMDEFS flats are removed + void P_InitPicAnims(void) { // Init animation @@ -183,6 +186,7 @@ void P_InitPicAnims(void) while (animdefsLumpNum != INT16_MAX) { + animdeftempflats = ((p_adding_file == INT16_MAX) || p_adding_file == w); P_ParseANIMDEFSLump(w, animdefsLumpNum); animdefsLumpNum = W_CheckNumForNamePwad("ANIMDEFS", (UINT16)w, animdefsLumpNum + 1); } @@ -204,7 +208,7 @@ void P_InitPicAnims(void) lastanim = anims; for (i = 0; animdefs[i].istexture != -1; i++) { - if (animdefs[i].istexture) + if (animdefs[i].istexture == 1) { if (R_CheckTextureNumForName(animdefs[i].startname) == -1) continue; @@ -214,11 +218,13 @@ void P_InitPicAnims(void) } else { - CONS_Alert(CONS_WARNING, "ANIMDEFS flats are disabled; flat support in general will be removed soon! (%s, %s)\n", animdefs[i].startname, animdefs[i].endname); + if (animdefs[i].istexture == 2) + { + CONS_Alert(CONS_WARNING, "ANIMDEFS flats are disabled; flat support in general will be removed soon! (%s, %s)\n", animdefs[i].startname, animdefs[i].endname); + } continue; } #if 0 - else { if ((W_CheckNumForName(animdefs[i].startname)) == LUMPERROR) continue; @@ -374,7 +380,10 @@ void P_ParseAnimationDefintion(SINT8 istexture) Z_Free(animdefsToken); // set texture type - animdefs[i].istexture = istexture; + if (istexture) + animdefs[i].istexture = 1; + else + animdefs[i].istexture = (animdeftempflats ? 2 : 0); // "RANGE" animdefsToken = M_GetToken(NULL);