wined3d: Move WINED3DRS_SHADEMODE to the state table.
This commit is contained in:
parent
e4b4c040f0
commit
68f1082284
|
@ -3440,26 +3440,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, W
|
||||||
case WINED3DRS_LIGHTING :
|
case WINED3DRS_LIGHTING :
|
||||||
case WINED3DRS_ZENABLE :
|
case WINED3DRS_ZENABLE :
|
||||||
case WINED3DRS_CULLMODE :
|
case WINED3DRS_CULLMODE :
|
||||||
|
case WINED3DRS_SHADEMODE :
|
||||||
StateTable[STATE_RENDER(State)].apply(STATE_RENDER(State), This->stateBlock);
|
StateTable[STATE_RENDER(State)].apply(STATE_RENDER(State), This->stateBlock);
|
||||||
break;
|
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 :
|
case WINED3DRS_DITHERENABLE :
|
||||||
if (Value) {
|
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[] =
|
const struct StateEntry StateTable[] =
|
||||||
{
|
{
|
||||||
/* State name representative, apply function */
|
/* State name representative, apply function */
|
||||||
|
@ -166,7 +184,7 @@ const struct StateEntry StateTable[] =
|
||||||
{ /* 6, WINED3DRS_WRAPV */ STATE_RENDER(WINED3DRS_WRAPV), state_unknown },
|
{ /* 6, WINED3DRS_WRAPV */ STATE_RENDER(WINED3DRS_WRAPV), state_unknown },
|
||||||
{ /* 7, WINED3DRS_ZENABLE */ STATE_RENDER(WINED3DRS_ZENABLE), state_zenable },
|
{ /* 7, WINED3DRS_ZENABLE */ STATE_RENDER(WINED3DRS_ZENABLE), state_zenable },
|
||||||
{ /* 8, WINED3DRS_FILLMODE */ STATE_RENDER(WINED3DRS_FILLMODE), state_fillmode },
|
{ /* 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 },
|
{ /* 10, WINED3DRS_LINEPATTERN */ STATE_RENDER(WINED3DRS_LINEPATTERN), state_unknown },
|
||||||
{ /* 11, WINED3DRS_MONOENABLE */ STATE_RENDER(WINED3DRS_MONOENABLE), state_unknown },
|
{ /* 11, WINED3DRS_MONOENABLE */ STATE_RENDER(WINED3DRS_MONOENABLE), state_unknown },
|
||||||
{ /* 12, WINED3DRS_ROP2 */ STATE_RENDER(WINED3DRS_ROP2), state_unknown },
|
{ /* 12, WINED3DRS_ROP2 */ STATE_RENDER(WINED3DRS_ROP2), state_unknown },
|
||||||
|
|
Loading…
Reference in New Issue