From cf6d2a88bc42d9b3d00c7e253034e67fd24e65d3 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Wed, 25 Sep 2013 17:39:18 +0200 Subject: [PATCH] Removed some now unused methods. --HG-- branch : gsoc2013-dfighter --- .../src/3d/driver/OpenGL3/driver_opengl.cpp | 4 -- .../nel/src/3d/driver/OpenGL3/driver_opengl.h | 17 +----- .../driver/OpenGL3/driver_opengl_material.cpp | 53 ------------------- .../driver/OpenGL3/driver_opengl_states.cpp | 42 --------------- .../3d/driver/OpenGL3/driver_opengl_states.h | 19 ------- .../driver/OpenGL3/driver_opengl_vertex.cpp | 50 +---------------- 6 files changed, 3 insertions(+), 182 deletions(-) diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl.cpp b/code/nel/src/3d/driver/OpenGL3/driver_opengl.cpp index fcf54fb12..3758e641a 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl.cpp +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl.cpp @@ -272,10 +272,6 @@ CDriverGL3::CDriverGL3() _UserTexMatEnabled = 0; - // Ligtmap preca. - _LastVertexSetupIsLightMap= false; - for(i=0; i < IDRV_MAT_MAXTEXTURES; i++) - _LightMapUVMap[i]= -1; // reserve enough space to never reallocate, nor test for reallocation. _LightMapLUT.resize(NL3D_DRV_MAX_LIGHTMAP); // must set replace for alpha part. diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl.h b/code/nel/src/3d/driver/OpenGL3/driver_opengl.h index e86b8801b..c97d47e43 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl.h +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl.h @@ -435,7 +435,7 @@ public: virtual bool activeIndexBuffer(CIndexBuffer& IB); - virtual void mapTextureStageToUV(uint stage, uint uv); + virtual void mapTextureStageToUV(uint stage, uint uv){} virtual bool renderLines(CMaterial& mat, uint32 firstIndex, uint32 nlines); virtual bool renderTriangles(CMaterial& Mat, uint32 firstIndex, uint32 ntris); @@ -1053,9 +1053,6 @@ private: CVertexBufferInfo _LastVB; CIndexBufferInfo _LastIB; - /// setup a texture stage with an UV from VB. - void setupUVPtr(uint stage, CVertexBufferInfo &VB, uint uvId); - /// Sets up the rendering parameters for the normal shader void setupNormalPass(); @@ -1077,13 +1074,6 @@ private: // last stage env. CMaterial::CTexEnv _LightMapLastStageEnv; - // Caching - bool _LastVertexSetupIsLightMap; - sint8 _LightMapUVMap[IDRV_MAT_MAXTEXTURES]; - - // restore std vertex Setup. - void resetLightMapVertexSetup(); - // @} /// \name Specular. @@ -1148,11 +1138,6 @@ private: /// setup GL arrays, with a vb info. void setupGlArrays(CVertexBufferInfo &vb); - /// Tools fct used by setupGLArrays - void setupGlArraysStd(CVertexBufferInfo &vb); - void setupGlArraysForARBVertexProgram(CVertexBufferInfo &vb); - void toggleGlArraysForARBVertexProgram(); - /// Test/activate normalisation of normal. void enableGlNormalize(bool normalize) { diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_material.cpp b/code/nel/src/3d/driver/OpenGL3/driver_opengl_material.cpp index 73ddcb483..52f5b33fc 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_material.cpp +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_material.cpp @@ -470,10 +470,6 @@ bool CDriverGL3::setupMaterial(CMaterial& mat) // 4. Misc //===================================== - // If !lightMap and prec material was lihgtmap => vertex setup is dirty! - if( matShader != CMaterial::LightMap && _LastVertexSetupIsLightMap ) - resetLightMapVertexSetup(); - // Textures user matrix if (matShader == CMaterial::Normal) { @@ -765,10 +761,6 @@ sint CDriverGL3::beginLightMapMultiPass () _DriverGLStates.setAmbient(packedColorBlack, glcolBlack); _DriverGLStates.setSpecular(packedColorBlack, glcolBlack); - // reset VertexColor array if necessary. - if (_LastVB.VertexFormat & CVertexBuffer::PrimaryColorFlag) - _DriverGLStates.enableColorArray(false); - // Manage too if no lightmaps. return std::max (_NLightMapPass, (uint)1); } @@ -914,13 +906,6 @@ void CDriverGL3::setupLightMapPass(uint pass) _CurrentTexEnvSpecial[stage] = TexEnvSpecialLightMap; } } - - // setup UV, with UV1. Only if needed (cached) - if( !_LastVertexSetupIsLightMap || _LightMapUVMap[stage]!=1 ) - { - setupUVPtr(stage, _LastVB, 1); - _LightMapUVMap[stage]= 1; - } } // Next lightmap. @@ -949,13 +934,6 @@ void CDriverGL3::setupLightMapPass(uint pass) setUniform1i( tl, stage ); } - // setup UV, with UV0. Only if needed (cached) - if( !_LastVertexSetupIsLightMap || _LightMapUVMap[stage]!=0 ) - { - setupUVPtr(stage, _LastVB, 0); - _LightMapUVMap[stage]= 0; - } - } } else @@ -1036,37 +1014,6 @@ void CDriverGL3::setupLightMapPass(uint pass) void CDriverGL3::endLightMapMultiPass() { H_AUTO_OGL(CDriverGL3_endLightMapMultiPass) - // Flag the fact that VertexSetup is dirty (special lightmap). reseted in activeVertexBuffer(), and setupMaterial() - // NB: if no lightmaps, no setupUVPtr() has been called => don't need to flag - // (important else crash if graphist error while exporting a Lightmap material, with a MeshVertexProgram (WindTree) ) - if(_NLightMaps!=0) - _LastVertexSetupIsLightMap= true; - - // nothing to do with blending/lighting, since always setuped in activeMaterial(). - // If material is the same, then it is still a lightmap material (if changed => touched => different!) - // So no need to reset blending/lighting here. - -} - -// *************************************************************************** -void CDriverGL3::resetLightMapVertexSetup() -{ - H_AUTO_OGL(CDriverGL3_resetLightMapVertexSetup) - // special for all stage, std UV behavior. - for(uint i = 0; i < inlGetNumTextStages(); i++) - { - // normal behavior: each texture has its own UV. - setupUVPtr(i, _LastVB, i); - // reset cache - _LightMapUVMap[i]= -1; - } - - // pop VertexColor array if necessary. - if (_LastVB.VertexFormat & CVertexBuffer::PrimaryColorFlag) - _DriverGLStates.enableColorArray(true); - - // flag - _LastVertexSetupIsLightMap= false; } // *************************************************************************** diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_states.cpp b/code/nel/src/3d/driver/OpenGL3/driver_opengl_states.cpp index 809a2707e..47695dfe9 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_states.cpp +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_states.cpp @@ -648,48 +648,6 @@ void CDriverGLStates3::forceActiveTextureARB(uint stage) _CurrentActiveTextureARB= stage; } -// *************************************************************************** -void CDriverGLStates3::enableVertexArray(bool enable) -{ -} - -// *************************************************************************** -void CDriverGLStates3::enableNormalArray(bool enable) -{ -} - -// *************************************************************************** -void CDriverGLStates3::enableWeightArray(bool enable) -{ -} - -// *************************************************************************** -void CDriverGLStates3::enableColorArray(bool enable) -{ -} - - -// *************************************************************************** -void CDriverGLStates3::enableSecondaryColorArray(bool enable) -{ - -} - -// *************************************************************************** -void CDriverGLStates3::clientActiveTextureARB(uint stage) -{ -} - -// *************************************************************************** -void CDriverGLStates3::enableTexCoordArray(bool enable) -{ -} - -// *************************************************************************** -void CDriverGLStates3::enableVertexAttribArray(uint glIndex, bool enable) -{ -} - // *************************************************************************** void CDriverGLStates3::enableVertexAttribArrayARB(uint glIndex,bool enable) { diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_states.h b/code/nel/src/3d/driver/OpenGL3/driver_opengl_states.h index 38f9cfd73..3bc29ebc8 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_states.h +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_states.h @@ -153,29 +153,10 @@ public: void resetTextureMode(); // @} - /// \name Vertex Array enabling. - /// equivalent to glEnableClientState() / glDisableClientState(). NB: Not modified by forceDefaults() - // @{ - void enableVertexArray(bool enable); - void enableNormalArray(bool enable); - void enableWeightArray(bool enable); - void enableColorArray(bool enable); - void enableSecondaryColorArray(bool enable); - /// same as glClientActiveTextureARB(). useful for enableTexCoordArray. - void clientActiveTextureARB(uint stage); - /// NB: caller must call correct clientActiveTextureARB() before. - void enableTexCoordArray(bool enable); - /** For vertexProgram. do not check if supported or not. - */ - void enableVertexAttribArray(uint glIndex, bool enable); - // special version for ARB_vertex_program used with ARB_vertex_buffer or ATI_vertex_attrib_array_object void enableVertexAttribArrayARB(uint glIndex, bool enable); - // @} - - // ARB_vertex_buffer_object buffer binding void bindARBVertexBuffer(uint objectID); void forceBindARBVertexBuffer(uint objectID); diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex.cpp b/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex.cpp index a63cfdb52..2b2472fd8 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex.cpp +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex.cpp @@ -149,9 +149,6 @@ bool CDriverGL3::activeVertexBuffer(CVertexBuffer& VB) // NB: must duplicate changes in activeVertexBufferHard() uint32 flags; - // In any case, we'll erase any special vertex setup for Lightmap Material - _LastVertexSetupIsLightMap= false; - // setup if (!setupVertexBuffer(VB)) return false; @@ -202,23 +199,6 @@ bool CDriverGL3::activeIndexBuffer(CIndexBuffer& IB) return true; } -// *************************************************************************** - -void CDriverGL3::setupUVPtr(uint stage, CVertexBufferInfo &VB, uint uvId) -{ -} - - -// *************************************************************************** -void CDriverGL3::mapTextureStageToUV(uint stage, uint uv) -{ - H_AUTO_OGL(CDriverGL3_mapTextureStageToUV) - // Just call it for last VertexBuffer setuped. - setupUVPtr(stage, _LastVB, uv); -} - - - // *************************************************************************** // *************************************************************************** // VertexBufferHard @@ -372,23 +352,6 @@ const uint CDriverGL3::GLVertexAttribIndex[CVertexBuffer::NumValue]= 7, // Empty }; - - -// *************************************************************************** -void CDriverGL3::setupGlArraysStd(CVertexBufferInfo &vb) -{ -} - - -// *************************************************************************** -void CDriverGL3::toggleGlArraysForARBVertexProgram() -{ - H_AUTO_OGL(CDriverGL3_toggleGlArraysForARBVertexProgram) - // If change of setup type, must disable olds. - //======================= - -} - // tells for each vertex argument if it must be normalized when it is an integral type static const GLboolean ARBVertexProgramMustNormalizeAttrib[] = { @@ -411,9 +374,9 @@ static const GLboolean ARBVertexProgramMustNormalizeAttrib[] = }; // *************************************************************************** -void CDriverGL3::setupGlArraysForARBVertexProgram(CVertexBufferInfo &vb) +void CDriverGL3::setupGlArrays(CVertexBufferInfo &vb) { - H_AUTO_OGL(CDriverGL3_setupGlArraysForARBVertexProgram) + H_AUTO_OGL(CDriverGL3_setupGlArrays) uint32 flags= vb.VertexFormat; @@ -453,15 +416,6 @@ void CDriverGL3::setupGlArraysForARBVertexProgram(CVertexBufferInfo &vb) } -// *************************************************************************** -void CDriverGL3::setupGlArrays(CVertexBufferInfo &vb) -{ - H_AUTO_OGL(CDriverGL3_setupGlArrays) - - setupGlArraysForARBVertexProgram(vb); -} - - // *************************************************************************** void CVertexBufferInfo::setupVertexBuffer(CVertexBuffer &vb) {