- fixed overflow with storing a sprite's dynamic light color in a PalEntry.

This commit is contained in:
Christoph Oelckers 2014-07-01 09:52:41 +02:00
parent 9a6bc64381
commit 92185f96eb
3 changed files with 4 additions and 9 deletions

View file

@ -141,7 +141,7 @@ bool FRenderState::ApplyShader()
activeShader->muLightParms.Set(mLightParms);
activeShader->muFogColor.Set(mFogColor);
activeShader->muObjectColor.Set(mObjectColor);
activeShader->muDynLightColor.Set(mDynColor);
activeShader->muDynLightColor.Set(mDynColor.vec);
activeShader->muInterpolationFactor.Set(mInterpolationFactor);
if (mGlowEnabled)

View file

@ -65,7 +65,7 @@ class FRenderState
FStateVec4 mGlowTopPlane, mGlowBottomPlane;
PalEntry mFogColor;
PalEntry mObjectColor;
PalEntry mDynColor;
FStateVec4 mDynColor;
int mEffectState;
int mColormapState;
@ -184,12 +184,7 @@ public:
void SetDynLight(float r, float g, float b)
{
mDynColor = PalEntry(255, xs_CRoundToInt(r*255), xs_CRoundToInt(g*255), xs_CRoundToInt(b*255));
}
void SetDynLight(PalEntry pe)
{
mDynColor = pe;
mDynColor.Set(r, g, b, 0);
}
void SetObjectColor(PalEntry pe)

View file

@ -186,7 +186,7 @@ class FShader
FUniform4f muColormapRange;
FBufferedUniform4i muLightRange;
FBufferedUniformPE muFogColor;
FBufferedUniformPE muDynLightColor;
FBufferedUniform4f muDynLightColor;
FBufferedUniformPE muObjectColor;
FUniform4f muGlowBottomColor;
FUniform4f muGlowTopColor;