mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-05-09 10:20:53 +00:00
limit light alpha mult to renderflag
This commit is contained in:
parent
80c36d4069
commit
83b4494c29
5 changed files with 5 additions and 2 deletions
|
@ -508,6 +508,7 @@ enum ActorRenderFlag2
|
||||||
RF2_ISOMETRICSPRITES = 0x0080,
|
RF2_ISOMETRICSPRITES = 0x0080,
|
||||||
RF2_SQUAREPIXELS = 0x0100, // apply +ROLLSPRITE scaling math so that non rolling sprites get the same scaling
|
RF2_SQUAREPIXELS = 0x0100, // apply +ROLLSPRITE scaling math so that non rolling sprites get the same scaling
|
||||||
RF2_STRETCHPIXELS = 0x0200, // don't apply SQUAREPIXELS for ROLLSPRITES
|
RF2_STRETCHPIXELS = 0x0200, // don't apply SQUAREPIXELS for ROLLSPRITES
|
||||||
|
RF2_LIGHTMULTALPHA = 0x0400, // attached lights use alpha as intensity multiplier
|
||||||
};
|
};
|
||||||
|
|
||||||
// This translucency value produces the closest match to Heretic's TINTTAB.
|
// This translucency value produces the closest match to Heretic's TINTTAB.
|
||||||
|
|
|
@ -92,7 +92,7 @@ void AddLightToList(FDynLightData &dld, int group, FDynamicLight * light, bool f
|
||||||
cs = 1.0f;
|
cs = 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (light->target)
|
if (light->target && (light->target->renderflags2 & RF2_LIGHTMULTALPHA))
|
||||||
cs *= (float)light->target->Alpha;
|
cs *= (float)light->target->Alpha;
|
||||||
|
|
||||||
float r = light->GetRed() / 255.0f * cs;
|
float r = light->GetRed() / 255.0f * cs;
|
||||||
|
|
|
@ -186,7 +186,7 @@ void HWDrawInfo::GetDynSpriteLight(AActor *self, float x, float y, float z, FSec
|
||||||
lg = light->GetGreen() / 255.0f;
|
lg = light->GetGreen() / 255.0f;
|
||||||
lb = light->GetBlue() / 255.0f;
|
lb = light->GetBlue() / 255.0f;
|
||||||
|
|
||||||
if (light->target)
|
if (light->target && (light->target->renderflags2 & RF2_LIGHTMULTALPHA))
|
||||||
{
|
{
|
||||||
float alpha = (float)light->target->Alpha;
|
float alpha = (float)light->target->Alpha;
|
||||||
lr *= alpha;
|
lr *= alpha;
|
||||||
|
|
|
@ -390,6 +390,7 @@ static FFlagDef ActorFlagDefs[]=
|
||||||
DEFINE_FLAG(RF2, ISOMETRICSPRITES, AActor, renderflags2),
|
DEFINE_FLAG(RF2, ISOMETRICSPRITES, AActor, renderflags2),
|
||||||
DEFINE_FLAG(RF2, SQUAREPIXELS, AActor, renderflags2),
|
DEFINE_FLAG(RF2, SQUAREPIXELS, AActor, renderflags2),
|
||||||
DEFINE_FLAG(RF2, STRETCHPIXELS, AActor, renderflags2),
|
DEFINE_FLAG(RF2, STRETCHPIXELS, AActor, renderflags2),
|
||||||
|
DEFINE_FLAG(RF2, LIGHTMULTALPHA, AActor, renderflags2),
|
||||||
|
|
||||||
// Bounce flags
|
// Bounce flags
|
||||||
DEFINE_FLAG2(BOUNCE_Walls, BOUNCEONWALLS, AActor, BounceFlags),
|
DEFINE_FLAG2(BOUNCE_Walls, BOUNCEONWALLS, AActor, BounceFlags),
|
||||||
|
|
|
@ -73,6 +73,7 @@ class DynamicLight : Actor
|
||||||
+FIXMAPTHINGPOS
|
+FIXMAPTHINGPOS
|
||||||
+INVISIBLE
|
+INVISIBLE
|
||||||
+NOTONAUTOMAP
|
+NOTONAUTOMAP
|
||||||
|
+LIGHTMULTALPHA
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
Loading…
Reference in a new issue