From ba04e982b2bcc60b2e6ad9758f821d4cc115b77e Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 29 Apr 2017 16:40:07 +0100 Subject: [PATCH] Make the temperature gauge for added WADs start at zero, not however much the mainwads provided. Also, mainwads now accounts for music_new, and that's added via DEVELOP instead of something we might forget to remove later. --- src/d_main.c | 9 +++++++-- src/filesrch.c | 1 + src/filesrch.h | 1 + src/m_menu.c | 10 +++++++--- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 94775557e..b386f1f2c 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -74,7 +74,7 @@ int snprintf(char *str, size_t n, const char *fmt, ...); #include "m_cond.h" // condition initialization #include "fastcmp.h" #include "keys.h" -#include "filesrch.h" // refreshdirmenu +#include "filesrch.h" // mainwadstally #ifdef CMAKECONFIG #include "config.h" @@ -876,7 +876,7 @@ static void IdentifyVersion(void) } #endif -#if 1 // This section can be deleted when music_new is merged with music.dta +#ifdef DEVELOP // This section can be deleted when music_new is merged with music.dta { const char *musicfile = "music_new.dta"; const char *musicpath = va(pandf,srb2waddir,musicfile); @@ -1174,6 +1174,11 @@ void D_SRB2Main(void) #ifdef USE_PATCH_DTA ++mainwads; // patch.dta adds one more #endif +#ifdef DEVELOP + ++mainwads; // music_new, too +#endif + + mainwadstally = packetsizetally; cht_Init(); diff --git a/src/filesrch.c b/src/filesrch.c index e5ab08f7d..75ba18d94 100644 --- a/src/filesrch.c +++ b/src/filesrch.c @@ -319,6 +319,7 @@ size_t dir_on[menudepth]; UINT8 refreshdirmenu = 0; size_t packetsizetally = 0; +size_t mainwadstally = 0; #if defined (_XBOX) && defined (_MSC_VER) filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *wantedmd5sum, diff --git a/src/filesrch.h b/src/filesrch.h index 34d6fac6f..3a5194571 100644 --- a/src/filesrch.h +++ b/src/filesrch.h @@ -37,6 +37,7 @@ extern size_t dir_on[menudepth]; extern UINT8 refreshdirmenu; extern size_t packetsizetally; +extern size_t mainwadstally; typedef enum { diff --git a/src/m_menu.c b/src/m_menu.c index f03917895..3267f08b7 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -4599,10 +4599,14 @@ static void M_DrawAddons(void) if (refreshdirmenu & M_AddonsRefresh()) return M_DrawMessageMenu(); - x = FixedDiv((packetsizetally< FRACUNIT) // happens because of how we're shrinkin' it a little - || (numwadfiles >= MAX_WADFILES)) // difficult to happen with current limits, but still worth thinking of + if (numwadfiles >= MAX_WADFILES) // difficult to happen with current limits, but still worth thinking of x = FRACUNIT; + else + { + x = FixedDiv(((packetsizetally-mainwadstally)< FRACUNIT) // happens because of how we're shrinkin' it a little + x = FRACUNIT; + } V_DrawRightAlignedString(BASEVIDWIDTH, BASEVIDHEIGHT-8, V_TRANSLUCENT, va("%d%%", (100*x)>>FRACBITS)); M_DrawTemperature(BASEVIDWIDTH - 12, x);