d3dx9: Fix falling tests in native windows.

oldstable
David Adam 2009-01-13 12:22:25 +01:00 committed by Alexandre Julliard
parent 753affe48d
commit be964897aa
2 changed files with 15 additions and 5 deletions

View File

@ -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;
}

View File

@ -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;