Commit 4d09cba5 authored by Lionel Ulmer's avatar Lionel Ulmer Committed by Alexandre Julliard

Handle the COLORVERTEX render state.

parent db9b5f74
......@@ -773,7 +773,8 @@ static void draw_primitive_handle_GL_state(IDirect3DDeviceImpl *This,
/* Handle the code for pre-vertex material properties */
if (vertex_transformed == FALSE) {
if (This->state_block.render_state[D3DRENDERSTATE_LIGHTING - 1] == TRUE) {
if ((This->state_block.render_state[D3DRENDERSTATE_LIGHTING - 1] == TRUE) &&
(This->state_block.render_state[D3DRENDERSTATE_COLORVERTEX - 1] == TRUE)) {
if ((This->state_block.render_state[D3DRENDERSTATE_DIFFUSEMATERIALSOURCE - 1] != D3DMCS_MATERIAL) ||
(This->state_block.render_state[D3DRENDERSTATE_AMBIENTMATERIALSOURCE - 1] != D3DMCS_MATERIAL) ||
(This->state_block.render_state[D3DRENDERSTATE_EMISSIVEMATERIALSOURCE - 1] != D3DMCS_MATERIAL) ||
......@@ -935,7 +936,8 @@ inline static void handle_specular_base(STATEBLOCK *sb, DWORD *color) {
inline static void handle_diffuse(STATEBLOCK *sb, DWORD *color, BOOLEAN lighted) {
if ((lighted == FALSE) &&
(sb->render_state[D3DRENDERSTATE_LIGHTING - 1] == TRUE)) {
(sb->render_state[D3DRENDERSTATE_LIGHTING - 1] == TRUE) &&
(sb->render_state[D3DRENDERSTATE_COLORVERTEX - 1] == TRUE)) {
if (sb->render_state[D3DRENDERSTATE_DIFFUSEMATERIALSOURCE - 1] == D3DMCS_COLOR1) {
glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
handle_diffuse_base(sb, color);
......@@ -960,7 +962,8 @@ inline static void handle_diffuse(STATEBLOCK *sb, DWORD *color, BOOLEAN lighted)
inline static void handle_specular(STATEBLOCK *sb, DWORD *color, BOOLEAN lighted) {
if ((lighted == FALSE) &&
(sb->render_state[D3DRENDERSTATE_LIGHTING - 1] == TRUE)) {
(sb->render_state[D3DRENDERSTATE_LIGHTING - 1] == TRUE) &&
(sb->render_state[D3DRENDERSTATE_COLORVERTEX - 1] == TRUE)) {
if (sb->render_state[D3DRENDERSTATE_DIFFUSEMATERIALSOURCE - 1] == D3DMCS_COLOR2) {
glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
handle_specular_base(sb, color);
......
......@@ -432,6 +432,10 @@ void set_render_state(IDirect3DDeviceImpl* This,
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, (float *) light);
} break;
case D3DRENDERSTATE_COLORVERTEX: /* 141 */
/* Nothing to do here.. Only storage matters */
break;
case D3DRENDERSTATE_LOCALVIEWER: /* 142 */
if (dwRenderState)
glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment