diff --git a/src/f_wipe.c b/src/f_wipe.c index 4c3a067c6..2619d2cf6 100644 --- a/src/f_wipe.c +++ b/src/f_wipe.c @@ -98,7 +98,8 @@ static fixed_t paldiv; * \param lump Lump name to get data from * \return fademask_t for lump */ -static fademask_t *F_GetFadeMask(UINT8 masknum, UINT8 scrnnum) { +static fademask_t *F_GetFadeMask(UINT8 masknum, UINT8 scrnnum) +{ static char lumpname[9] = "FADEmmss"; static fademask_t fm = {NULL,0,0,0,0,0}; lumpnum_t lumpnum; @@ -148,6 +149,7 @@ static fademask_t *F_GetFadeMask(UINT8 masknum, UINT8 scrnnum) { case 0: // end marker (not bad!, but still need clearing) goto freemask; } + if (lsize != fm.size) fm.mask = Z_Realloc(fm.mask, lsize, PU_STATIC, NULL); fm.size = lsize; @@ -361,6 +363,7 @@ void F_RunWipe(UINT8 wipetype, boolean drawMenu) { // get fademask first so we can tell if it exists or not fmask = F_GetFadeMask(wipetype, wipeframe++); + if (!fmask) break; diff --git a/src/i_time.c b/src/i_time.c index 63fc8a88a..7fcbdf202 100644 --- a/src/i_time.c +++ b/src/i_time.c @@ -21,6 +21,8 @@ #include "m_fixed.h" #include "i_system.h" +#include "f_finale.h" + timestate_t g_time; static CV_PossibleValue_t timescale_cons_t[] = {{FRACUNIT/20, "MIN"}, {20*FRACUNIT, "MAX"}, {0, NULL}}; @@ -51,6 +53,10 @@ static void I_GetTimeAndFrac(tic_t *outtics, fixed_t *outfrac) tic_t I_GetTime(void) { + // Beware wipes run on their own loop which affects global time state! + if (WipeInAction) + return g_time.time; + tic_t tic; I_GetTimeAndFrac(&tic, NULL); return tic; @@ -58,6 +64,10 @@ tic_t I_GetTime(void) fixed_t I_GetTimeFrac(void) { + // Beware wipes run on their own loop which affects global time state! + if (WipeInAction) + return g_time.timefrac; + fixed_t frac; I_GetTimeAndFrac(NULL, &frac); return frac;