- 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->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)

View file

@ -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)

View file

@ -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;