[12/12] WineD3D: Leave the fog state handler after disabling fog

Stefan Dösinger stefan at codeweavers.com
Mon Feb 26 06:52:28 CST 2007


-------------- next part --------------
From f2311582ff230e5a3a08713ffd651f724fc77263 Mon Sep 17 00:00:00 2001
From: Stefan Doesinger <stefan at codeweavers.com>
Date: Sun, 25 Feb 2007 23:58:14 +0100
Subject: [PATCH] WineD3D: Leave the fog state handler after disabling fog

If D3DRS_FOGENABLE is false GL_FOG is disabled, and state_fog can be
left immediately because everything else done in there will have no
effect. It seems that I've been a it sloppy when I wrote that code, so I
forgot the return.

The existing code works because there is a double check on fogenable.
Depending on the fog parameters in the stateblock and supported opengl
extensions, fogging may be disabled if GL_EXT_fog_coord is not
supported. A check for fogenable after those checks caught disabling the
fog.
---
 dlls/wined3d/state.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 2b76dff..ca80316 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -666,6 +666,7 @@ static void state_fog(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCo
         /* No fog? Disable it, and we're done :-) */
         glDisable(GL_FOG);
         checkGLcall("glDisable GL_FOG");
+        return;
     }
 
     tmpvalue.d = stateblock->renderState[WINED3DRS_FOGSTART];
-- 
1.4.4.3



More information about the wine-patches mailing list