Commit 10d12539 authored by Nozomi Kodama's avatar Nozomi Kodama Committed by Alexandre Julliard

d3dx9: Simplify D3DXComputeBoundingSphere.

parent 0ef523e2
...@@ -1991,7 +1991,7 @@ HRESULT WINAPI D3DXComputeBoundingBox(CONST D3DXVECTOR3 *pfirstposition, DWORD n ...@@ -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) HRESULT WINAPI D3DXComputeBoundingSphere(CONST D3DXVECTOR3* pfirstposition, DWORD numvertices, DWORD dwstride, D3DXVECTOR3 *pcenter, FLOAT *pradius)
{ {
D3DXVECTOR3 temp, temp1; D3DXVECTOR3 temp;
FLOAT d; FLOAT d;
unsigned int i; unsigned int i;
...@@ -2000,16 +2000,12 @@ HRESULT WINAPI D3DXComputeBoundingSphere(CONST D3DXVECTOR3* pfirstposition, DWOR ...@@ -2000,16 +2000,12 @@ HRESULT WINAPI D3DXComputeBoundingSphere(CONST D3DXVECTOR3* pfirstposition, DWOR
temp.x = 0.0f; temp.x = 0.0f;
temp.y = 0.0f; temp.y = 0.0f;
temp.z = 0.0f; temp.z = 0.0f;
temp1 = temp;
*pradius = 0.0f; *pradius = 0.0f;
for(i=0; i<numvertices; i++) for(i=0; i<numvertices; i++)
{ D3DXVec3Add(&temp, &temp, (const D3DXVECTOR3*)((const char*)pfirstposition + dwstride * i));
D3DXVec3Add(&temp1, &temp, (const D3DXVECTOR3*)((const char*)pfirstposition + dwstride * i));
temp = temp1;
}
D3DXVec3Scale(pcenter, &temp, 1.0f/((FLOAT)numvertices)); D3DXVec3Scale(pcenter, &temp, 1.0f / numvertices);
for(i=0; i<numvertices; i++) for(i=0; i<numvertices; i++)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment