Nozomi Kodama : d3dx9: Simplify D3DXComputeBoundingSphere.

Alexandre Julliard julliard at winehq.org
Tue Sep 25 15:13:38 CDT 2012


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

Author: Nozomi Kodama <nozomi.kodama at yahoo.com>
Date:   Fri Sep 21 23:19:29 2012 +0800

d3dx9: Simplify D3DXComputeBoundingSphere.

---

 dlls/d3dx9_36/mesh.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/dlls/d3dx9_36/mesh.c b/dlls/d3dx9_36/mesh.c
index de4049a..ded0848 100644
--- a/dlls/d3dx9_36/mesh.c
+++ b/dlls/d3dx9_36/mesh.c
@@ -1991,7 +1991,7 @@ HRESULT WINAPI D3DXComputeBoundingBox(CONST D3DXVECTOR3 *pfirstposition, DWORD n
  */
 HRESULT WINAPI D3DXComputeBoundingSphere(CONST D3DXVECTOR3* pfirstposition, DWORD numvertices, DWORD dwstride, D3DXVECTOR3 *pcenter, FLOAT *pradius)
 {
-    D3DXVECTOR3 temp, temp1;
+    D3DXVECTOR3 temp;
     FLOAT d;
     unsigned int i;
 
@@ -2000,16 +2000,12 @@ HRESULT WINAPI D3DXComputeBoundingSphere(CONST D3DXVECTOR3* pfirstposition, DWOR
     temp.x = 0.0f;
     temp.y = 0.0f;
     temp.z = 0.0f;
-    temp1 = temp;
     *pradius = 0.0f;
 
     for(i=0; i<numvertices; i++)
-    {
-        D3DXVec3Add(&temp1, &temp, (const D3DXVECTOR3*)((const char*)pfirstposition + dwstride * i));
-        temp = temp1;
-    }
+        D3DXVec3Add(&temp, &temp, (const D3DXVECTOR3*)((const char*)pfirstposition + dwstride * i));
 
-    D3DXVec3Scale(pcenter, &temp, 1.0f/((FLOAT)numvertices));
+    D3DXVec3Scale(pcenter, &temp, 1.0f / numvertices);
 
     for(i=0; i<numvertices; i++)
     {




More information about the wine-cvs mailing list