David Adam : d3dx9: Fix D3DXVec4Normalize to make tests pass in Windows.

Alexandre Julliard julliard at winehq.org
Mon Jul 20 07:36:44 CDT 2009


Module: wine
Branch: master
Commit: 8823decbd4b1fdcc3285ac4a3817bbd3ded4d653
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8823decbd4b1fdcc3285ac4a3817bbd3ded4d653

Author: David Adam <david.adam.cnrs at gmail.com>
Date:   Fri Jul 17 18:19:45 2009 +0200

d3dx9: Fix D3DXVec4Normalize to make tests pass in Windows.

---

 dlls/d3dx9_36/math.c       |   20 ++++++--------------
 dlls/d3dx9_36/tests/math.c |    4 ----
 2 files changed, 6 insertions(+), 18 deletions(-)

diff --git a/dlls/d3dx9_36/math.c b/dlls/d3dx9_36/math.c
index 1367884..ff19369 100644
--- a/dlls/d3dx9_36/math.c
+++ b/dlls/d3dx9_36/math.c
@@ -1725,20 +1725,12 @@ D3DXVECTOR4* WINAPI D3DXVec4Normalize(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv)
     FLOAT norm;
 
     norm = D3DXVec4Length(pv);
-    if ( !norm )
-    {
-     out.x = 0.0f;
-     out.y = 0.0f;
-     out.z = 0.0f;
-     out.w = 0.0f;
-    }
-    else
-    {
-     out.x = pv->x / norm;
-     out.y = pv->y / norm;
-     out.z = pv->z / norm;
-     out.w = pv->w / norm;
-    }
+
+    out.x = pv->x / norm;
+    out.y = pv->y / norm;
+    out.z = pv->z / norm;
+    out.w = pv->w / norm;
+
     *pout = out;
     return pout;
 }
diff --git a/dlls/d3dx9_36/tests/math.c b/dlls/d3dx9_36/tests/math.c
index 4b764cf..d2bdac0 100644
--- a/dlls/d3dx9_36/tests/math.c
+++ b/dlls/d3dx9_36/tests/math.c
@@ -1419,10 +1419,6 @@ static void D3DXVector4Test(void)
     expectedvec.x = 1.0f/11.0f; expectedvec.y = 2.0f/11.0f; expectedvec.z = 4.0f/11.0f; expectedvec.w = 10.0f/11.0f;
     D3DXVec4Normalize(&gotvec,&u);
     expect_vec4(expectedvec,gotvec);
-    /* Test the nul vector */
-    expectedvec.x = 0.0f; expectedvec.y = 0.0f; expectedvec.z = 0.0f; expectedvec.w = 0.0f;
-    D3DXVec4Normalize(&gotvec,&nul);
-    expect_vec4(expectedvec,gotvec);
 
 /*_______________D3DXVec4Scale____________________________*/
     expectedvec.x = -6.5f; expectedvec.y = -13.0f; expectedvec.z = -26.0f; expectedvec.w = -65.0f;




More information about the wine-cvs mailing list