Commit 920225d4 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Move WINED3DRS_POINTSPRITEENABLE to the state table.

parent 2b775221
...@@ -3406,6 +3406,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, W ...@@ -3406,6 +3406,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, W
case WINED3DRS_LOCALVIEWER : case WINED3DRS_LOCALVIEWER :
case WINED3DRS_LASTPIXEL : case WINED3DRS_LASTPIXEL :
case WINED3DRS_SOFTWAREVERTEXPROCESSING : case WINED3DRS_SOFTWAREVERTEXPROCESSING :
case WINED3DRS_POINTSPRITEENABLE :
StateTable[STATE_RENDER(State)].apply(STATE_RENDER(State), This->stateBlock); StateTable[STATE_RENDER(State)].apply(STATE_RENDER(State), This->stateBlock);
break; break;
...@@ -3415,31 +3416,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, W ...@@ -3415,31 +3416,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, W
LEAVE_GL(); LEAVE_GL();
return WINED3DERR_INVALIDCALL; return WINED3DERR_INVALIDCALL;
} }
case WINED3DRS_POINTSPRITEENABLE :
{
/* TODO: NV_POINT_SPRITE */
if (!GL_SUPPORT(ARB_POINT_SPRITE)) {
TRACE("Point sprites not supported\n");
break;
}
/*
* Point sprites are always enabled. Value controls texture coordinate
* replacement mode. Must be set true for point sprites to use
* textures.
*/
glEnable(GL_POINT_SPRITE_ARB);
checkGLcall("glEnable(GL_POINT_SPRITE_ARB)");
if (Value) {
glTexEnvf(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, TRUE);
checkGLcall("glTexEnvf(GL_POINT_SPRITE, GL_COORD_REPLACE, TRUE)");
} else {
glTexEnvf(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, FALSE);
checkGLcall("glTexEnvf(GL_POINT_SPRITE, GL_COORD_REPLACE, FALSE)");
}
break;
}
case WINED3DRS_WRAP0 : case WINED3DRS_WRAP0 :
case WINED3DRS_WRAP1 : case WINED3DRS_WRAP1 :
......
...@@ -1044,6 +1044,30 @@ static void state_lastpixel(DWORD state, IWineD3DStateBlockImpl *stateblock) { ...@@ -1044,6 +1044,30 @@ static void state_lastpixel(DWORD state, IWineD3DStateBlockImpl *stateblock) {
} }
} }
static void state_pointsprite(DWORD state, IWineD3DStateBlockImpl *stateblock) {
/* TODO: NV_POINT_SPRITE */
if (!GL_SUPPORT(ARB_POINT_SPRITE)) {
TRACE("Point sprites not supported\n");
return;
}
/*
* Point sprites are always enabled. Value controls texture coordinate
* replacement mode. Must be set true for point sprites to use
* textures.
*/
glEnable(GL_POINT_SPRITE_ARB);
checkGLcall("glEnable(GL_POINT_SPRITE_ARB)");
if (stateblock->renderState[WINED3DRS_POINTSPRITEENABLE]) {
glTexEnvf(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, TRUE);
checkGLcall("glTexEnvf(GL_POINT_SPRITE, GL_COORD_REPLACE, TRUE)");
} else {
glTexEnvf(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, FALSE);
checkGLcall("glTexEnvf(GL_POINT_SPRITE, GL_COORD_REPLACE, FALSE)");
}
}
const struct StateEntry StateTable[] = const struct StateEntry StateTable[] =
{ {
/* State name representative, apply function */ /* State name representative, apply function */
...@@ -1205,7 +1229,7 @@ const struct StateEntry StateTable[] = ...@@ -1205,7 +1229,7 @@ const struct StateEntry StateTable[] =
{ /*153, WINED3DRS_SOFTWAREVERTEXPROCESSING */ 0, state_nogl }, { /*153, WINED3DRS_SOFTWAREVERTEXPROCESSING */ 0, state_nogl },
{ /*154, WINED3DRS_POINTSIZE */ STATE_RENDER(WINED3DRS_POINTSIZE), state_psize }, { /*154, WINED3DRS_POINTSIZE */ STATE_RENDER(WINED3DRS_POINTSIZE), state_psize },
{ /*155, WINED3DRS_POINTSIZE_MIN */ STATE_RENDER(WINED3DRS_POINTSIZE_MIN), state_psizemin }, { /*155, WINED3DRS_POINTSIZE_MIN */ STATE_RENDER(WINED3DRS_POINTSIZE_MIN), state_psizemin },
{ /*156, WINED3DRS_POINTSPRITEENABLE */ STATE_RENDER(WINED3DRS_POINTSPRITEENABLE), state_unknown }, { /*156, WINED3DRS_POINTSPRITEENABLE */ STATE_RENDER(WINED3DRS_POINTSPRITEENABLE), state_pointsprite },
{ /*157, WINED3DRS_POINTSCALEENABLE */ STATE_RENDER(WINED3DRS_POINTSCALEENABLE), state_pscale }, { /*157, WINED3DRS_POINTSCALEENABLE */ STATE_RENDER(WINED3DRS_POINTSCALEENABLE), state_pscale },
{ /*158, WINED3DRS_POINTSCALE_A */ STATE_RENDER(WINED3DRS_POINTSCALEENABLE), state_pscale }, { /*158, WINED3DRS_POINTSCALE_A */ STATE_RENDER(WINED3DRS_POINTSCALEENABLE), state_pscale },
{ /*159, WINED3DRS_POINTSCALE_B */ STATE_RENDER(WINED3DRS_POINTSCALEENABLE), state_pscale }, { /*159, WINED3DRS_POINTSCALE_B */ STATE_RENDER(WINED3DRS_POINTSCALEENABLE), state_pscale },
......
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