Commit 08d17fd2 authored by David Adam's avatar David Adam Committed by Alexandre Julliard

d3dx8: Fix the condition in D3DXMatrixIsIdentity.

parent e8d7af2d
...@@ -140,6 +140,10 @@ static void D3DXMatrixTest(void) ...@@ -140,6 +140,10 @@ static void D3DXMatrixTest(void)
expected = TRUE; expected = TRUE;
got = D3DXMatrixIsIdentity(&mat); got = D3DXMatrixIsIdentity(&mat);
ok(expected == got, "Expected : %d, Got : %d\n", expected, got); ok(expected == got, "Expected : %d, Got : %d\n", expected, got);
U(mat).m[0][0] = 0.000009f;
expected = FALSE;
got = D3DXMatrixIsIdentity(&mat);
ok(expected == got, "Expected : %d, Got : %d\n", expected, got);
/* Test the NULL case */ /* Test the NULL case */
expected = FALSE; expected = FALSE;
got = D3DXMatrixIsIdentity(NULL); got = D3DXMatrixIsIdentity(NULL);
......
...@@ -351,7 +351,6 @@ static inline BOOL D3DXMatrixIsIdentity(D3DXMATRIX *pm) ...@@ -351,7 +351,6 @@ static inline BOOL D3DXMatrixIsIdentity(D3DXMATRIX *pm)
{ {
int i,j; int i,j;
D3DXMATRIX testmatrix; D3DXMATRIX testmatrix;
BOOL equal=TRUE;
if ( !pm ) return FALSE; if ( !pm ) return FALSE;
D3DXMatrixIdentity(&testmatrix); D3DXMatrixIdentity(&testmatrix);
...@@ -359,10 +358,10 @@ static inline BOOL D3DXMatrixIsIdentity(D3DXMATRIX *pm) ...@@ -359,10 +358,10 @@ static inline BOOL D3DXMatrixIsIdentity(D3DXMATRIX *pm)
{ {
for (j=0; j<4; j++) for (j=0; j<4; j++)
{ {
if ( fabs(D3DX_U(*pm).m[i][j] - D3DX_U(testmatrix).m[i][j]) > 0.0001 ) equal = FALSE; if ( D3DX_U(*pm).m[i][j] != D3DX_U(testmatrix).m[i][j] ) return FALSE;
} }
} }
return equal; return TRUE;
} }
#undef D3DX_U #undef D3DX_U
......
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