[D3D] Fixed XYZRHW vertex handling

Francois Gouget fgouget at free.fr
Thu Aug 5 13:30:56 CDT 2004


--- dlls/ddraw/d3ddevice/mesa_old.c     2004-08-05 15:11:43.000000000 +0100
+++ dlls/ddraw/d3ddevice/mesa.c 2004-08-05 12:50:45.000000000 +0100
@@ -1172,7 +1172,7 @@
     glVertex3fv(coords);
 }
 inline static void handle_xyzrhw(D3DVALUE *coords) {
-    if (coords[3] < 1e-8)
+    if ((coords[3] < 1e-8) && (coords[3] > -1e-8))
         glVertex3fv(coords);
     else {
         GLfloat w = 1.0 / coords[3];

This could be a job for fabsf of fabs (might be more portable):

+    if (fabsf(coords[3]) < 1e-8)



-- 
Francois Gouget         fgouget at free.fr        http://fgouget.free.fr/
      Any sufficiently advanced bug is indistinguishable from a feature.
                            -- from some indian guy



More information about the wine-devel mailing list