Skip to content

Commit

Permalink
Fixed bright sprites in sectors with Doom 64 lighting
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-lysiuk committed Dec 16, 2017
1 parent f452184 commit 0afc096
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
7 changes: 3 additions & 4 deletions src/gl/scene/gl_sprite.cpp
Expand Up @@ -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);
}
Expand Down
12 changes: 6 additions & 6 deletions src/gl/scene/gl_weapon.cpp
Expand Up @@ -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)
{
Expand Down Expand Up @@ -487,4 +487,4 @@ void GLSceneDrawer::DrawTargeterSprites()
{
if (psp->GetState() != nullptr) DrawPSprite(player, psp, psp->x, psp->y, false, 0, false);
}
}
}

0 comments on commit 0afc096

Please sign in to comment.