From 1f847301cbeb1f9e2ecc14654818c5afb94ea4cf Mon Sep 17 00:00:00 2001 From: Major Cooke Date: Tue, 14 Nov 2023 09:41:38 -0600 Subject: [PATCH] Updated ZSprites to use new translation code. --- src/playsim/p_effect.cpp | 9 +++++---- src/playsim/p_effect.h | 4 +++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/playsim/p_effect.cpp b/src/playsim/p_effect.cpp index efee1c5ba..fb9419e28 100644 --- a/src/playsim/p_effect.cpp +++ b/src/playsim/p_effect.cpp @@ -1003,7 +1003,8 @@ void DZSprite::Construct() LightLevel = -1; Texture = FTextureID(); Style = STYLE_Normal; - Translation = Flags = 0; + Flags = 0; + Translation = NO_TRANSLATION; sub = nullptr; cursector = nullptr; scolor = 0xffffff; @@ -1164,12 +1165,12 @@ void DZSprite::SetTranslation(FName trname) if (trname.GetChars()[0] == 0) { // '' removes it - Translation = 0; + Translation = NO_TRANSLATION; return; } - int tnum = R_FindCustomTranslation(trname); - if (tnum >= 0) + auto tnum = R_FindCustomTranslation(trname); + if (tnum != INVALID_TRANSLATION) { Translation = tnum; } diff --git a/src/playsim/p_effect.h b/src/playsim/p_effect.h index e79729d3b..b287db428 100644 --- a/src/playsim/p_effect.h +++ b/src/playsim/p_effect.h @@ -37,6 +37,7 @@ #include "doomdef.h" #include "renderstyle.h" #include "dthinker.h" +#include "palettecontainer.h" enum { @@ -146,6 +147,7 @@ void P_DisconnectEffect (AActor *actor); // //=========================================================================== class HWSprite; +struct FTranslationID; class DZSprite : public DThinker { DECLARE_CLASS(DZSprite, DThinker); @@ -159,7 +161,7 @@ public: FRenderStyle Style; FTextureID Texture; - uint32_t Translation; + FTranslationID Translation; uint16_t Flags; sector_t *cursector;