Module: wine Branch: master Commit: be964897aaabac04a75a2bc8d8186c81801e6f0c URL: http://source.winehq.org/git/wine.git/?a=commit;h=be964897aaabac04a75a2bc8d8...
Author: David Adam david.adam.cnrs@gmail.com Date: Tue Jan 13 12:22:25 2009 +0100
d3dx9: Fix falling tests in native windows.
---
dlls/d3dx9_36/math.c | 12 +++++++++++- dlls/d3dx9_36/tests/math.c | 8 ++++---- 2 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/dlls/d3dx9_36/math.c b/dlls/d3dx9_36/math.c index 542e408..13b8bd3 100644 --- a/dlls/d3dx9_36/math.c +++ b/dlls/d3dx9_36/math.c @@ -37,6 +37,7 @@ D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation2D( CONST D3DXVECTOR2 *protationcenter, FLOAT rotation, CONST D3DXVECTOR2 *ptranslation) { + D3DXMATRIX m1, m2, m3, m4, m5; D3DXQUATERNION rot; D3DXVECTOR3 rot_center, trans;
@@ -71,7 +72,16 @@ D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation2D( trans.z=0.0f; }
- D3DXMatrixAffineTransformation(pout, scaling, &rot_center, &rot, &trans); + D3DXMatrixScaling(&m1, scaling, scaling, 1.0f); + D3DXMatrixTranslation(&m2, -rot_center.x, -rot_center.y, -rot_center.z); + D3DXMatrixTranslation(&m4, rot_center.x, rot_center.y, rot_center.z); + D3DXMatrixRotationQuaternion(&m3, &rot); + D3DXMatrixTranslation(&m5, trans.x, trans.y, trans.z); + + D3DXMatrixMultiply(&m1, &m1, &m2); + D3DXMatrixMultiply(&m1, &m1, &m3); + D3DXMatrixMultiply(&m1, &m1, &m4); + D3DXMatrixMultiply(pout, &m1, &m5);
return pout; } diff --git a/dlls/d3dx9_36/tests/math.c b/dlls/d3dx9_36/tests/math.c index 2240fb0..50db67b 100644 --- a/dlls/d3dx9_36/tests/math.c +++ b/dlls/d3dx9_36/tests/math.c @@ -147,7 +147,7 @@ static void test_Matrix_AffineTransformation2D(void) U(exp_mat).m[3][1] = 6.401924f; U(exp_mat).m[0][2] = 0.0f; U(exp_mat).m[1][2] = 0.0f; - U(exp_mat).m[2][2] = 20.0f; + U(exp_mat).m[2][2] = 1.0f; U(exp_mat).m[3][2] = 0.0f; U(exp_mat).m[0][3] = 0.0f; U(exp_mat).m[1][3] = 0.0f; @@ -177,7 +177,7 @@ static void test_Matrix_AffineTransformation2D(void) U(exp_mat).m[3][1] = -0.598076f; U(exp_mat).m[0][2] = 0.0f; U(exp_mat).m[1][2] = 0.0f; - U(exp_mat).m[2][2] = 20.0f; + U(exp_mat).m[2][2] = 1.0f; U(exp_mat).m[3][2] = 0.0f; U(exp_mat).m[0][3] = 0.0f; U(exp_mat).m[1][3] = 0.0f; @@ -207,7 +207,7 @@ static void test_Matrix_AffineTransformation2D(void) U(exp_mat).m[3][1] = 7.0f; U(exp_mat).m[0][2] = 0.0f; U(exp_mat).m[1][2] = 0.0f; - U(exp_mat).m[2][2] = 20.0f; + U(exp_mat).m[2][2] = 1.0f; U(exp_mat).m[3][2] = 0.0f; U(exp_mat).m[0][3] = 0.0f; U(exp_mat).m[1][3] = 0.0f; @@ -234,7 +234,7 @@ static void test_Matrix_AffineTransformation2D(void) U(exp_mat).m[3][1] = 0.0f; U(exp_mat).m[0][2] = 0.0f; U(exp_mat).m[1][2] = 0.0f; - U(exp_mat).m[2][2] = -20.0f; + U(exp_mat).m[2][2] = 1.0f; U(exp_mat).m[3][2] = 0.0f; U(exp_mat).m[0][3] = 0.0f; U(exp_mat).m[1][3] = 0.0f;