Updated ZSprites to use new translation code.

This commit is contained in:
Major Cooke 2023-11-14 09:41:38 -06:00 committed by Rachael Alexanderson
parent 8fcd2c5f43
commit 1f847301cb
2 changed files with 8 additions and 5 deletions

View file

@ -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;
}

View file

@ -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;