Module: wine Branch: master Commit: d7e55c28417656a045520b0c8278403f4e499788 URL: http://source.winehq.org/git/wine.git/?a=commit;h=d7e55c28417656a045520b0c82...
Author: Stefan Dösinger stefan@codeweavers.com Date: Sun Dec 10 23:20:48 2006 +0100
wined3d: Move WINED3DRS_SCISSORTESTENABLE to the state table.
---
dlls/wined3d/device.c | 12 +----------- dlls/wined3d/state.c | 12 +++++++++++- 2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 0f82021..3a19db5 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3424,6 +3424,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl case WINED3DRS_WRAP14 : case WINED3DRS_WRAP15 : case WINED3DRS_MULTISAMPLEANTIALIAS : + case WINED3DRS_SCISSORTESTENABLE : StateTable[STATE_RENDER(State)].apply(STATE_RENDER(State), This->stateBlock); break;
@@ -3434,17 +3435,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl return WINED3DERR_INVALIDCALL; }
- case WINED3DRS_SCISSORTESTENABLE : - { - if(Value) { - glEnable(GL_SCISSOR_TEST); - checkGLcall("glEnable(GL_SCISSOR_TEST)"); - } else { - glDisable(GL_SCISSOR_TEST); - checkGLcall("glDisable(GL_SCISSOR_TEST)"); - } - break; - } case WINED3DRS_SLOPESCALEDEPTHBIAS : { if(Value) { diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 016c338..353793b 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -1115,6 +1115,16 @@ static void state_multisampleaa(DWORD st } }
+static void state_scissor(DWORD state, IWineD3DStateBlockImpl *stateblock) { + if(stateblock->renderState[WINED3DRS_SCISSORTESTENABLE]) { + glEnable(GL_SCISSOR_TEST); + checkGLcall("glEnable(GL_SCISSOR_TEST)"); + } else { + glDisable(GL_SCISSOR_TEST); + checkGLcall("glDisable(GL_SCISSOR_TEST)"); + } +} + const struct StateEntry StateTable[] = { /* State name representative, apply function */ @@ -1296,7 +1306,7 @@ const struct StateEntry StateTable[] = { /*173, WINED3DRS_NORMALDEGREE */ STATE_RENDER(WINED3DRS_NORMALDEGREE), state_unknown }, /*172, WINED3DRS_POSITIONORDER */ /* Value assigned to 2 state names */ /*173, WINED3DRS_NORMALORDER */ /* Value assigned to 2 state names */ - { /*174, WINED3DRS_SCISSORTESTENABLE */ STATE_RENDER(WINED3DRS_SCISSORTESTENABLE), state_unknown }, + { /*174, WINED3DRS_SCISSORTESTENABLE */ STATE_RENDER(WINED3DRS_SCISSORTESTENABLE), state_scissor }, { /*175, WINED3DRS_SLOPESCALEDEPTHBIAS */ STATE_RENDER(WINED3DRS_DEPTHBIAS), state_unknown }, { /*176, WINED3DRS_ANTIALIASEDLINEENABLE */ STATE_RENDER(WINED3DRS_ALPHABLENDENABLE), state_blend }, { /*177, undefined */ 0, state_undefined },