mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 08:51:24 +00:00
- handle fullbright sprite hackery using negative shade values.
This commit is contained in:
parent
bf019ac028
commit
89be30b720
1 changed files with 4 additions and 4 deletions
|
@ -400,12 +400,12 @@ inline void SetSpriteTranslucency(const spritetype* sprite, float& alpha, FRende
|
|||
extern PalEntry GlobalMapFog;
|
||||
extern float GlobalFogDensity;
|
||||
|
||||
__forceinline void SetLightAndFog(FRenderState& state, PalEntry fade, int palette, int shade, int visibility, float alpha, bool setcolor = true)
|
||||
__forceinline void SetLightAndFog(FRenderState& state, PalEntry fade, int palette, int orgshade, int visibility, float alpha, bool setcolor = true)
|
||||
{
|
||||
// Fog must be done before the texture so that the texture selector can override it.
|
||||
bool foggy = (GlobalMapFog || (fade & 0xffffff));
|
||||
auto ShadeDiv = lookups.tables[palette].ShadeFactor;
|
||||
shade = clamp(shade, 0, numshades - 1);
|
||||
int shade = clamp(orgshade, 0, numshades - 1);
|
||||
// Disable brightmaps if non-black fog is used.
|
||||
if (ShadeDiv >= 1 / 1000.f && foggy)
|
||||
{
|
||||
|
@ -415,12 +415,12 @@ __forceinline void SetLightAndFog(FRenderState& state, PalEntry fade, int palett
|
|||
state.SetSoftLightLevel(255);
|
||||
state.SetLightParms(128.f, 1 / 1000.f);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
state.EnableFog(0);
|
||||
state.SetFog(0, 0);
|
||||
state.SetSoftLightLevel(gl_fogmode != 0 && ShadeDiv >= 1 / 1000.f ? 255 - Scale(shade, 255, numshades) : 255);
|
||||
state.SetLightParms(visibility, ShadeDiv / (numshades - 2));
|
||||
state.SetLightParms(visibility, orgshade < -numshades / 2 ? 1 / 1000.f : ShadeDiv / (numshades - 2));
|
||||
}
|
||||
|
||||
// The shade rgb from the tint is ignored here.
|
||||
|
|
Loading…
Reference in a new issue