From 4603d01ba18cc2a6bb796b4510062442078b99d3 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 20 Oct 2018 13:11:03 +0200 Subject: [PATCH] - removed some unused content from FGLRenderState. --- src/gl/renderer/gl_renderstate.cpp | 21 -------------------- src/gl/renderer/gl_renderstate.h | 32 +++++------------------------- 2 files changed, 5 insertions(+), 48 deletions(-) diff --git a/src/gl/renderer/gl_renderstate.cpp b/src/gl/renderer/gl_renderstate.cpp index 26ee7caec3..a148040e83 100644 --- a/src/gl/renderer/gl_renderstate.cpp +++ b/src/gl/renderer/gl_renderstate.cpp @@ -38,8 +38,6 @@ #include "gl/renderer/gl_renderbuffers.h" #include "gl/textures/gl_hwtexture.h" -void gl_SetTextureMode(int type); - FGLRenderState gl_RenderState; CVAR(Bool, gl_direct_state_change, true, 0) @@ -63,8 +61,6 @@ void FGLRenderState::Reset() { mTextureEnabled = true; 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; mTextureMode = -1; mDesaturation = 0; @@ -253,8 +249,6 @@ void FGLRenderState::Apply() } } - //ApplyColorMask(); I don't think this is needed. - if (mVertexBuffer != mCurrentVertexBuffer) { 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) { if (index > -1 && GLRenderer->mLights->GetBufferType() == GL_UNIFORM_BUFFER) diff --git a/src/gl/renderer/gl_renderstate.h b/src/gl/renderer/gl_renderstate.h index 9e205fffb1..c6d7b5bbc3 100644 --- a/src/gl/renderer/gl_renderstate.h +++ b/src/gl/renderer/gl_renderstate.h @@ -72,16 +72,17 @@ enum EPassType MAX_PASS_TYPES }; -class FGLRenderState +class FRenderState +{ +}; + +class FGLRenderState : public FRenderState { - friend void gl_SetTextureMode(int type); bool mTextureEnabled; uint8_t mFogEnabled; bool mGlowEnabled; bool mSplitEnabled; bool mBrightmapEnabled; - bool mColorMask[4]; - bool currentColorMask[4]; int mSpecialEffect; int mTextureMode; int mDesaturation; @@ -151,7 +152,6 @@ public: void SetMaterial(FMaterial *mat, int clampmode, int translation, int overrideshader, bool alphatexture); void Apply(); - void ApplyColorMask(); void ApplyLightIndex(int index); void SetVertexBuffer(FVertexBuffer *vb) @@ -199,28 +199,6 @@ public: 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) { mTextureMode = mode;