[dx90] Fix color masking

Jason Edmeades us at the-edmeades.demon.co.uk
Thu Oct 30 15:46:55 CST 2003


Changelog

ColorWriteEnable should not impact clearing the screen

Jason
-------------- next part --------------
Only in dlls/d3d8: basetexture.o
Only in dlls/d3d8: cubetexture.o
Only in dlls/d3d8: CVS
Only in dlls/d3d8: .cvsignore
Only in dlls/d3d8: d3d8.dll.dbg.o
Only in dlls/d3d8: d3d8.dll.so
Only in dlls/d3d8: d3d8_main.o
Only in dlls/d3d8: d3d8.spec
Only in dlls/d3d8: d3d8.spec.def
Only in dlls/d3d8: d3d8.spec.o
diff -u3 dlls/d3d8/dx89/device.c dlls/d3d8/device.c
--- dlls/d3d8/dx89/device.c	2003-10-29 00:12:00.000000000 +0000
+++ dlls/d3d8/device.c	2003-10-30 21:38:34.000000000 +0000
@@ -1382,6 +1382,9 @@
                      ((Color >>  0) & 0xFF) / 255.0f, 
 		     ((Color >> 24) & 0xFF) / 255.0f);
         checkGLcall("glClearColor");
+
+        /* Clear ALL colors! */
+        glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
         glMask = glMask | GL_COLOR_BUFFER_BIT;
     }
 
@@ -1426,6 +1429,10 @@
                      old_color_clear_value[1],
                      old_color_clear_value[2], 
                      old_color_clear_value[3]);
+        glColorMask(This->StateBlock->renderstate[D3DRS_COLORWRITEENABLE] & D3DCOLORWRITEENABLE_RED ? GL_TRUE : GL_FALSE, 
+                    This->StateBlock->renderstate[D3DRS_COLORWRITEENABLE] & D3DCOLORWRITEENABLE_GREEN ? GL_TRUE : GL_FALSE,
+                    This->StateBlock->renderstate[D3DRS_COLORWRITEENABLE] & D3DCOLORWRITEENABLE_BLUE  ? GL_TRUE : GL_FALSE, 
+                    This->StateBlock->renderstate[D3DRS_COLORWRITEENABLE] & D3DCOLORWRITEENABLE_ALPHA ? GL_TRUE : GL_FALSE);
     }
 
     glDisable(GL_SCISSOR_TEST);
@@ -2897,10 +2904,10 @@
 	      Value & D3DCOLORWRITEENABLE_GREEN ? 1 : 0,
 	      Value & D3DCOLORWRITEENABLE_BLUE  ? 1 : 0,
 	      Value & D3DCOLORWRITEENABLE_ALPHA ? 1 : 0); 
-	glColorMask(Value & D3DCOLORWRITEENABLE_RED, 
-                    Value & D3DCOLORWRITEENABLE_GREEN,
-		    Value & D3DCOLORWRITEENABLE_BLUE, 
-                    Value & D3DCOLORWRITEENABLE_ALPHA);
+        glColorMask(Value & D3DCOLORWRITEENABLE_RED   ? GL_TRUE : GL_FALSE, 
+                    Value & D3DCOLORWRITEENABLE_GREEN ? GL_TRUE : GL_FALSE,
+                    Value & D3DCOLORWRITEENABLE_BLUE  ? GL_TRUE : GL_FALSE, 
+                    Value & D3DCOLORWRITEENABLE_ALPHA ? GL_TRUE : GL_FALSE);
         checkGLcall("glColorMask(...)");
 		break;
 
Only in dlls/d3d8: device.o
Only in dlls/d3d8: directx.dx76
Only in dlls/d3d8: directx.o
Only in dlls/d3d8: drawprim.o
Only in dlls/d3d8: dx81
Only in dlls/d3d8: dx82
Only in dlls/d3d8: dx83
Only in dlls/d3d8: dx84
Only in dlls/d3d8: dx85
Only in dlls/d3d8: dx86
Only in dlls/d3d8: dx87
Only in dlls/d3d8: dx88
Only in dlls/d3d8: dx89
Only in dlls/d3d8: indexbuffer.o
Only in dlls/d3d8: lightsdebug
Only in dlls/d3d8: lockfix
Only in dlls/d3d8: Makefile
Only in dlls/d3d8: Makefile.in
Only in dlls/d3d8: manual_viewprojworld
Only in dlls/d3d8: resource.o
Only in dlls/d3d8: shader.o
Only in dlls/d3d8: stateblock.o
Only in dlls/d3d8: surface.o
Only in dlls/d3d8: swapchain.o
Only in dlls/d3d8: texture.o
Only in dlls/d3d8: utils.o
Only in dlls/d3d8: version.rc
Only in dlls/d3d8: version.res
Only in dlls/d3d8: vertexbuffer.o
Only in dlls/d3d8: volume.o
Only in dlls/d3d8: volumetexture.o
Only in dlls/d3d8: vshaderdeclaration.o
Only in dlls/d3d8: wip-08092003
Only in dlls/d3d8: wip-3dmark


More information about the wine-patches mailing list