From 5585edf4599efccfafb3d5ae93c2b91466d0adf2 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Sat, 15 Sep 2018 01:04:15 -0400 Subject: [PATCH] 453: Mixed D+C fixes; unused param cast in P_FadeFakeFloor --- src/p_saveg.c | 3 ++- src/p_spec.c | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/p_saveg.c b/src/p_saveg.c index 5b1cc5b27..7d6215643 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -2621,6 +2621,7 @@ static inline void LoadDisappearThinker(actionf_p1 thinker) // static inline void LoadFadeThinker(actionf_p1 thinker) { + sector_t *ss; fade_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL); ht->thinker.function.acp1 = thinker; ht->dest_exc = LoadExtraColormap(save_p); @@ -2641,7 +2642,7 @@ static inline void LoadFadeThinker(actionf_p1 thinker) ht->doghostfade = READUINT8(save_p); ht->exactalpha = READUINT8(save_p); - sector_t *ss = LoadSector(ht->sectornum); + ss = LoadSector(ht->sectornum); if (ss) { size_t j = 0; // ss->ffloors is saved as ffloor #0, ss->ffloors->next is #1, etc diff --git a/src/p_spec.c b/src/p_spec.c index 87146ab54..30eb393dd 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -7574,6 +7574,7 @@ static boolean P_FadeFakeFloor(ffloor_t *rover, INT16 sourcevalue, INT16 destval boolean stillfading = false; INT32 alpha; fade_t *fadingdata = (fade_t *)rover->fadingdata; + (void)docolormap; // *shrug* maybe we can use this in the future. For now, let's be consistent with our other function params if (rover->master->special == 258) // Laser block return false; @@ -7832,6 +7833,8 @@ static void P_AddFakeFloorFader(ffloor_t *rover, size_t sectornum, size_t ffloor boolean doexists, boolean dotranslucent, boolean dolighting, boolean docolormap, boolean docollision, boolean doghostfade, boolean exactalpha) { + fade_t *d; + // If fading an invisible FOF whose render flags we did not yet set, // initialize its alpha to 1 if (dotranslucent && @@ -7845,7 +7848,7 @@ static void P_AddFakeFloorFader(ffloor_t *rover, size_t sectornum, size_t ffloor if (rover->alpha == max(1, min(256, relative ? rover->alpha + destvalue : destvalue))) return; - fade_t *d = Z_Malloc(sizeof *d, PU_LEVSPEC, NULL); + d = Z_Malloc(sizeof *d, PU_LEVSPEC, NULL); d->thinker.function.acp1 = (actionf_p1)T_Fade; d->rover = rover;