? d3d8.dll.dbg.c
Index: d3d8_private.h
===================================================================
RCS file: /home/wine/wine/dlls/d3d8/d3d8_private.h,v
retrieving revision 1.68
diff -u -r1.68 d3d8_private.h
--- d3d8_private.h	27 Oct 2005 10:23:41 -0000	1.68
+++ d3d8_private.h	2 Nov 2005 23:21:05 -0000
@@ -299,6 +299,10 @@
 #define GL_EXTCALL(FuncName)          (This->direct3d8->gl_info.FuncName)
 #define GL_EXTCALL_DEV(FuncName, dev) ((dev)->direct3d8->gl_info.FuncName)
 
+#define D3DCOLOR_B_R(dw) (((dw) >> 16) & 0xFF)
+#define D3DCOLOR_B_G(dw) (((dw) >>  8) & 0xFF)
+#define D3DCOLOR_B_B(dw) (((dw) >>  0) & 0xFF)
+#define D3DCOLOR_B_A(dw) (((dw) >> 24) & 0xFF)
 
 #define D3DCOLOR_R(dw) (((float) (((dw) >> 16) & 0xFF)) / 255.0f)
 #define D3DCOLOR_G(dw) (((float) (((dw) >>  8) & 0xFF)) / 255.0f)
Index: device.c
===================================================================
RCS file: /home/wine/wine/dlls/d3d8/device.c,v
retrieving revision 1.131
diff -u -r1.131 device.c
--- device.c	27 Oct 2005 12:08:00 -0000	1.131
+++ device.c	2 Nov 2005 23:21:07 -0000
@@ -1411,10 +1411,10 @@
     if (Flags & D3DCLEAR_TARGET) {
         TRACE("Clearing screen with glClear to color %lx\n", Color);
         glGetFloatv(GL_COLOR_CLEAR_VALUE, old_color_clear_value);
-        glClearColor(((Color >> 16) & 0xFF) / 255.0f, 
-		     ((Color >>  8) & 0xFF) / 255.0f,
-                     ((Color >>  0) & 0xFF) / 255.0f, 
-		     ((Color >> 24) & 0xFF) / 255.0f);
+        glClearColor(D3DCOLOR_R(Color),
+		     D3DCOLOR_G(Color),
+		     D3DCOLOR_B(Color),
+		     D3DCOLOR_A(Color));
         checkGLcall("glClearColor");
 
         /* Clear ALL colors! */
Index: drawprim.c
===================================================================
RCS file: /home/wine/wine/dlls/d3d8/drawprim.c,v
retrieving revision 1.29
diff -u -r1.29 drawprim.c
--- drawprim.c	28 Jul 2005 10:16:54 -0000	1.29
+++ drawprim.c	2 Nov 2005 23:21:08 -0000
@@ -1159,30 +1159,30 @@
 
         /* Diffuse -------------------------------- */
         if (sd->u.s.diffuse.lpData != NULL) {
-            glColor4ub((diffuseColor >> 16) & 0xFF,
-                       (diffuseColor >>  8) & 0xFF,
-                       (diffuseColor >>  0) & 0xFF,
-                       (diffuseColor >> 24) & 0xFF);
-            VTRACE(("glColor4f: r,g,b,a=%f,%f,%f,%f\n", 
-                    ((diffuseColor >> 16) & 0xFF) / 255.0f, 
-                    ((diffuseColor >>  8) & 0xFF) / 255.0f,
-                    ((diffuseColor >>  0) & 0xFF) / 255.0f, 
-                    ((diffuseColor >> 24) & 0xFF) / 255.0f));
+	  glColor4ub(D3DCOLOR_B_R(diffuseColor),
+		     D3DCOLOR_B_G(diffuseColor),
+		     D3DCOLOR_B_B(diffuseColor),
+		     D3DCOLOR_B_A(diffuseColor));
+            VTRACE(("glColor4ub: r,g,b,a=%u,%u,%u,%u\n", 
+                    D3DCOLOR_B_R(diffuseColor),
+		    D3DCOLOR_B_G(diffuseColor),
+		    D3DCOLOR_B_B(diffuseColor),
+		    D3DCOLOR_B_A(diffuseColor)));
         } else {
             if (vx_index == 0) glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
         }
 
         /* Specular ------------------------------- */
-        if (sd->u.s.diffuse.lpData != NULL) {
-            VTRACE(("glSecondaryColor4ub: r,g,b=%f,%f,%f\n", 
-                    ((specularColor >> 16) & 0xFF) / 255.0f, 
-                    ((specularColor >>  8) & 0xFF) / 255.0f,
-                    ((specularColor >>  0) & 0xFF) / 255.0f));
+        if (sd->u.s.specular.lpData != NULL) {
+            VTRACE(("glSecondaryColor4ub: r,g,b=%u,%u,%u\n", 
+                    D3DCOLOR_B_R(specularColor), 
+                    D3DCOLOR_B_G(specularColor), 
+                    D3DCOLOR_B_B(specularColor)));
             if (GL_SUPPORT(EXT_SECONDARY_COLOR)) {
                 GL_EXTCALL(glSecondaryColor3ubEXT)(
-                           (specularColor >> 16) & 0xFF,
-                           (specularColor >>  8) & 0xFF,
-                           (specularColor >>  0) & 0xFF);
+                           D3DCOLOR_B_R(specularColor),
+                           D3DCOLOR_B_G(specularColor),
+                           D3DCOLOR_B_B(specularColor));
             } else {
 	      /* Do not worry if specular colour missing and disable request */
 	      VTRACE(("Specular color extensions not supplied\n"));
Index: vshaderdeclaration.c
===================================================================
RCS file: /home/wine/wine/dlls/d3d8/vshaderdeclaration.c,v
retrieving revision 1.12
diff -u -r1.12 vshaderdeclaration.c
--- vshaderdeclaration.c	9 Sep 2005 14:50:29 -0000	1.12
+++ vshaderdeclaration.c	2 Nov 2005 23:21:08 -0000
@@ -511,10 +511,10 @@
 	dw = *(const DWORD*) curPos;
 	curPos = curPos + sizeof(DWORD);
 	/**/
-	vshader->input.V[reg].x = (float) (((dw >> 16) & 0xFF) / 255.0f);
-	vshader->input.V[reg].y = (float) (((dw >>  8) & 0xFF) / 255.0f);
-	vshader->input.V[reg].z = (float) (((dw >>  0) & 0xFF) / 255.0f);
-	vshader->input.V[reg].w = (float) (((dw >> 24) & 0xFF) / 255.0f);
+	vshader->input.V[reg].x = D3DCOLOR_R(dw);
+	vshader->input.V[reg].y = D3DCOLOR_G(dw);
+	vshader->input.V[reg].z = D3DCOLOR_B(dw);
+        vshader->input.V[reg].w = D3DCOLOR_A(dw);
 	break;
 
       case D3DVSDT_SHORT2: 
@@ -549,11 +549,10 @@
 	dw = *(const DWORD*) curPos;
 	curPos = curPos + sizeof(DWORD);
 	/**/
-	vshader->input.V[reg].x = (float) ((dw & 0x000F) >>  0);
-	vshader->input.V[reg].y = (float) ((dw & 0x00F0) >>  8);
-	vshader->input.V[reg].z = (float) ((dw & 0x0F00) >> 16);
-	vshader->input.V[reg].w = (float) ((dw & 0xF000) >> 24);
-	
+	vshader->input.V[reg].x = (float) ((dw & 0x000000FF) >>  0);
+	vshader->input.V[reg].y = (float) ((dw & 0x0000FF00) >>  8);
+	vshader->input.V[reg].z = (float) ((dw & 0x00FF0000) >> 16);
+	vshader->input.V[reg].w = (float) ((dw & 0xFF000000) >> 24);
 	break;
 
       default: /** errooooorr what to do ? */
