- removed some unused content from FGLRenderState.

This commit is contained in:
Christoph Oelckers 2018-10-20 13:11:03 +02:00
parent 9a03ba3cc5
commit 4603d01ba1
2 changed files with 5 additions and 48 deletions

View file

@ -38,8 +38,6 @@
#include "gl/renderer/gl_renderbuffers.h" #include "gl/renderer/gl_renderbuffers.h"
#include "gl/textures/gl_hwtexture.h" #include "gl/textures/gl_hwtexture.h"
void gl_SetTextureMode(int type);
FGLRenderState gl_RenderState; FGLRenderState gl_RenderState;
CVAR(Bool, gl_direct_state_change, true, 0) CVAR(Bool, gl_direct_state_change, true, 0)
@ -63,8 +61,6 @@ void FGLRenderState::Reset()
{ {
mTextureEnabled = true; mTextureEnabled = true;
mSplitEnabled = mBrightmapEnabled = mFogEnabled = mGlowEnabled = false; mSplitEnabled = mBrightmapEnabled = mFogEnabled = mGlowEnabled = false;
mColorMask[0] = mColorMask[1] = mColorMask[2] = mColorMask[3] = true;
currentColorMask[0] = currentColorMask[1] = currentColorMask[2] = currentColorMask[3] = true;
mFogColor.d = -1; mFogColor.d = -1;
mTextureMode = -1; mTextureMode = -1;
mDesaturation = 0; mDesaturation = 0;
@ -253,8 +249,6 @@ void FGLRenderState::Apply()
} }
} }
//ApplyColorMask(); I don't think this is needed.
if (mVertexBuffer != mCurrentVertexBuffer) if (mVertexBuffer != mCurrentVertexBuffer)
{ {
if (mVertexBuffer == NULL) glBindBuffer(GL_ARRAY_BUFFER, 0); if (mVertexBuffer == NULL) glBindBuffer(GL_ARRAY_BUFFER, 0);
@ -266,21 +260,6 @@ void FGLRenderState::Apply()
void FGLRenderState::ApplyColorMask()
{
if ((mColorMask[0] != currentColorMask[0]) ||
(mColorMask[1] != currentColorMask[1]) ||
(mColorMask[2] != currentColorMask[2]) ||
(mColorMask[3] != currentColorMask[3]))
{
glColorMask(mColorMask[0], mColorMask[1], mColorMask[2], mColorMask[3]);
currentColorMask[0] = mColorMask[0];
currentColorMask[1] = mColorMask[1];
currentColorMask[2] = mColorMask[2];
currentColorMask[3] = mColorMask[3];
}
}
void FGLRenderState::ApplyLightIndex(int index) void FGLRenderState::ApplyLightIndex(int index)
{ {
if (index > -1 && GLRenderer->mLights->GetBufferType() == GL_UNIFORM_BUFFER) if (index > -1 && GLRenderer->mLights->GetBufferType() == GL_UNIFORM_BUFFER)

View file

@ -72,16 +72,17 @@ enum EPassType
MAX_PASS_TYPES MAX_PASS_TYPES
}; };
class FGLRenderState class FRenderState
{
};
class FGLRenderState : public FRenderState
{ {
friend void gl_SetTextureMode(int type);
bool mTextureEnabled; bool mTextureEnabled;
uint8_t mFogEnabled; uint8_t mFogEnabled;
bool mGlowEnabled; bool mGlowEnabled;
bool mSplitEnabled; bool mSplitEnabled;
bool mBrightmapEnabled; bool mBrightmapEnabled;
bool mColorMask[4];
bool currentColorMask[4];
int mSpecialEffect; int mSpecialEffect;
int mTextureMode; int mTextureMode;
int mDesaturation; int mDesaturation;
@ -151,7 +152,6 @@ public:
void SetMaterial(FMaterial *mat, int clampmode, int translation, int overrideshader, bool alphatexture); void SetMaterial(FMaterial *mat, int clampmode, int translation, int overrideshader, bool alphatexture);
void Apply(); void Apply();
void ApplyColorMask();
void ApplyLightIndex(int index); void ApplyLightIndex(int index);
void SetVertexBuffer(FVertexBuffer *vb) void SetVertexBuffer(FVertexBuffer *vb)
@ -199,28 +199,6 @@ public:
mDesaturation = 0; mDesaturation = 0;
} }
void GetColorMask(bool& r, bool &g, bool& b, bool& a) const
{
r = mColorMask[0];
g = mColorMask[1];
b = mColorMask[2];
a = mColorMask[3];
}
void SetColorMask(bool r, bool g, bool b, bool a)
{
mColorMask[0] = r;
mColorMask[1] = g;
mColorMask[2] = b;
mColorMask[3] = a;
}
void ResetColorMask()
{
for (int i = 0; i < 4; ++i)
mColorMask[i] = true;
}
void SetTextureMode(int mode) void SetTextureMode(int mode)
{ {
mTextureMode = mode; mTextureMode = mode;