From 0c63e44cea863248034fc16219188d4ac2420e0e Mon Sep 17 00:00:00 2001 From: Marco Z Date: Fri, 30 Mar 2018 16:17:35 -0400 Subject: [PATCH] fade_t fields --- src/p_saveg.c | 20 ++++++-------------- src/p_spec.c | 19 ++++++++----------- src/p_spec.h | 10 +++------- 3 files changed, 17 insertions(+), 32 deletions(-) diff --git a/src/p_saveg.c b/src/p_saveg.c index 5542b3cda..eb76fede5 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -1561,15 +1561,11 @@ static void SaveDisappearThinker(const thinker_t *th, const UINT8 type) static void SaveFadeThinker(const thinker_t *th, const UINT8 type) { const fade_t *ht = (const void *)th; - // \todo fields WRITEUINT8(save_p, type); - WRITEUINT32(save_p, ht->appeartime); - WRITEUINT32(save_p, ht->disappeartime); - WRITEUINT32(save_p, ht->offset); - WRITEUINT32(save_p, ht->timer); WRITEINT32(save_p, ht->affectee); - WRITEINT32(save_p, ht->sourceline); - WRITEINT32(save_p, ht->exists); + WRITEINT32(save_p, ht->destvalue); + WRITEINT32(save_p, ht->speed); + WRITEUINT8(save_p, ht->ignoreflags); } // @@ -2564,14 +2560,10 @@ static inline void LoadFadeThinker(actionf_p1 thinker) { fade_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL); ht->thinker.function.acp1 = thinker; - // \todo fields - ht->appeartime = READUINT32(save_p); - ht->disappeartime = READUINT32(save_p); - ht->offset = READUINT32(save_p); - ht->timer = READUINT32(save_p); ht->affectee = READINT32(save_p); - ht->sourceline = READINT32(save_p); - ht->exists = READINT32(save_p); + ht->destvalue = READINT32(save_p); + ht->speed = READINT32(save_p); + ht->ignoreflags = READUINT8(save_p); P_AddThinker(&ht->thinker); } diff --git a/src/p_spec.c b/src/p_spec.c index b1ede46d8..43dba0dc3 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -7058,23 +7058,20 @@ void T_Disappear(disappear_t *d) /** Adds master fader thinker. * - * \param appeartime tics to be existent - * \param disappeartime tics to be nonexistent - * \param sector pointer to control sector + * \param destvalue transparency value to fade to + * \param speed speed to fade by + * \param ignoreexists do not handle FF_EXISTS + * \param line line to target FOF */ -static void P_AddMasterFader(tic_t appeartime, tic_t disappeartime, tic_t offset, INT32 line, INT32 sourceline) +static void P_AddMasterFader(INT32 destvalue, INT32 speed, BOOL ignoreflags, INT32 line) { fade_t *d = Z_Malloc(sizeof *d, PU_LEVSPEC, NULL); - // \todo fields d->thinker.function.acp1 = (actionf_p1)T_Disappear; - d->appeartime = appeartime; - d->disappeartime = disappeartime; - d->offset = offset; d->affectee = line; - d->sourceline = sourceline; - d->exists = true; - d->timer = 1; + d->destvalue = destvalue; + d->speed = speed; + d->ignoreflags = (UINT8)ignoreflags; P_AddThinker(&d->thinker); } diff --git a/src/p_spec.h b/src/p_spec.h index 3ed66f149..355f0c111 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -452,15 +452,11 @@ void T_Disappear(disappear_t *d); // Model for fading FOFs typedef struct { - // \todo fields thinker_t thinker; ///< Thinker structure for effect. - tic_t appeartime; ///< Tics to be appeared for - tic_t disappeartime;///< Tics to be disappeared for - tic_t offset; ///< Time to wait until thinker starts - tic_t timer; ///< Timer between states INT32 affectee; ///< Number of affected line - INT32 sourceline; ///< Number of source line - INT32 exists; ///< Exists toggle + INT32 destvalue; ///< Transparency value to fade to + INT32 speed; ///< Speed to fade by + UINT8 ignoreflags; ///< Do not handle FF_EXISTS } fade_t; void T_Fade(fade_t *d);