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

wined3d: Move WINED3DRS_FOGCOLOR to the state table.

parent f2602486
......@@ -3379,17 +3379,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, W
case WINED3DRS_FOGSTART :
case WINED3DRS_FOGEND :
case WINED3DRS_RANGEFOGENABLE :
StateTable[STATE_RENDER(State)].apply(STATE_RENDER(State), This->stateBlock);
break;
case WINED3DRS_FOGCOLOR :
{
float col[4];
D3DCOLORTOGLFLOAT4(Value, col);
/* Set the default alpha blend color */
glFogfv(GL_FOG_COLOR, &col[0]);
checkGLcall("glFog GL_FOG_COLOR");
}
StateTable[STATE_RENDER(State)].apply(STATE_RENDER(State), This->stateBlock);
break;
case WINED3DRS_FOGDENSITY :
......
......@@ -792,6 +792,14 @@ static void state_fog(DWORD state, IWineD3DStateBlockImpl *stateblock) {
}
}
static void state_fogcolor(DWORD state, IWineD3DStateBlockImpl *stateblock) {
float col[4];
D3DCOLORTOGLFLOAT4(stateblock->renderState[WINED3DRS_FOGCOLOR], col);
/* Set the default alpha blend color */
glFogfv(GL_FOG_COLOR, &col[0]);
checkGLcall("glFog GL_FOG_COLOR");
}
const struct StateEntry StateTable[] =
{
/* State name representative, apply function */
......@@ -829,7 +837,7 @@ const struct StateEntry StateTable[] =
{ /* 31, WINED3DRS_SUBPIXEL */ STATE_RENDER(WINED3DRS_SUBPIXEL), state_unknown },
{ /* 32, WINED3DRS_SUBPIXELX */ STATE_RENDER(WINED3DRS_SUBPIXELX), state_unknown },
{ /* 33, WINED3DRS_STIPPLEDALPHA */ STATE_RENDER(WINED3DRS_STIPPLEDALPHA), state_unknown },
{ /* 34, WINED3DRS_FOGCOLOR */ STATE_RENDER(WINED3DRS_FOGCOLOR), state_unknown },
{ /* 34, WINED3DRS_FOGCOLOR */ STATE_RENDER(WINED3DRS_FOGCOLOR), state_fogcolor },
{ /* 35, WINED3DRS_FOGTABLEMODE */ STATE_RENDER(WINED3DRS_FOGENABLE), state_fog },
{ /* 36, WINED3DRS_FOGSTART */ STATE_RENDER(WINED3DRS_FOGENABLE), state_fog },
{ /* 37, WINED3DRS_FOGEND */ STATE_RENDER(WINED3DRS_FOGENABLE), state_fog },
......
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