Fixed bright sprites in sectors with Doom 64 lighting

https://forum.zdoom.org/viewtopic.php?t=58703
This commit is contained in:
alexey.lysiuk 2017-12-16 17:37:03 +02:00
parent f452184d82
commit 0afc09678f
2 changed files with 9 additions and 10 deletions

View file

@ -342,10 +342,9 @@ void GLSprite::Draw(int pass)
sector_t *cursec = actor ? actor->Sector : particle ? particle->subsector->sector : nullptr;
if (cursec != nullptr)
{
PalEntry finalcol(ThingColor.a,
ThingColor.r * cursec->SpecialColors[sector_t::sprites].r / 255,
ThingColor.g * cursec->SpecialColors[sector_t::sprites].g / 255,
ThingColor.b * cursec->SpecialColors[sector_t::sprites].b / 255);
const PalEntry finalcol = fullbright
? ThingColor
: ThingColor.Modulate(cursec->SpecialColors[sector_t::sprites]);
gl_RenderState.SetObjectColor(finalcol);
}

View file

@ -385,18 +385,18 @@ void GLSceneDrawer::DrawPlayerSprites(sector_t * viewsector, bool hudModelStep)
// now draw the different layers of the weapon.
// For stencil render styles brightmaps need to be disabled.
gl_RenderState.EnableBrightmap(!(RenderStyle.Flags & STYLEF_ColorIsFixed));
PalEntry finalcol(ThingColor.a,
ThingColor.r * viewsector->SpecialColors[sector_t::sprites].r / 255,
ThingColor.g * viewsector->SpecialColors[sector_t::sprites].g / 255,
ThingColor.b * viewsector->SpecialColors[sector_t::sprites].b / 255);
const bool bright = isBright(psp);
const PalEntry finalcol = bright
? ThingColor
: ThingColor.Modulate(viewsector->SpecialColors[sector_t::sprites]);
gl_RenderState.SetObjectColor(finalcol);
if (psp->GetState() != nullptr)
{
FColormap cmc = cm;
int ll = lightlevel;
if (isBright(psp))
if (bright)
{
if (fakesec == viewsector || in_area != area_below)
{