Fix: gpu_colors_enable could cause 3d display corruption because it always enables glColorMaterial. Make sure to call gpu_colors_disable even if we don't have a mask layer, to match gpu_colors_enable above

This commit is contained in:
Antony Riakiotakis
2012-10-01 07:53:54 +00:00
parent 4b0e41b0a7
commit 323ad98496

View File

@@ -1986,7 +1986,7 @@ void GPU_draw_buffers(GPU_Buffers *buffers, DMSetMaterial setMaterial)
if (buffers->vert_buf && buffers->index_buf) {
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
if (buffers->vmask || buffers->gridkey.has_mask) {
if (has_mask) {
gpu_colors_enable(VBO_ENABLED);
}
else {
@@ -2036,6 +2036,9 @@ void GPU_draw_buffers(GPU_Buffers *buffers, DMSetMaterial setMaterial)
if (has_mask) {
gpu_colors_disable(VBO_ENABLED);
}
else {
gpu_colors_disable(VBO_DISABLED);
}
}
/* fallbacks if we are out of memory or VBO is disabled */
else if (buffers->totface) {