mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 15:22:15 +00:00
Fixed bright sprites in sectors with Doom 64 lighting
https://forum.zdoom.org/viewtopic.php?t=58703
This commit is contained in:
parent
f452184d82
commit
0afc09678f
2 changed files with 9 additions and 10 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
@ -487,4 +487,4 @@ void GLSceneDrawer::DrawTargeterSprites()
|
|||
{
|
||||
if (psp->GetState() != nullptr) DrawPSprite(player, psp, psp->x, psp->y, false, 0, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue