mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-02 09:00:55 +00:00
wined3d: Fog fixes.
This commit is contained in:
parent
40d3cc5ee4
commit
d5f95961f1
1 changed files with 20 additions and 11 deletions
|
@ -3591,7 +3591,13 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
|
|||
{
|
||||
glHint(GL_FOG_HINT, GL_NICEST);
|
||||
switch (Value) {
|
||||
case D3DFOG_NONE: /* I don't know what to do here */ checkGLcall("glFogi(GL_FOG_MODE, GL_EXP"); break;
|
||||
case D3DFOG_NONE: {
|
||||
if(This->stateBlock->renderState[WINED3DRS_FOGVERTEXMODE] == D3DFOG_NONE) {
|
||||
glFogi(GL_FOG_MODE, GL_LINEAR); checkGLcall("glFogi(GL_FOG_MODE, GL_LINEAR");
|
||||
}
|
||||
/* Otherwise leave the vertex fog value */
|
||||
break;
|
||||
}
|
||||
case D3DFOG_EXP: glFogi(GL_FOG_MODE, GL_EXP); checkGLcall("glFogi(GL_FOG_MODE, GL_EXP"); break;
|
||||
case D3DFOG_EXP2: glFogi(GL_FOG_MODE, GL_EXP2); checkGLcall("glFogi(GL_FOG_MODE, GL_EXP2"); break;
|
||||
case D3DFOG_LINEAR: glFogi(GL_FOG_MODE, GL_LINEAR); checkGLcall("glFogi(GL_FOG_MODE, GL_LINEAR"); break;
|
||||
|
@ -3607,16 +3613,19 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
|
|||
case WINED3DRS_FOGVERTEXMODE :
|
||||
{
|
||||
glHint(GL_FOG_HINT, GL_FASTEST);
|
||||
switch (Value) {
|
||||
case D3DFOG_NONE: /* I don't know what to do here */ checkGLcall("glFogi(GL_FOG_MODE, GL_EXP"); break;
|
||||
case D3DFOG_EXP: glFogi(GL_FOG_MODE, GL_EXP); checkGLcall("glFogi(GL_FOG_MODE, GL_EXP"); break;
|
||||
case D3DFOG_EXP2: glFogi(GL_FOG_MODE, GL_EXP2); checkGLcall("glFogi(GL_FOG_MODE, GL_EXP2"); break;
|
||||
case D3DFOG_LINEAR: glFogi(GL_FOG_MODE, GL_LINEAR); checkGLcall("glFogi(GL_FOG_MODE, GL_LINEAR"); break;
|
||||
default:
|
||||
FIXME("Unsupported Value(%lu) for WINED3DRS_FOGTABLEMODE!\n", Value);
|
||||
}
|
||||
if (GL_SUPPORT(NV_FOG_DISTANCE)) {
|
||||
glFogi(GL_FOG_DISTANCE_MODE_NV, This->stateBlock->renderState[WINED3DRS_RANGEFOGENABLE] ? GL_EYE_RADIAL_NV : GL_EYE_PLANE_ABSOLUTE_NV);
|
||||
/* DX 7 sdk: "If both render states(vertex and table fog) are set to valid modes, the system will apply only pixel(=table) fog effects." */
|
||||
if(This->stateBlock->renderState[WINED3DRS_FOGTABLEMODE] == D3DFOG_NONE) {
|
||||
switch (Value) {
|
||||
case D3DFOG_EXP: glFogi(GL_FOG_MODE, GL_EXP); checkGLcall("glFogi(GL_FOG_MODE, GL_EXP"); break;
|
||||
case D3DFOG_EXP2: glFogi(GL_FOG_MODE, GL_EXP2); checkGLcall("glFogi(GL_FOG_MODE, GL_EXP2"); break;
|
||||
case D3DFOG_NONE:
|
||||
case D3DFOG_LINEAR: glFogi(GL_FOG_MODE, GL_LINEAR); checkGLcall("glFogi(GL_FOG_MODE, GL_LINEAR"); break;
|
||||
default:
|
||||
FIXME("Unsupported Value(%lu) for WINED3DRS_FOGTABLEMODE!\n", Value);
|
||||
}
|
||||
if (GL_SUPPORT(NV_FOG_DISTANCE)) {
|
||||
glFogi(GL_FOG_DISTANCE_MODE_NV, This->stateBlock->renderState[WINED3DRS_RANGEFOGENABLE] ? GL_EYE_RADIAL_NV : GL_EYE_PLANE_ABSOLUTE_NV);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue