From 2ea57677d3d9000365e85eeb8b1779b0cbf89cb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sun, 10 Dec 2006 23:20:05 +0100 Subject: [PATCH] wined3d: Move WINED3DRS_NORMALIZENORMALS to the state table. --- dlls/wined3d/device.c | 11 +---------- dlls/wined3d/state.c | 13 ++++++++++++- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 48e3fc7dfd3..d28ce6e7ee2 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3391,17 +3391,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, W case WINED3DRS_EMISSIVEMATERIALSOURCE : case WINED3DRS_LINEPATTERN : case WINED3DRS_ZBIAS : /* D3D8 only */ - StateTable[STATE_RENDER(State)].apply(STATE_RENDER(State), This->stateBlock); - break; - case WINED3DRS_NORMALIZENORMALS : - if (Value) { - glEnable(GL_NORMALIZE); - checkGLcall("glEnable(GL_NORMALIZE);"); - } else { - glDisable(GL_NORMALIZE); - checkGLcall("glDisable(GL_NORMALIZE);"); - } + StateTable[STATE_RENDER(State)].apply(STATE_RENDER(State), This->stateBlock); break; case WINED3DRS_POINTSIZE : diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 717ec14aeab..b635df08df0 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -896,6 +896,17 @@ static void state_zbias(DWORD state, IWineD3DStateBlockImpl *stateblock) { } } + +static void state_normalize(DWORD state, IWineD3DStateBlockImpl *stateblock) { + if (stateblock->renderState[WINED3DRS_NORMALIZENORMALS]) { + glEnable(GL_NORMALIZE); + checkGLcall("glEnable(GL_NORMALIZE);"); + } else { + glDisable(GL_NORMALIZE); + checkGLcall("glDisable(GL_NORMALIZE);"); + } +} + const struct StateEntry StateTable[] = { /* State name representative, apply function */ @@ -1044,7 +1055,7 @@ const struct StateEntry StateTable[] = { /*140, WINED3DRS_FOGVERTEXMODE */ STATE_RENDER(WINED3DRS_FOGENABLE), state_fog }, { /*141, WINED3DRS_COLORVERTEX */ STATE_RENDER(WINED3DRS_COLORVERTEX), state_colormat }, { /*142, WINED3DRS_LOCALVIEWER */ STATE_RENDER(WINED3DRS_LOCALVIEWER), state_unknown }, - { /*143, WINED3DRS_NORMALIZENORMALS */ STATE_RENDER(WINED3DRS_NORMALIZENORMALS), state_unknown }, + { /*143, WINED3DRS_NORMALIZENORMALS */ STATE_RENDER(WINED3DRS_NORMALIZENORMALS), state_normalize }, { /*144, WINED3DRS_COLORKEYBLENDENABLE */ STATE_RENDER(WINED3DRS_COLORKEYBLENDENABLE), state_unknown }, { /*145, WINED3DRS_DIFFUSEMATERIALSOURCE */ STATE_RENDER(WINED3DRS_COLORVERTEX), state_colormat }, { /*146, WINED3DRS_SPECULARMATERIALSOURCE */ STATE_RENDER(WINED3DRS_COLORVERTEX), state_colormat },