[D3D] Fixed XYZRHW vertex handling

Christian Costa titan.costa at wanadoo.fr
Thu Aug 5 20:17:10 CDT 2004


Francois Gouget wrote:

>--- 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)
>
>
>
>  
>
This is cleaner but it adds an extra call.
Since handle_xyzrhw is "call" for each vertex, I would leave it as is. :-)

Bye,
Christian





More information about the wine-devel mailing list