Add some new optional parameters to A_SprayDecal:
Some checks failed
Continuous Integration / macOS | Debug (push) Has been cancelled
Continuous Integration / Linux Clang 6 | Debug (push) Has been cancelled
Continuous Integration / Visual Studio 64-bit | Debug (push) Has been cancelled
Continuous Integration / Linux GCC 11 | MinSizeRel (push) Has been cancelled
Continuous Integration / Linux GCC 7 | RelWithDebInfo (push) Has been cancelled
Continuous Integration / Linux Clang 11 | Release (push) Has been cancelled
Continuous Integration / Visual Studio 64-bit | Release (push) Has been cancelled
Continuous Integration / macOS | Release (push) Has been cancelled
Some checks failed
Continuous Integration / macOS | Debug (push) Has been cancelled
Continuous Integration / Linux Clang 6 | Debug (push) Has been cancelled
Continuous Integration / Visual Studio 64-bit | Debug (push) Has been cancelled
Continuous Integration / Linux GCC 11 | MinSizeRel (push) Has been cancelled
Continuous Integration / Linux GCC 7 | RelWithDebInfo (push) Has been cancelled
Continuous Integration / Linux Clang 11 | Release (push) Has been cancelled
Continuous Integration / Visual Studio 64-bit | Release (push) Has been cancelled
Continuous Integration / macOS | Release (push) Has been cancelled
- useBloodColor: when true, the sprayed decal will be shaded to match the calling actor's blood color. - decalColor: when defined, the sprayed decal will be shaded to the specified color. Note that this will take precedence over useBloodColor. It is recommended to use only one parameter. Note that due to how decals work in the engine, the "decalColor" parameter will only properly colorize the decal if the image is grayscale.
This commit is contained in:
parent
7b31ba7cc8
commit
aeaa7f21c7
4 changed files with 9 additions and 5 deletions
|
|
@ -831,7 +831,7 @@ DBaseDecal *DImpactDecal::CloneSelf (const FDecalTemplate *tpl, double ix, doubl
|
|||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
void SprayDecal(AActor *shooter, const char *name, double distance, DVector3 offset, DVector3 direction)
|
||||
void SprayDecal(AActor *shooter, const char *name, double distance, DVector3 offset, DVector3 direction, bool useBloodColor, uint32_t decalColor)
|
||||
{
|
||||
//just in case
|
||||
if (!shooter)
|
||||
|
|
@ -859,12 +859,14 @@ void SprayDecal(AActor *shooter, const char *name, double distance, DVector3 off
|
|||
else
|
||||
dir = direction;
|
||||
|
||||
uint32_t bloodTrans = useBloodColor ? shooter->BloodTranslation : 0;
|
||||
PalEntry entry = !useBloodColor ? (PalEntry)decalColor : shooter->BloodColor;
|
||||
|
||||
if (Trace(off, shooter->Sector, dir, distance, 0, ML_BLOCKEVERYTHING, shooter, trace, TRACE_NoSky))
|
||||
{
|
||||
if (trace.HitType == TRACE_HitWall)
|
||||
{
|
||||
DImpactDecal::StaticCreate(shooter->Level, name, trace.HitPos, trace.Line->sidedef[trace.Side], NULL);
|
||||
DImpactDecal::StaticCreate(shooter->Level, name, trace.HitPos, trace.Line->sidedef[trace.Side], NULL, entry, bloodTrans);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue