diff --git a/include/IMaterialRendererServices.h b/include/IMaterialRendererServices.h index 9f045b5d..ad9b9a29 100644 --- a/include/IMaterialRendererServices.h +++ b/include/IMaterialRendererServices.h @@ -65,9 +65,6 @@ public: */ virtual bool setVertexShaderConstant(const c8* name, const f32* floats, int count) = 0; - //! Bool interface for the above. - virtual bool setVertexShaderConstant(const c8* name, const bool* bools, int count) = 0; - //! Int interface for the above. virtual bool setVertexShaderConstant(const c8* name, const s32* ints, int count) = 0; @@ -89,9 +86,6 @@ public: \return True if successful. */ virtual bool setPixelShaderConstant(const c8* name, const f32* floats, int count) = 0; - //! Bool interface for the above. - virtual bool setPixelShaderConstant(const c8* name, const bool* bools, int count) = 0; - //! Int interface for the above. virtual bool setPixelShaderConstant(const c8* name, const s32* ints, int count) = 0; diff --git a/source/Irrlicht/CCgMaterialRenderer.cpp b/source/Irrlicht/CCgMaterialRenderer.cpp index a5e4937c..e997029d 100644 --- a/source/Irrlicht/CCgMaterialRenderer.cpp +++ b/source/Irrlicht/CCgMaterialRenderer.cpp @@ -195,11 +195,6 @@ bool CCgMaterialRenderer::setVertexShaderConstant(const c8* name, const f32* flo return setPixelShaderConstant(name, floats, count); } -bool CCgMaterialRenderer::setVertexShaderConstant(const c8* name, const bool* bools, int count) -{ - return setPixelShaderConstant(name, bools, count); -} - bool CCgMaterialRenderer::setVertexShaderConstant(const c8* name, const s32* ints, int count) { return setPixelShaderConstant(name, ints, count); @@ -244,23 +239,6 @@ bool CCgMaterialRenderer::setPixelShaderConstant(const c8* name, const s32* ints return Status; } -bool CCgMaterialRenderer::setPixelShaderConstant(const c8* name, const bool* bools, int count) -{ - bool Status = false; - - for(unsigned int i = 0; i < UniformInfo.size(); ++i) - { - if(UniformInfo[i]->getName() == name) - { - UniformInfo[i]->update(bools, Material); - - Status = true; - } - } - - return Status; -} - void CCgMaterialRenderer::getUniformList() { for(unsigned int i = 0; i < UniformInfo.size(); ++i) diff --git a/source/Irrlicht/CCgMaterialRenderer.h b/source/Irrlicht/CCgMaterialRenderer.h index 8213f78b..e1b02262 100644 --- a/source/Irrlicht/CCgMaterialRenderer.h +++ b/source/Irrlicht/CCgMaterialRenderer.h @@ -140,11 +140,9 @@ public: virtual void setBasicRenderStates(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates) = 0; virtual bool setVertexShaderConstant(const c8* name, const f32* floats, int count); - virtual bool setVertexShaderConstant(const c8* name, const bool* bools, int count); virtual bool setVertexShaderConstant(const c8* name, const s32* ints, int count); virtual void setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1); virtual bool setPixelShaderConstant(const c8* name, const f32* floats, int count); - virtual bool setPixelShaderConstant(const c8* name, const bool* bools, int count); virtual bool setPixelShaderConstant(const c8* name, const s32* ints, int count); virtual void setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1); virtual IVideoDriver* getVideoDriver() = 0; diff --git a/source/Irrlicht/CD3D8Driver.cpp b/source/Irrlicht/CD3D8Driver.cpp index 9886b375..3f366bde 100644 --- a/source/Irrlicht/CD3D8Driver.cpp +++ b/source/Irrlicht/CD3D8Driver.cpp @@ -2186,14 +2186,6 @@ bool CD3D8Driver::setVertexShaderConstant(const c8* name, const f32* floats, int } -//! Bool interface for the above. -bool CD3D8Driver::setVertexShaderConstant(const c8* name, const bool* bools, int count) -{ - os::Printer::log("Cannot set constant, no HLSL supported in D3D8"); - return false; -} - - //! Int interface for the above. bool CD3D8Driver::setVertexShaderConstant(const c8* name, const s32* ints, int count) { @@ -2210,14 +2202,6 @@ bool CD3D8Driver::setPixelShaderConstant(const c8* name, const f32* floats, int } -//! Bool interface for the above. -bool CD3D8Driver::setPixelShaderConstant(const c8* name, const bool* bools, int count) -{ - os::Printer::log("Cannot set constant, no HLSL supported in D3D8"); - return false; -} - - //! Int interface for the above. bool CD3D8Driver::setPixelShaderConstant(const c8* name, const s32* ints, int count) { diff --git a/source/Irrlicht/CD3D8Driver.h b/source/Irrlicht/CD3D8Driver.h index e9428a9f..81f1bec1 100644 --- a/source/Irrlicht/CD3D8Driver.h +++ b/source/Irrlicht/CD3D8Driver.h @@ -182,18 +182,12 @@ namespace video //! Sets a constant for the vertex shader based on a name. virtual bool setVertexShaderConstant(const c8* name, const f32* floats, int count); - //! Bool interface for the above. - virtual bool setVertexShaderConstant(const c8* name, const bool* bools, int count); - //! Int interface for the above. virtual bool setVertexShaderConstant(const c8* name, const s32* ints, int count); //! Sets a constant for the pixel shader based on a name. virtual bool setPixelShaderConstant(const c8* name, const f32* floats, int count); - //! Bool interface for the above. - virtual bool setPixelShaderConstant(const c8* name, const bool* bools, int count); - //! Int interface for the above. virtual bool setPixelShaderConstant(const c8* name, const s32* ints, int count); diff --git a/source/Irrlicht/CD3D9Driver.cpp b/source/Irrlicht/CD3D9Driver.cpp index 20840a7e..65545378 100644 --- a/source/Irrlicht/CD3D9Driver.cpp +++ b/source/Irrlicht/CD3D9Driver.cpp @@ -3100,19 +3100,6 @@ bool CD3D9Driver::setVertexShaderConstant(const c8* name, const f32* floats, int } -//! Bool interface for the above. -bool CD3D9Driver::setVertexShaderConstant(const c8* name, const bool* bools, int count) -{ - if (Material.MaterialType >= 0 && Material.MaterialType < (s32)MaterialRenderers.size()) - { - CD3D9MaterialRenderer* r = (CD3D9MaterialRenderer*)MaterialRenderers[Material.MaterialType].Renderer; - return r->setVariable(true, name, bools, count); - } - - return false; -} - - //! Int interface for the above. bool CD3D9Driver::setVertexShaderConstant(const c8* name, const s32* ints, int count) { @@ -3139,19 +3126,6 @@ bool CD3D9Driver::setPixelShaderConstant(const c8* name, const f32* floats, int } -//! Bool interface for the above. -bool CD3D9Driver::setPixelShaderConstant(const c8* name, const bool* bools, int count) -{ - if (Material.MaterialType >= 0 && Material.MaterialType < (s32)MaterialRenderers.size()) - { - CD3D9MaterialRenderer* r = (CD3D9MaterialRenderer*)MaterialRenderers[Material.MaterialType].Renderer; - return r->setVariable(false, name, bools, count); - } - - return false; -} - - //! Int interface for the above. bool CD3D9Driver::setPixelShaderConstant(const c8* name, const s32* ints, int count) { diff --git a/source/Irrlicht/CD3D9Driver.h b/source/Irrlicht/CD3D9Driver.h index 095ae9d6..c9ebf63f 100644 --- a/source/Irrlicht/CD3D9Driver.h +++ b/source/Irrlicht/CD3D9Driver.h @@ -268,18 +268,12 @@ namespace video //! Sets a constant for the vertex shader based on a name. virtual bool setVertexShaderConstant(const c8* name, const f32* floats, int count); - //! Bool interface for the above. - virtual bool setVertexShaderConstant(const c8* name, const bool* bools, int count); - //! Int interface for the above. virtual bool setVertexShaderConstant(const c8* name, const s32* ints, int count); //! Sets a constant for the pixel shader based on a name. virtual bool setPixelShaderConstant(const c8* name, const f32* floats, int count); - //! Bool interface for the above. - virtual bool setPixelShaderConstant(const c8* name, const bool* bools, int count); - //! Int interface for the above. virtual bool setPixelShaderConstant(const c8* name, const s32* ints, int count); diff --git a/source/Irrlicht/CD3D9HLSLMaterialRenderer.cpp b/source/Irrlicht/CD3D9HLSLMaterialRenderer.cpp index 131bdf57..91ed08ca 100644 --- a/source/Irrlicht/CD3D9HLSLMaterialRenderer.cpp +++ b/source/Irrlicht/CD3D9HLSLMaterialRenderer.cpp @@ -304,45 +304,6 @@ bool CD3D9HLSLMaterialRenderer::setVariable(bool vertexShader, const c8* name, } -bool CD3D9HLSLMaterialRenderer::setVariable(bool vertexShader, const c8* name, - const bool* bools, int count) -{ - LPD3DXCONSTANTTABLE tbl = vertexShader ? VSConstantsTable : PSConstantsTable; - if (!tbl) - return false; - - // currently we only support top level parameters. - // Should be enough for the beginning. (TODO) - - D3DXHANDLE hndl = tbl->GetConstantByName(NULL, name); - if (!hndl) - { - core::stringc s = "HLSL Variable to set not found: '"; - s += name; - s += "'. Available variables are:"; - os::Printer::log(s.c_str(), ELL_WARNING); - printHLSLVariables(tbl); - return false; - } - - D3DXCONSTANT_DESC Description; - UINT ucount = 1; - tbl->GetConstantDesc(hndl, &Description, &ucount); - - if(Description.RegisterSet != D3DXRS_SAMPLER) - { - HRESULT hr = tbl->SetBoolArray(pID3DDevice, hndl, (BOOL*)bools, count); - if (FAILED(hr)) - { - os::Printer::log("Error setting bool array for HLSL variable", ELL_WARNING); - return false; - } - } - - return true; -} - - bool CD3D9HLSLMaterialRenderer::setVariable(bool vertexShader, const c8* name, const s32* ints, int count) { diff --git a/source/Irrlicht/CD3D9HLSLMaterialRenderer.h b/source/Irrlicht/CD3D9HLSLMaterialRenderer.h index 2e051b7b..b515f6f5 100644 --- a/source/Irrlicht/CD3D9HLSLMaterialRenderer.h +++ b/source/Irrlicht/CD3D9HLSLMaterialRenderer.h @@ -51,9 +51,6 @@ public: //! \param count: Amount of floats in array. virtual bool setVariable(bool vertexShader, const c8* name, const f32* floats, int count); - //! Bool interface for the above. - virtual bool setVariable(bool vertexShader, const c8* name, const bool* bools, int count); - //! Int interface for the above. virtual bool setVariable(bool vertexShader, const c8* name, const s32* ints, int count); diff --git a/source/Irrlicht/CD3D9MaterialRenderer.h b/source/Irrlicht/CD3D9MaterialRenderer.h index 16536617..9b8204d4 100644 --- a/source/Irrlicht/CD3D9MaterialRenderer.h +++ b/source/Irrlicht/CD3D9MaterialRenderer.h @@ -75,13 +75,6 @@ public: return false; } - //! Bool interface for the above. - virtual bool setVariable(bool vertexShader, const c8* name, const bool* bools, int count) - { - os::Printer::log("Invalid material to set variable in."); - return false; - } - //! Int interface for the above. virtual bool setVariable(bool vertexShader, const c8* name, const s32* ints, int count) { diff --git a/source/Irrlicht/COpenGLDriver.cpp b/source/Irrlicht/COpenGLDriver.cpp index 6fcbb5c1..b41c0f1c 100644 --- a/source/Irrlicht/COpenGLDriver.cpp +++ b/source/Irrlicht/COpenGLDriver.cpp @@ -3893,12 +3893,6 @@ bool COpenGLDriver::setVertexShaderConstant(const c8* name, const f32* floats, i return setPixelShaderConstant(name, floats, count); } -//! Bool interface for the above. -bool COpenGLDriver::setVertexShaderConstant(const c8* name, const bool* bools, int count) -{ - return setPixelShaderConstant(name, bools, count); -} - //! Int interface for the above. bool COpenGLDriver::setVertexShaderConstant(const c8* name, const s32* ints, int count) { @@ -3912,13 +3906,6 @@ bool COpenGLDriver::setPixelShaderConstant(const c8* name, const f32* floats, in return false; } -//! Bool interface for the above. -bool COpenGLDriver::setPixelShaderConstant(const c8* name, const bool* bools, int count) -{ - os::Printer::log("Error: Please call services->setPixelShaderConstant(), not VideoDriver->setPixelShaderConstant()."); - return false; -} - //! Int interface for the above. bool COpenGLDriver::setPixelShaderConstant(const c8* name, const s32* ints, int count) { diff --git a/source/Irrlicht/COpenGLDriver.h b/source/Irrlicht/COpenGLDriver.h index 67b1d94c..96544106 100644 --- a/source/Irrlicht/COpenGLDriver.h +++ b/source/Irrlicht/COpenGLDriver.h @@ -286,18 +286,12 @@ namespace video //! Sets a constant for the vertex shader based on a name. virtual bool setVertexShaderConstant(const c8* name, const f32* floats, int count); - //! Bool interface for the above. - virtual bool setVertexShaderConstant(const c8* name, const bool* bools, int count); - //! Int interface for the above. virtual bool setVertexShaderConstant(const c8* name, const s32* ints, int count); //! Sets a constant for the pixel shader based on a name. virtual bool setPixelShaderConstant(const c8* name, const f32* floats, int count); - //! Bool interface for the above. - virtual bool setPixelShaderConstant(const c8* name, const bool* bools, int count); - //! Int interface for the above. virtual bool setPixelShaderConstant(const c8* name, const s32* ints, int count); diff --git a/source/Irrlicht/COpenGLSLMaterialRenderer.cpp b/source/Irrlicht/COpenGLSLMaterialRenderer.cpp index 823e16dd..9867b649 100644 --- a/source/Irrlicht/COpenGLSLMaterialRenderer.cpp +++ b/source/Irrlicht/COpenGLSLMaterialRenderer.cpp @@ -500,11 +500,6 @@ bool COpenGLSLMaterialRenderer::setVertexShaderConstant(const c8* name, const f3 return setPixelShaderConstant(name, floats, count); } -bool COpenGLSLMaterialRenderer::setVertexShaderConstant(const c8* name, const bool* bools, int count) -{ - return setPixelShaderConstant(name, bools, count); -} - bool COpenGLSLMaterialRenderer::setVertexShaderConstant(const c8* name, const s32* ints, int count) { return setPixelShaderConstant(name, ints, count); @@ -582,53 +577,6 @@ bool COpenGLSLMaterialRenderer::setPixelShaderConstant(const c8* name, const f32 #endif } -bool COpenGLSLMaterialRenderer::setPixelShaderConstant(const c8* name, const bool* bools, int count) -{ - u32 i; - const u32 num = UniformInfo.size(); - - for (i=0; i < num; ++i) - { - if (UniformInfo[i].name == name) - break; - } - - if (i == num) - return false; - -#if defined(GL_VERSION_2_0)||defined(GL_ARB_shader_objects) - GLint Location=0; - if (Program2) - Location=Driver->extGlGetUniformLocation(Program2,name); - else - Location=Driver->extGlGetUniformLocationARB(Program,name); - - bool status = true; - - switch (UniformInfo[i].type) - { - case GL_BOOL: - Driver->extGlUniform1iv(Location, count, (GLint*)bools); - break; - case GL_BOOL_VEC2: - Driver->extGlUniform2iv(Location, count/2, (GLint*)bools); - break; - case GL_BOOL_VEC3: - Driver->extGlUniform3iv(Location, count/3, (GLint*)bools); - break; - case GL_BOOL_VEC4: - Driver->extGlUniform4iv(Location, count/4, (GLint*)bools); - break; - default: - status = false; - break; - } - return status; -#else - return false; -#endif -} - bool COpenGLSLMaterialRenderer::setPixelShaderConstant(const c8* name, const s32* ints, int count) { u32 i; diff --git a/source/Irrlicht/COpenGLSLMaterialRenderer.h b/source/Irrlicht/COpenGLSLMaterialRenderer.h index ff711502..816b0a72 100644 --- a/source/Irrlicht/COpenGLSLMaterialRenderer.h +++ b/source/Irrlicht/COpenGLSLMaterialRenderer.h @@ -86,11 +86,9 @@ public: // implementations for the render services virtual void setBasicRenderStates(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates); virtual bool setVertexShaderConstant(const c8* name, const f32* floats, int count); - virtual bool setVertexShaderConstant(const c8* name, const bool* bools, int count); virtual bool setVertexShaderConstant(const c8* name, const s32* ints, int count); virtual void setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1); virtual bool setPixelShaderConstant(const c8* name, const f32* floats, int count); - virtual bool setPixelShaderConstant(const c8* name, const bool* bools, int count); virtual bool setPixelShaderConstant(const c8* name, const s32* ints, int count); virtual void setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1); virtual IVideoDriver* getVideoDriver();