Remove mLightParms

This commit is contained in:
Magnus Norddahl 2023-04-24 22:41:07 +02:00 committed by Christoph Oelckers
parent f80807d26a
commit 59c72e98a4
2 changed files with 11 additions and 14 deletions

View file

@ -235,7 +235,6 @@ protected:
int mTextureModeFlags; int mTextureModeFlags;
int mSoftLight; int mSoftLight;
int mLightMode = -1; int mLightMode = -1;
float mLightParms[4];
float mAlphaThreshold; float mAlphaThreshold;
float mClipSplit[2]; float mClipSplit[2];
@ -287,8 +286,10 @@ public:
mStreamData.uTextureAddColor = 0; mStreamData.uTextureAddColor = 0;
mStreamData.uTextureModulateColor = 0; mStreamData.uTextureModulateColor = 0;
mSoftLight = 0; mSoftLight = 0;
mLightParms[0] = mLightParms[1] = mLightParms[2] = 0.0f; mStreamData.uLightDist = 0.0f;
mLightParms[3] = -1.f; mStreamData.uLightFactor = 0.0f;
mStreamData.uFogDensity = 0.0f;
mStreamData.uLightLevel = -1.0f;
mSpecialEffect = EFF_NONE; mSpecialEffect = EFF_NONE;
mLightIndex = -1; mLightIndex = -1;
mBoneIndexBase = -1; mBoneIndexBase = -1;
@ -463,13 +464,13 @@ public:
void SetSoftLightLevel(int llevel, int blendfactor = 0) void SetSoftLightLevel(int llevel, int blendfactor = 0)
{ {
if (blendfactor == 0) mLightParms[3] = llevel / 255.f; if (blendfactor == 0) mStreamData.uLightLevel = llevel / 255.f;
else mLightParms[3] = -1.f; else mStreamData.uLightLevel = -1.f;
} }
void SetNoSoftLightLevel() void SetNoSoftLightLevel()
{ {
mLightParms[3] = -1.f; mStreamData.uLightLevel = -1.f;
} }
void SetLightMode(int lightmode) void SetLightMode(int lightmode)
@ -562,13 +563,13 @@ public:
const float LOG2E = 1.442692f; // = 1/log(2) const float LOG2E = 1.442692f; // = 1/log(2)
mFogColor = c; mFogColor = c;
mStreamData.uFogColor = mFogColor; mStreamData.uFogColor = mFogColor;
if (d >= 0.0f) mLightParms[2] = d * (-LOG2E / 64000.f); if (d >= 0.0f) mStreamData.uFogDensity = d * (-LOG2E / 64000.f);
} }
void SetLightParms(float f, float d) void SetLightParms(float f, float d)
{ {
mLightParms[1] = f; mStreamData.uLightFactor = f;
mLightParms[0] = d; mStreamData.uLightDist = d;
} }
PalEntry GetFogColor() const PalEntry GetFogColor() const

View file

@ -278,7 +278,7 @@ void VkRenderState::ApplyRenderPass(int dt)
pipelineKey.ShaderKey.SWLightRadial = (gl_fogmode == 2); pipelineKey.ShaderKey.SWLightRadial = (gl_fogmode == 2);
pipelineKey.ShaderKey.SWLightBanded = false; // gl_bandedswlight; pipelineKey.ShaderKey.SWLightBanded = false; // gl_bandedswlight;
float lightlevel = mLightParms[3]; float lightlevel = mStreamData.uLightLevel;
if (lightlevel < 0.0) if (lightlevel < 0.0)
{ {
pipelineKey.ShaderKey.LightMode = 0; // Default pipelineKey.ShaderKey.LightMode = 0; // Default
@ -395,10 +395,6 @@ void VkRenderState::ApplyStreamData()
else else
mStreamData.timer = 0.0f; mStreamData.timer = 0.0f;
mStreamData.uLightDist = mLightParms[0];
mStreamData.uLightFactor = mLightParms[1];
mStreamData.uFogDensity = mLightParms[2];
mStreamData.uLightLevel = mLightParms[3];
mStreamData.uAlphaThreshold = mAlphaThreshold; mStreamData.uAlphaThreshold = mAlphaThreshold;
mStreamData.uClipSplit = { mClipSplit[0], mClipSplit[1] }; mStreamData.uClipSplit = { mClipSplit[0], mClipSplit[1] };