Commit 580b9961 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Move WINED3DRS_LOCALVIEWER to the state table.

parent 4c64b86f
...@@ -3403,17 +3403,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, W ...@@ -3403,17 +3403,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, W
case WINED3DRS_COLORWRITEENABLE1 : case WINED3DRS_COLORWRITEENABLE1 :
case WINED3DRS_COLORWRITEENABLE2 : case WINED3DRS_COLORWRITEENABLE2 :
case WINED3DRS_COLORWRITEENABLE3 : case WINED3DRS_COLORWRITEENABLE3 :
case WINED3DRS_LOCALVIEWER :
StateTable[STATE_RENDER(State)].apply(STATE_RENDER(State), This->stateBlock); StateTable[STATE_RENDER(State)].apply(STATE_RENDER(State), This->stateBlock);
break; break;
case WINED3DRS_LOCALVIEWER :
{
GLint state = (Value) ? 1 : 0;
TRACE("Local Viewer Enable to %ul\n", (BOOL) Value);
glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, state);
}
break;
case WINED3DRS_LASTPIXEL : case WINED3DRS_LASTPIXEL :
{ {
if (Value) { if (Value) {
......
...@@ -1026,6 +1026,16 @@ static void state_colorwrite(DWORD state, IWineD3DStateBlockImpl *stateblock) { ...@@ -1026,6 +1026,16 @@ static void state_colorwrite(DWORD state, IWineD3DStateBlockImpl *stateblock) {
} }
} }
static void state_localviewer(DWORD state, IWineD3DStateBlockImpl *stateblock) {
if(stateblock->renderState[WINED3DRS_LOCALVIEWER]) {
glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, 1);
checkGLcall("glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, 1)");
} else {
glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, 0);
checkGLcall("glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, 0)");
}
}
const struct StateEntry StateTable[] = const struct StateEntry StateTable[] =
{ {
/* State name representative, apply function */ /* State name representative, apply function */
...@@ -1173,7 +1183,7 @@ const struct StateEntry StateTable[] = ...@@ -1173,7 +1183,7 @@ const struct StateEntry StateTable[] =
{ /*139, WINED3DRS_AMBIENT */ STATE_RENDER(WINED3DRS_AMBIENT), state_ambient }, { /*139, WINED3DRS_AMBIENT */ STATE_RENDER(WINED3DRS_AMBIENT), state_ambient },
{ /*140, WINED3DRS_FOGVERTEXMODE */ STATE_RENDER(WINED3DRS_FOGENABLE), state_fog }, { /*140, WINED3DRS_FOGVERTEXMODE */ STATE_RENDER(WINED3DRS_FOGENABLE), state_fog },
{ /*141, WINED3DRS_COLORVERTEX */ STATE_RENDER(WINED3DRS_COLORVERTEX), state_colormat }, { /*141, WINED3DRS_COLORVERTEX */ STATE_RENDER(WINED3DRS_COLORVERTEX), state_colormat },
{ /*142, WINED3DRS_LOCALVIEWER */ STATE_RENDER(WINED3DRS_LOCALVIEWER), state_unknown }, { /*142, WINED3DRS_LOCALVIEWER */ STATE_RENDER(WINED3DRS_LOCALVIEWER), state_localviewer },
{ /*143, WINED3DRS_NORMALIZENORMALS */ STATE_RENDER(WINED3DRS_NORMALIZENORMALS), state_normalize }, { /*143, WINED3DRS_NORMALIZENORMALS */ STATE_RENDER(WINED3DRS_NORMALIZENORMALS), state_normalize },
{ /*144, WINED3DRS_COLORKEYBLENDENABLE */ STATE_RENDER(WINED3DRS_COLORKEYBLENDENABLE), state_unknown }, { /*144, WINED3DRS_COLORKEYBLENDENABLE */ STATE_RENDER(WINED3DRS_COLORKEYBLENDENABLE), state_unknown },
{ /*145, WINED3DRS_DIFFUSEMATERIALSOURCE */ STATE_RENDER(WINED3DRS_COLORVERTEX), state_colormat }, { /*145, WINED3DRS_DIFFUSEMATERIALSOURCE */ STATE_RENDER(WINED3DRS_COLORVERTEX), state_colormat },
......
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