[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49316] branches/soc-2012-swiss_cheese/ source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVA.cpp: Getting rid of a glIsEnabled() check in the BGE's vertex array code ( using a simple boolean check now).
Mitchell Stokes
mogurijin at gmail.com
Sat Jul 28 03:14:40 CEST 2012
Revision: 49316
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49316
Author: moguri
Date: 2012-07-28 01:14:36 +0000 (Sat, 28 Jul 2012)
Log Message:
-----------
Getting rid of a glIsEnabled() check in the BGE's vertex array code (using a simple boolean check now).
Modified Paths:
--------------
branches/soc-2012-swiss_cheese/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVA.cpp
Modified: branches/soc-2012-swiss_cheese/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVA.cpp
===================================================================
--- branches/soc-2012-swiss_cheese/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVA.cpp 2012-07-28 00:50:38 UTC (rev 49315)
+++ branches/soc-2012-swiss_cheese/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVA.cpp 2012-07-28 01:14:36 UTC (rev 49316)
@@ -312,7 +312,7 @@
void RAS_StorageVA::IndexPrimitives(RAS_MeshSlot& ms)
{
static const GLsizei stride = sizeof(RAS_TexVert);
- bool wireframe = m_drawingmode <= RAS_IRasterizer::KX_WIREFRAME;
+ bool wireframe = m_drawingmode <= RAS_IRasterizer::KX_WIREFRAME, use_color_array;
RAS_MeshSlot::iterator it;
GLenum drawmode;
@@ -343,10 +343,12 @@
glDisableClientState(GL_COLOR_ARRAY);
gpuCurrentColor4d(rgba[0], rgba[1], rgba[2], rgba[3]);
+ use_color_array = false;
}
else {
gpuCurrentColor3x(CPACK_BLACK);
glEnableClientState(GL_COLOR_ARRAY);
+ use_color_array = true;
}
}
else {
@@ -357,7 +359,7 @@
glNormalPointer(GL_FLOAT, stride, it.vertex->getNormal());
if (!wireframe) {
glTexCoordPointer(2, GL_FLOAT, stride, it.vertex->getUV(0));
- if (glIsEnabled(GL_COLOR_ARRAY))
+ if (use_color_array)
glColorPointer(4, GL_UNSIGNED_BYTE, stride, it.vertex->getRGBA());
}
@@ -380,7 +382,7 @@
void RAS_StorageVA::IndexPrimitivesMulti(class RAS_MeshSlot& ms)
{
static const GLsizei stride = sizeof(RAS_TexVert);
- bool wireframe = m_drawingmode <= RAS_IRasterizer::KX_WIREFRAME;
+ bool wireframe = m_drawingmode <= RAS_IRasterizer::KX_WIREFRAME, use_color_array;
RAS_MeshSlot::iterator it;
GLenum drawmode;
@@ -409,10 +411,12 @@
glDisableClientState(GL_COLOR_ARRAY);
gpuCurrentColor4d(rgba[0], rgba[1], rgba[2], rgba[3]);
+ use_color_array = false;
}
else {
gpuCurrentColor3x(CPACK_BLACK);
glEnableClientState(GL_COLOR_ARRAY);
+ use_color_array = true;
}
}
else {
@@ -428,7 +432,7 @@
if (!wireframe) {
TexCoordPtr(it.vertex);
- if (glIsEnabled(GL_COLOR_ARRAY))
+ if (use_color_array)
glColorPointer(4, GL_UNSIGNED_BYTE, stride, it.vertex->getRGBA());
}
More information about the Bf-blender-cvs
mailing list