mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-29 07:22:07 +00:00
- added Doom64 colors for sprites.
This commit is contained in:
parent
ee22a9371b
commit
e96f231420
4 changed files with 22 additions and 9 deletions
|
@ -3891,7 +3891,8 @@ void FParser::SF_SetColor(void)
|
|||
for (int j = 0; j < 4; j++) level.sectors[i].SpecialColors[j] = color;
|
||||
// simulates 'nocoloredspritelighting' settings.
|
||||
int v = (color.r + color.g + color.b) / 3;
|
||||
level.sectors[i].SpecialColors[sector_t::sprites] = (255 + v + v) / 3;
|
||||
v = (255 + v + v) / 3;
|
||||
level.sectors[i].SpecialColors[sector_t::sprites] = PalEntry(255, v, v, v);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -377,7 +377,7 @@ void GLFlat::Draw(int pass, bool trans) // trans only has meaning for GLPASS_LIG
|
|||
{
|
||||
case GLPASS_PLAIN: // Single-pass rendering
|
||||
case GLPASS_ALL: // Same, but also creates the dynlight data.
|
||||
gl_SetColor(lightlevel, rel, Colormap,1.0f);
|
||||
gl_SetColor((sector->MoreFlags & SECF_SPECIALCOLORSABSOLUTE) ? 255 : lightlevel, rel, Colormap,1.0f);
|
||||
gl_SetFog(lightlevel, rel, &Colormap, false);
|
||||
gl_RenderState.SetObjectColor(FlatColor | 0xff000000);
|
||||
if (sector->special != GLSector_Skybox)
|
||||
|
@ -404,7 +404,7 @@ void GLFlat::Draw(int pass, bool trans) // trans only has meaning for GLPASS_LIG
|
|||
|
||||
case GLPASS_TRANSLUCENT:
|
||||
if (renderstyle==STYLE_Add) gl_RenderState.BlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||
gl_SetColor(lightlevel, rel, Colormap, alpha);
|
||||
gl_SetColor((sector->MoreFlags & SECF_SPECIALCOLORSABSOLUTE) ? 255 : lightlevel, rel, Colormap, alpha);
|
||||
gl_SetFog(lightlevel, rel, &Colormap, false);
|
||||
gl_RenderState.SetObjectColor(FlatColor | 0xff000000);
|
||||
if (!gltexture)
|
||||
|
|
|
@ -308,6 +308,7 @@ void GLSprite::Draw(int pass)
|
|||
gl_RenderState.AlphaFunc(GL_GEQUAL, gl_mask_sprite_threshold);
|
||||
gl_RenderState.SetColor(0.2f,0.2f,0.2f,fuzzalpha, Colormap.desaturation);
|
||||
additivefog = true;
|
||||
lightlist = nullptr; // the fuzz effect does not use the sector's light level so splitting is not needed.
|
||||
}
|
||||
else if (RenderStyle.BlendOp == STYLEOP_Add && RenderStyle.DestAlpha == STYLEALPHA_One)
|
||||
{
|
||||
|
@ -319,15 +320,21 @@ void GLSprite::Draw(int pass)
|
|||
glEnable(GL_POLYGON_OFFSET_FILL);
|
||||
glPolygonOffset(-1.0f, -128.0f);
|
||||
}
|
||||
if (RenderStyle.BlendOp!=STYLEOP_Shadow)
|
||||
if (RenderStyle.BlendOp != STYLEOP_Shadow)
|
||||
{
|
||||
if (gl_lights && GLRenderer->mLightCount && !gl_fixedcolormap && !fullbright)
|
||||
{
|
||||
gl_SetDynSpriteLight(gl_light_sprites ? actor : NULL, gl_light_particles ? particle : NULL);
|
||||
}
|
||||
gl_SetColor(lightlevel, rel, Colormap, trans);
|
||||
PalEntry finalcol(ThingColor.a,
|
||||
ThingColor.r * actor->Sector->SpecialColors[sector_t::sprites].r / 255,
|
||||
ThingColor.g * actor->Sector->SpecialColors[sector_t::sprites].g / 255,
|
||||
ThingColor.b * actor->Sector->SpecialColors[sector_t::sprites].b / 255);
|
||||
|
||||
gl_RenderState.SetObjectColor(finalcol);
|
||||
gl_SetColor((actor->Sector->MoreFlags & SECF_SPECIALCOLORSABSOLUTE) ? 255 : lightlevel, rel, Colormap, trans);
|
||||
}
|
||||
gl_RenderState.SetObjectColor(ThingColor);
|
||||
|
||||
|
||||
if (gl_isBlack(Colormap.FadeColor)) foglevel=lightlevel;
|
||||
|
||||
|
@ -394,7 +401,7 @@ void GLSprite::Draw(int pass)
|
|||
thiscm.Decolorize();
|
||||
}
|
||||
|
||||
gl_SetColor(thisll, rel, thiscm, trans);
|
||||
gl_SetColor((actor->Sector->MoreFlags & SECF_SPECIALCOLORSABSOLUTE) ? 255 : thisll, rel, thiscm, trans);
|
||||
if (!foglayer)
|
||||
{
|
||||
gl_SetFog(thislight, rel, &thiscm, additivefog);
|
||||
|
|
|
@ -370,7 +370,12 @@ void FGLRenderer::DrawPlayerSprites(sector_t * viewsector, bool hudModelStep)
|
|||
|
||||
// now draw the different layers of the weapon
|
||||
gl_RenderState.EnableBrightmap(true);
|
||||
gl_RenderState.SetObjectColor(ThingColor);
|
||||
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);
|
||||
|
||||
gl_RenderState.SetObjectColor(finalcol);
|
||||
gl_RenderState.AlphaFunc(GL_GEQUAL, gl_mask_sprite_threshold);
|
||||
|
||||
// hack alert! Rather than changing everything in the underlying lighting code let's just temporarily change
|
||||
|
@ -412,7 +417,7 @@ void FGLRenderer::DrawPlayerSprites(sector_t * viewsector, bool hudModelStep)
|
|||
{
|
||||
gl_SetDynSpriteLight(playermo, NULL);
|
||||
}
|
||||
gl_SetColor(ll, 0, cmc, trans, true);
|
||||
gl_SetColor((viewsector->MoreFlags & SECF_SPECIALCOLORSABSOLUTE) ? 255 : ll, 0, cmc, trans, true);
|
||||
}
|
||||
|
||||
if (psp->firstTic)
|
||||
|
|
Loading…
Reference in a new issue