Changelog: Actually enable per-vertex material With this, Messiah looks a lot better now (still some visual artifacts with 'sprites' though). Lionel -- Lionel Ulmer - http://www.bbrox.org/
--- /home/ulmer/Wine/wine_base//dlls/ddraw/d3ddevice/mesa.c 2002-12-29 15:46:35.000000000 +0100 +++ /home/ulmer/Wine/wine_work//dlls/ddraw/d3ddevice/mesa.c 2002-12-29 16:20:17.000000000 +0100 @@ -741,16 +741,27 @@ /* Remove also fogging... */ glDisable(GL_FOG); } - - if ((glThis->last_vertices_lit == TRUE) && (vertex_lit == FALSE)) { - glEnable(GL_LIGHTING); - } else if ((glThis->last_vertices_lit == TRUE) && (vertex_lit == TRUE)) { + + /* Handle the 'no-normal' case */ + if (vertex_lit == FALSE) glDisable(GL_LIGHTING); + else if (glThis->render_state.lighting_enable == TRUE) + glEnable(GL_LIGHTING); + + /* Handle the code for pre-vertex material properties */ + if (vertex_transformed == FALSE) { + if (glThis->render_state.lighting_enable == TRUE) { + if ((glThis->render_state.color_diffuse != D3DMCS_MATERIAL) || + (glThis->render_state.color_specular != D3DMCS_MATERIAL) || + (glThis->render_state.color_ambient != D3DMCS_MATERIAL) || + (glThis->render_state.color_emissive != D3DMCS_MATERIAL)) { + glEnable(GL_COLOR_MATERIAL); + } + } } /* And save the current state */ glThis->last_vertices_transformed = vertex_transformed; - glThis->last_vertices_lit = vertex_lit; } @@ -1213,6 +1224,10 @@ } glEnd(); + + /* Whatever the case, disable the color material stuff */ + glDisable(GL_COLOR_MATERIAL); + LEAVE_GL(); TRACE("End\n"); } --- /home/ulmer/Wine/wine_base//dlls/ddraw/mesa_private.h 2002-12-29 09:28:51.000000000 +0100 +++ /home/ulmer/Wine/wine_work//dlls/ddraw/mesa_private.h 2002-12-29 16:24:46.000000000 +0100 @@ -125,7 +125,6 @@ /* The last type of vertex drawn */ BOOLEAN last_vertices_transformed; - BOOLEAN last_vertices_lit; Display *display; Drawable drawable;