mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-24 13:01:48 +00:00
- fixed overflow with storing a sprite's dynamic light color in a PalEntry.
This commit is contained in:
parent
9a6bc64381
commit
92185f96eb
3 changed files with 4 additions and 9 deletions
|
@ -141,7 +141,7 @@ bool FRenderState::ApplyShader()
|
||||||
activeShader->muLightParms.Set(mLightParms);
|
activeShader->muLightParms.Set(mLightParms);
|
||||||
activeShader->muFogColor.Set(mFogColor);
|
activeShader->muFogColor.Set(mFogColor);
|
||||||
activeShader->muObjectColor.Set(mObjectColor);
|
activeShader->muObjectColor.Set(mObjectColor);
|
||||||
activeShader->muDynLightColor.Set(mDynColor);
|
activeShader->muDynLightColor.Set(mDynColor.vec);
|
||||||
activeShader->muInterpolationFactor.Set(mInterpolationFactor);
|
activeShader->muInterpolationFactor.Set(mInterpolationFactor);
|
||||||
|
|
||||||
if (mGlowEnabled)
|
if (mGlowEnabled)
|
||||||
|
|
|
@ -65,7 +65,7 @@ class FRenderState
|
||||||
FStateVec4 mGlowTopPlane, mGlowBottomPlane;
|
FStateVec4 mGlowTopPlane, mGlowBottomPlane;
|
||||||
PalEntry mFogColor;
|
PalEntry mFogColor;
|
||||||
PalEntry mObjectColor;
|
PalEntry mObjectColor;
|
||||||
PalEntry mDynColor;
|
FStateVec4 mDynColor;
|
||||||
|
|
||||||
int mEffectState;
|
int mEffectState;
|
||||||
int mColormapState;
|
int mColormapState;
|
||||||
|
@ -184,12 +184,7 @@ public:
|
||||||
|
|
||||||
void SetDynLight(float r, float g, float b)
|
void SetDynLight(float r, float g, float b)
|
||||||
{
|
{
|
||||||
mDynColor = PalEntry(255, xs_CRoundToInt(r*255), xs_CRoundToInt(g*255), xs_CRoundToInt(b*255));
|
mDynColor.Set(r, g, b, 0);
|
||||||
}
|
|
||||||
|
|
||||||
void SetDynLight(PalEntry pe)
|
|
||||||
{
|
|
||||||
mDynColor = pe;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetObjectColor(PalEntry pe)
|
void SetObjectColor(PalEntry pe)
|
||||||
|
|
|
@ -186,7 +186,7 @@ class FShader
|
||||||
FUniform4f muColormapRange;
|
FUniform4f muColormapRange;
|
||||||
FBufferedUniform4i muLightRange;
|
FBufferedUniform4i muLightRange;
|
||||||
FBufferedUniformPE muFogColor;
|
FBufferedUniformPE muFogColor;
|
||||||
FBufferedUniformPE muDynLightColor;
|
FBufferedUniform4f muDynLightColor;
|
||||||
FBufferedUniformPE muObjectColor;
|
FBufferedUniformPE muObjectColor;
|
||||||
FUniform4f muGlowBottomColor;
|
FUniform4f muGlowBottomColor;
|
||||||
FUniform4f muGlowTopColor;
|
FUniform4f muGlowTopColor;
|
||||||
|
|
Loading…
Reference in a new issue