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

wined3d: Move wined3drs_fogdensity to the state table.

parent af935a24
......@@ -3380,15 +3380,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, W
case WINED3DRS_FOGEND :
case WINED3DRS_RANGEFOGENABLE :
case WINED3DRS_FOGCOLOR :
StateTable[STATE_RENDER(State)].apply(STATE_RENDER(State), This->stateBlock);
break;
case WINED3DRS_FOGDENSITY :
{
tmpvalue.d = Value;
glFogfv(GL_FOG_DENSITY, &tmpvalue.f);
checkGLcall("glFogf(GL_FOG_DENSITY, (float) Value)");
}
StateTable[STATE_RENDER(State)].apply(STATE_RENDER(State), This->stateBlock);
break;
case WINED3DRS_VERTEXBLEND :
......
......@@ -800,6 +800,16 @@ static void state_fogcolor(DWORD state, IWineD3DStateBlockImpl *stateblock) {
checkGLcall("glFog GL_FOG_COLOR");
}
static void state_fogdensity(DWORD state, IWineD3DStateBlockImpl *stateblock) {
union {
DWORD d;
float f;
} tmpvalue;
tmpvalue.d = stateblock->renderState[WINED3DRS_FOGDENSITY];
glFogfv(GL_FOG_DENSITY, &tmpvalue.f);
checkGLcall("glFogf(GL_FOG_DENSITY, (float) Value)");
}
const struct StateEntry StateTable[] =
{
/* State name representative, apply function */
......@@ -841,7 +851,7 @@ const struct StateEntry StateTable[] =
{ /* 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 },
{ /* 38, WINED3DRS_FOGDENSITY */ STATE_RENDER(WINED3DRS_FOGDENSITY), state_unknown },
{ /* 38, WINED3DRS_FOGDENSITY */ STATE_RENDER(WINED3DRS_FOGDENSITY), state_fogdensity },
{ /* 39, WINED3DRS_STIPPLEENABLE */ STATE_RENDER(WINED3DRS_STIPPLEENABLE), state_unknown },
{ /* 40, WINED3DRS_EDGEANTIALIAS */ STATE_RENDER(WINED3DRS_ALPHABLENDENABLE), state_blend },
{ /* 41, WINED3DRS_COLORKEYENABLE */ STATE_RENDER(WINED3DRS_ALPHATESTENABLE), state_alpha },
......
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