diff options
Diffstat (limited to 'source/gameengine/GamePlayer/common/GPC_RenderTools.cpp')
-rw-r--r-- | source/gameengine/GamePlayer/common/GPC_RenderTools.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp index 54e2efd8776..ed2fa8a7dc6 100644 --- a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp +++ b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp @@ -101,23 +101,23 @@ void GPC_RenderTools::ProcessLighting(RAS_IRasterizer *rasty, bool uselights, co int layer= -1; /* find the layer */ - if(uselights) { - if(m_clientobject) + if (uselights) { + if (m_clientobject) layer = static_cast<KX_GameObject*>(m_clientobject)->GetLayer(); } /* avoid state switching */ - if(m_lastlightlayer == layer && m_lastauxinfo == m_auxilaryClientInfo) + if (m_lastlightlayer == layer && m_lastauxinfo == m_auxilaryClientInfo) return; m_lastlightlayer = layer; m_lastauxinfo = m_auxilaryClientInfo; /* enable/disable lights as needed */ - if(layer >= 0) + if (layer >= 0) enable = applyLights(layer, viewmat); - if(enable) + if (enable) EnableOpenGLLights(rasty); else DisableOpenGLLights(); @@ -125,7 +125,7 @@ void GPC_RenderTools::ProcessLighting(RAS_IRasterizer *rasty, bool uselights, co void GPC_RenderTools::EnableOpenGLLights(RAS_IRasterizer *rasty) { - if(m_lastlighting == true) + if (m_lastlighting == true) return; glEnable(GL_LIGHTING); @@ -142,7 +142,7 @@ void GPC_RenderTools::EnableOpenGLLights(RAS_IRasterizer *rasty) void GPC_RenderTools::DisableOpenGLLights() { - if(m_lastlighting == false) + if (m_lastlighting == false) return; glDisable(GL_LIGHTING); @@ -291,26 +291,26 @@ void GPC_RenderTools::RenderText3D( int fontid, double* mat, float aspect) { - if(GLEW_ARB_multitexture) { - for(int i=0; i<MAXTEX; i++) { + if (GLEW_ARB_multitexture) { + for (int i=0; i<MAXTEX; i++) { glActiveTextureARB(GL_TEXTURE0_ARB+i); - if(GLEW_ARB_texture_cube_map) - if(glIsEnabled(GL_TEXTURE_CUBE_MAP_ARB)) + if (GLEW_ARB_texture_cube_map) + if (glIsEnabled(GL_TEXTURE_CUBE_MAP_ARB)) glDisable(GL_TEXTURE_CUBE_MAP_ARB); - if(glIsEnabled(GL_TEXTURE_2D)) + if (glIsEnabled(GL_TEXTURE_2D)) glDisable(GL_TEXTURE_2D); } glActiveTextureARB(GL_TEXTURE0_ARB); } else { - if(GLEW_ARB_texture_cube_map) - if(glIsEnabled(GL_TEXTURE_CUBE_MAP_ARB)) + if (GLEW_ARB_texture_cube_map) + if (glIsEnabled(GL_TEXTURE_CUBE_MAP_ARB)) glDisable(GL_TEXTURE_CUBE_MAP_ARB); - if(glIsEnabled(GL_TEXTURE_2D)) + if (glIsEnabled(GL_TEXTURE_2D)) glDisable(GL_TEXTURE_2D); } @@ -415,7 +415,7 @@ void GPC_RenderTools::RenderText( struct MTFace* tface = 0; unsigned int *col = 0; - if(flag & RAS_BLENDERMAT) { + if (flag & RAS_BLENDERMAT) { KX_BlenderMaterial *bl_mat = static_cast<KX_BlenderMaterial*>(polymat); tface = bl_mat->GetMTFace(); col = bl_mat->GetMCol(); @@ -448,7 +448,7 @@ int GPC_RenderTools::applyLights(int objectlayer, const MT_Transform& viewmat) unsigned int count; std::vector<struct RAS_LightObject*>::iterator lit = m_lights.begin(); - for(count=0; count<m_numgllights; count++) + for (count=0; count<m_numgllights; count++) glDisable((GLenum)(GL_LIGHT0+count)); viewmat.getValue(glviewmat); @@ -460,7 +460,7 @@ int GPC_RenderTools::applyLights(int objectlayer, const MT_Transform& viewmat) RAS_LightObject* lightdata = (*lit); KX_LightObject *kxlight = (KX_LightObject*)lightdata->m_light; - if(kxlight->ApplyLight(kxscene, objectlayer, count)) + if (kxlight->ApplyLight(kxscene, objectlayer, count)) count++; } glPopMatrix(); @@ -472,16 +472,16 @@ void GPC_RenderTools::MotionBlur(RAS_IRasterizer* rasterizer) { int state = rasterizer->GetMotionBlurState(); float motionblurvalue; - if(state) + if (state) { motionblurvalue = rasterizer->GetMotionBlurValue(); - if(state==1) + if (state==1) { //bugfix:load color buffer into accum buffer for the first time(state=1) glAccum(GL_LOAD, 1.0); rasterizer->SetMotionBlurState(2); } - else if(motionblurvalue>=0.0 && motionblurvalue<=1.0) + else if (motionblurvalue>=0.0 && motionblurvalue<=1.0) { glAccum(GL_MULT, motionblurvalue); glAccum(GL_ACCUM, 1-motionblurvalue); |