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

Stefan Dösinger stefan at codeweavers.com
Wed Feb 28 10:18:45 CST 2007

-------------- next part --------------
From 1523786eed678d832bcce61db6d44bb9c6e21738 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
 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 9e5aeb7..efdd05d 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 :-) */
         checkGLcall("glDisable GL_FOG");
+        return;
     tmpvalue.d = stateblock->renderState[WINED3DRS_FOGSTART];

More information about the wine-patches mailing list