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)
expected = TRUE;
got = D3DXMatrixIsIdentity(&mat);
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 */
expected = FALSE;
got = D3DXMatrixIsIdentity(NULL);
......
......@@ -351,7 +351,6 @@ static inline BOOL D3DXMatrixIsIdentity(D3DXMATRIX *pm)
{
int i,j;
D3DXMATRIX testmatrix;
BOOL equal=TRUE;
if ( !pm ) return FALSE;
D3DXMatrixIdentity(&testmatrix);
......@@ -359,10 +358,10 @@ static inline BOOL D3DXMatrixIsIdentity(D3DXMATRIX *pm)
{
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
......
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