Skip to content

Commit

Permalink
New "Translatable" property in DECALDEF which is just an alias for "O…
Browse files Browse the repository at this point in the history
…paqueBlood" to reflect its general use, and also to support the new translation parameter of A_SprayDecal. "OpaqueBlood" should be considered deprecated. Note that specifying a translation directly in the DECALDEF will be added in future, in another commit.
  • Loading branch information
nashmuhandes authored and RicardoLuis0 committed Jan 30, 2025
1 parent 864fe1f commit 5bcbe17
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
7 changes: 5 additions & 2 deletions src/gamedata/decallib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ static const char *DecalKeywords[] =
"colors",
"animator",
"lowerdecal",
"opaqueblood",
"opaqueblood", // Deprecated - use translatable instead!
"translatable",
NULL
};

Expand All @@ -198,6 +199,7 @@ enum
DECAL_ANIMATOR,
DECAL_LOWERDECAL,
DECAL_OPAQUEBLOOD,
DECAL_TRANSLATABLE,
};

const FDecalTemplate *FDecalBase::GetDecal () const
Expand Down Expand Up @@ -483,8 +485,9 @@ void FDecalLib::ParseDecal (FScanner &sc)
break;

case DECAL_OPAQUEBLOOD:
case DECAL_TRANSLATABLE:
newdecal.RenderStyle = STYLE_Normal;
newdecal.opaqueBlood = true;
newdecal.translatable = true;
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/gamedata/decallib.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class FDecalTemplate : public FDecalBase
FRenderStyle RenderStyle;
FTextureID PicNum;
uint16_t RenderFlags;
bool opaqueBlood;
bool translatable;
double Alpha; // same as actor->alpha
const FDecalAnimator *Animator;
const FDecalBase *LowerDecal;
Expand Down
8 changes: 4 additions & 4 deletions src/playsim/a_decals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -754,8 +754,8 @@ DBaseDecal* DImpactDecal::StaticCreate (FLevelLocals *Level, const FDecalTemplat
decal->SetShade (color.r, color.g, color.b);
}

// [Nash] opaque blood
if (translation != NO_TRANSLATION && tpl->ShadeColor == 0 && tpl->opaqueBlood)
// [Nash] Translatable opaque decal. Note that the decal must be unshaded for this to work.
if (translation != NO_TRANSLATION && tpl->ShadeColor == 0 && tpl->translatable)
{
decal->SetTranslation(translation);
decal->RenderStyle = STYLE_Normal;
Expand Down Expand Up @@ -794,8 +794,8 @@ DBaseDecal *DImpactDecal::CloneSelf (const FDecalTemplate *tpl, double ix, doubl
tpl->ApplyToDecal (decal, wall);
decal->AlphaColor = AlphaColor;

// [Nash] opaque blood
if (tpl->ShadeColor == 0 && tpl->opaqueBlood)
// [Nash] Translatable opaque decal
if (tpl->ShadeColor == 0 && tpl->translatable)
{
decal->SetTranslation(Translation);
decal->RenderStyle = STYLE_Normal;
Expand Down

0 comments on commit 5bcbe17

Please sign in to comment.