OpenGL: remove unused VBO_DISABLED from PBVH

Was almost certainly being compiled out anyway, but now we don’t have
to read it!
This commit is contained in:
2015-11-25 12:30:20 -05:00
parent 88556d801f
commit 7bbcb643f2

View File

@@ -1019,24 +1019,17 @@ struct GPU_PBVH_Buffers {
float diffuse_color[4]; float diffuse_color[4];
}; };
typedef enum { static void gpu_colors_enable()
VBO_ENABLED,
VBO_DISABLED
} VBO_State;
static void gpu_colors_enable(VBO_State vbo_state)
{ {
glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE); glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
glEnable(GL_COLOR_MATERIAL); glEnable(GL_COLOR_MATERIAL);
if (vbo_state == VBO_ENABLED) glEnableClientState(GL_COLOR_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
} }
static void gpu_colors_disable(VBO_State vbo_state) static void gpu_colors_disable()
{ {
glDisable(GL_COLOR_MATERIAL); glDisable(GL_COLOR_MATERIAL);
if (vbo_state == VBO_ENABLED) glDisableClientState(GL_COLOR_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
} }
static float gpu_color_from_mask(float mask) static float gpu_color_from_mask(float mask)
@@ -1864,7 +1857,7 @@ void GPU_draw_pbvh_buffers(GPU_PBVH_Buffers *buffers, DMSetMaterial setMaterial,
glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_VERTEX_ARRAY);
if (!wireframe) { if (!wireframe) {
glEnableClientState(GL_NORMAL_ARRAY); glEnableClientState(GL_NORMAL_ARRAY);
gpu_colors_enable(VBO_ENABLED); gpu_colors_enable();
} }
GPU_buffer_bind(buffers->vert_buf, GPU_BINDING_ARRAY); GPU_buffer_bind(buffers->vert_buf, GPU_BINDING_ARRAY);
@@ -1943,7 +1936,7 @@ void GPU_draw_pbvh_buffers(GPU_PBVH_Buffers *buffers, DMSetMaterial setMaterial,
glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_VERTEX_ARRAY);
if (!wireframe) { if (!wireframe) {
glDisableClientState(GL_NORMAL_ARRAY); glDisableClientState(GL_NORMAL_ARRAY);
gpu_colors_disable(VBO_ENABLED); gpu_colors_disable();
} }
} }
} }