[PATCH] Implement D3DXMatrixMultiplyTranspose with atest

David Adam David.Adam at math.cnrs.fr
Sun Nov 11 10:24:43 CST 2007


---
 dlls/d3dx8/d3dx8.spec   |    1 +
 dlls/d3dx8/math.c       |    9 +++++++++
 dlls/d3dx8/tests/math.c |    8 ++++++++
 include/d3dx8math.h     |    1 +
 4 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/dlls/d3dx8/d3dx8.spec b/dlls/d3dx8/d3dx8.spec
index 391da82..4b29b61 100644
--- a/dlls/d3dx8/d3dx8.spec
+++ b/dlls/d3dx8/d3dx8.spec
@@ -22,6 +22,7 @@
 @ stdcall D3DXVec4Transform(ptr ptr ptr)
 @ stdcall D3DXMatrixfDeterminant(ptr)
 @ stdcall D3DXMatrixMultiply(ptr ptr ptr)
+@ stdcall D3DXMatrixMultiplyTranspose(ptr ptr ptr)
 @ stdcall D3DXMatrixTranspose(ptr ptr)
 @ stdcall D3DXMatrixInverse(ptr ptr ptr)
 @ stdcall D3DXMatrixScaling(ptr long long long)
diff --git a/dlls/d3dx8/math.c b/dlls/d3dx8/math.c
index 6179dde..6468867 100644
--- a/dlls/d3dx8/math.c
+++ b/dlls/d3dx8/math.c
@@ -158,6 +158,15 @@ D3DXMATRIX* WINAPI D3DXMatrixMultiply(D3DXMATRIX *pout,=
 CONST D3DXMATRIX *pm1, C
     return pout;
 }
=20
+D3DXMATRIX* WINAPI D3DXMatrixMultiplyTranspose(D3DXMATRIX *pout, CONST D3DX=
MATRIX *pm1, CONST D3DXMATRIX *pm2)
+{
+    D3DXMATRIX temp;
+
+    D3DXMatrixMultiply(&temp, pm1, pm2);
+    D3DXMatrixTranspose(pout, &temp);
+    return pout;
+}
+
 D3DXMATRIX* WINAPI D3DXMatrixOrthoLH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FL=
OAT zn, FLOAT zf)
 {
     D3DXMatrixIdentity(pout);
diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx8/tests/math.c
index a796c6e..6a20a30 100644
--- a/dlls/d3dx8/tests/math.c
+++ b/dlls/d3dx8/tests/math.c
@@ -235,6 +235,14 @@ static void D3DXMatrixTest(void)
     D3DXMatrixMultiply(&gotmat,&mat,&mat2);
     expect_mat(expectedmat,gotmat);
=20
+/*____________D3DXMatrixMultiplyTranspose____*/
+    expectedmat.m[0][0] =3D 73.0f; expectedmat.m[0][1] =3D 231.0f; expected=
mat.m[0][2] =3D 239.0f; expectedmat.m[0][3] =3D -164.0f;
+    expectedmat.m[1][0] =3D 193.0f; expectedmat.m[1][1] =3D 551.0f; expecte=
dmat.m[1][2] =3D 523.0f; expectedmat.m[1][3] =3D -320.0;
+    expectedmat.m[2][0] =3D -197.0f; expectedmat.m[2][1] =3D -489.0f; expec=
tedmat.m[2][2] =3D -400.0f; expectedmat.m[2][3] =3D 187.0f;
+    expectedmat.m[3][0] =3D -77.0f; expectedmat.m[3][1] =3D -169.0f; expect=
edmat.m[3][2] =3D -116.0f; expectedmat.m[3][3] =3D 31.0f;
+    D3DXMatrixMultiplyTranspose(&gotmat,&mat,&mat2);
+    expect_mat(expectedmat,gotmat);
+
 /*____________D3DXMatrixOrthoLH_______________*/
     U(expectedmat).m[0][0] =3D 0.8f; U(expectedmat).m[0][1] =3D 0.0f; U(exp=
ectedmat).m[0][2] =3D 0.0f; U(expectedmat).m[0][3] =3D 0.0f;
     U(expectedmat).m[1][0] =3D 0.0f; U(expectedmat).m[1][1] =3D 0.270270f; =
U(expectedmat).m[1][2] =3D 0.0f; U(expectedmat).m[1][3] =3D 0.0f;
diff --git a/include/d3dx8math.h b/include/d3dx8math.h
index 98b2395..f9a9563 100644
--- a/include/d3dx8math.h
+++ b/include/d3dx8math.h
@@ -63,6 +63,7 @@ D3DXMATRIX* WINAPI D3DXMatrixInverse(D3DXMATRIX *pout, FLO=
AT *pdeterminant, CONS
 D3DXMATRIX* WINAPI D3DXMatrixLookAtLH(D3DXMATRIX *pout, CONST D3DXVECTOR3 *=
peye, CONST D3DXVECTOR3 *pat, CONST D3DXVECTOR3 *pup);
 D3DXMATRIX* WINAPI D3DXMatrixLookAtRH(D3DXMATRIX *pout, CONST D3DXVECTOR3 *=
peye, CONST D3DXVECTOR3 *pat, CONST D3DXVECTOR3 *pup);
 D3DXMATRIX* WINAPI D3DXMatrixMultiply(D3DXMATRIX *pout, CONST D3DXMATRIX *p=
m1, CONST D3DXMATRIX *pm2);
+D3DXMATRIX* WINAPI D3DXMatrixMultiplyTranspose(D3DXMATRIX *pout, CONST D3DX=
MATRIX *pm1, CONST D3DXMATRIX *pm2);
 D3DXMATRIX* WINAPI D3DXMatrixOrthoLH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FL=
OAT zn, FLOAT zf);
 D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterLH(D3DXMATRIX *pout, FLOAT l, FL=
OAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf);
 D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterRH(D3DXMATRIX *pout, FLOAT l, FL=
OAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf);
--=20
1.5.3.2


--=_6fpja87xgicc--



More information about the wine-patches mailing list