Commit 68f10822 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Move WINED3DRS_SHADEMODE to the state table.

parent e4b4c040
......@@ -3440,26 +3440,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, W
case WINED3DRS_LIGHTING :
case WINED3DRS_ZENABLE :
case WINED3DRS_CULLMODE :
case WINED3DRS_SHADEMODE :
StateTable[STATE_RENDER(State)].apply(STATE_RENDER(State), This->stateBlock);
break;
case WINED3DRS_SHADEMODE :
switch ((WINED3DSHADEMODE) Value) {
case WINED3DSHADE_FLAT:
glShadeModel(GL_FLAT);
checkGLcall("glShadeModel");
break;
case WINED3DSHADE_GOURAUD:
glShadeModel(GL_SMOOTH);
checkGLcall("glShadeModel");
break;
case WINED3DSHADE_PHONG:
FIXME("WINED3DSHADE_PHONG isn't supported\n");
break;
default:
FIXME("Unrecognized/Unhandled WINED3DSHADEMODE value %d\n", Value);
}
break;
case WINED3DRS_DITHERENABLE :
if (Value) {
......
......@@ -154,6 +154,24 @@ static void state_cullmode(DWORD state, IWineD3DStateBlockImpl *stateblock) {
}
}
static void state_shademode(DWORD state, IWineD3DStateBlockImpl *stateblock) {
switch ((WINED3DSHADEMODE) stateblock->renderState[WINED3DRS_SHADEMODE]) {
case WINED3DSHADE_FLAT:
glShadeModel(GL_FLAT);
checkGLcall("glShadeModel(GL_FLAT)");
break;
case WINED3DSHADE_GOURAUD:
glShadeModel(GL_SMOOTH);
checkGLcall("glShadeModel(GL_SMOOTH)");
break;
case WINED3DSHADE_PHONG:
FIXME("WINED3DSHADE_PHONG isn't supported\n");
break;
default:
FIXME("Unrecognized/Unhandled WINED3DSHADEMODE value %d\n", stateblock->renderState[WINED3DRS_SHADEMODE]);
}
}
const struct StateEntry StateTable[] =
{
/* State name representative, apply function */
......@@ -166,7 +184,7 @@ const struct StateEntry StateTable[] =
{ /* 6, WINED3DRS_WRAPV */ STATE_RENDER(WINED3DRS_WRAPV), state_unknown },
{ /* 7, WINED3DRS_ZENABLE */ STATE_RENDER(WINED3DRS_ZENABLE), state_zenable },
{ /* 8, WINED3DRS_FILLMODE */ STATE_RENDER(WINED3DRS_FILLMODE), state_fillmode },
{ /* 9, WINED3DRS_SHADEMODE */ STATE_RENDER(WINED3DRS_SHADEMODE), state_unknown },
{ /* 9, WINED3DRS_SHADEMODE */ STATE_RENDER(WINED3DRS_SHADEMODE), state_shademode },
{ /* 10, WINED3DRS_LINEPATTERN */ STATE_RENDER(WINED3DRS_LINEPATTERN), state_unknown },
{ /* 11, WINED3DRS_MONOENABLE */ STATE_RENDER(WINED3DRS_MONOENABLE), state_unknown },
{ /* 12, WINED3DRS_ROP2 */ STATE_RENDER(WINED3DRS_ROP2), state_unknown },
......
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