diff options
author | adiblol <adiblol@hydrogen> | 2012-09-29 22:49:31 +0200 |
---|---|---|
committer | adiblol <adiblol@hydrogen> | 2012-09-29 22:49:31 +0200 |
commit | 4f097c10b3750e570fa0f709069d9f2e96752c00 (patch) | |
tree | 22fcd2cd806db97484ce07b0a88ea341803fce85 /src/graphics/opengl | |
parent | c8f39a4c96ab63f9e3edc96845e1b70c89b95d2b (diff) | |
parent | 4193f8a3a9f10b563c8fada163c3a6d3860f3457 (diff) | |
download | colobot-4f097c10b3750e570fa0f709069d9f2e96752c00.tar.gz colobot-4f097c10b3750e570fa0f709069d9f2e96752c00.tar.bz2 colobot-4f097c10b3750e570fa0f709069d9f2e96752c00.zip |
Merge branch 'dev-graphics' of github.com:colobot/colobot into dev-graphics
Diffstat (limited to 'src/graphics/opengl')
-rw-r--r-- | src/graphics/opengl/gldevice.cpp | 23 | ||||
-rw-r--r-- | src/graphics/opengl/gldevice.h | 3 |
2 files changed, 2 insertions, 24 deletions
diff --git a/src/graphics/opengl/gldevice.cpp b/src/graphics/opengl/gldevice.cpp index 56a7130..78a77bd 100644 --- a/src/graphics/opengl/gldevice.cpp +++ b/src/graphics/opengl/gldevice.cpp @@ -684,6 +684,8 @@ void CGLDevice::SetTextureStageParams(int index, const TextureStageParams ¶m glActiveTexture(GL_TEXTURE0 + index); + glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, params.factor.Array()); + // To save some trouble if ( (params.colorOperation == TEX_MIX_OPER_DEFAULT) && (params.alphaOperation == TEX_MIX_OPER_DEFAULT) ) @@ -836,27 +838,6 @@ TextureStageParams CGLDevice::GetTextureStageParams(int index) return m_textureStageParams[index]; } -void CGLDevice::SetTextureFactor(const Color &color) -{ - // Needs to be set for all texture stages - for (int index = 0; index < static_cast<int>( m_currentTextures.size() ); ++index) - { - glActiveTexture(GL_TEXTURE0 + index); - glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, color.Array()); - } -} - -Color CGLDevice::GetTextureFactor() -{ - // Get from 1st stage (should be the same for all stages) - glActiveTexture(GL_TEXTURE0); - - GLfloat color[4] = { 0.0f }; - glGetTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, color); - - return Color(color[0], color[1], color[2], color[3]); -} - GLenum TranslateGfxPrimitive(PrimitiveType type) { GLenum flag = 0; diff --git a/src/graphics/opengl/gldevice.h b/src/graphics/opengl/gldevice.h index 78c7433..8af864e 100644 --- a/src/graphics/opengl/gldevice.h +++ b/src/graphics/opengl/gldevice.h @@ -119,9 +119,6 @@ public: virtual void SetTextureStageWrap(int index, Gfx::TexWrapMode wrapS, Gfx::TexWrapMode wrapT); - virtual void SetTextureFactor(const Color &color); - virtual Color GetTextureFactor(); - virtual void DrawPrimitive(PrimitiveType type, const Vertex *vertices, int vertexCount); virtual void DrawPrimitive(PrimitiveType type, const VertexCol *vertices, int vertexCount); virtual void DrawPrimitive(PrimitiveType type, const VertexTex2 *vertices, int vertexCount); |