d3dx8: Implement D3DXMatrixScaling.

This commit is contained in:
David Adam 2007-10-30 15:24:17 +01:00 committed by Alexandre Julliard
parent e8f887dc18
commit 716862d696
4 changed files with 19 additions and 1 deletions

View File

@ -24,7 +24,7 @@
@ stdcall D3DXMatrixMultiply(ptr ptr ptr)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ stub D3DXMatrixInverse
@ stub D3DXMatrixScaling
@ stdcall D3DXMatrixScaling(ptr long long long)
@ stub D3DXMatrixTranslation
@ stub D3DXMatrixRotationX
@ stub D3DXMatrixRotationY

View File

@ -58,6 +58,15 @@ D3DXMATRIX* WINAPI D3DXMatrixMultiply(D3DXMATRIX *pout, CONST D3DXMATRIX *pm1, C
return pout;
}
D3DXMATRIX* WINAPI D3DXMatrixScaling(D3DXMATRIX *pout, FLOAT sx, FLOAT sy, FLOAT sz)
{
D3DXMatrixIdentity(pout);
pout->m[0][0] = sx;
pout->m[1][1] = sy;
pout->m[2][2] = sz;
return pout;
}
D3DXMATRIX* WINAPI D3DXMatrixTranspose(D3DXMATRIX *pout, CONST D3DXMATRIX *pm)
{
int i,j;

View File

@ -196,6 +196,14 @@ static void D3DXMatrixTest(void)
D3DXMatrixMultiply(&gotmat,&mat,&mat2);
expect_mat(expectedmat,gotmat);
/*____________D3DXMatrixScaling______________*/
expectedmat.m[0][0] = 0.69f; expectedmat.m[0][1] = 0.0f; expectedmat.m[0][2] = 0.0f; expectedmat.m[0][3] = 0.0f;
expectedmat.m[1][0] = 0.0; expectedmat.m[1][1] = 0.53f; expectedmat.m[1][2] = 0.0f; expectedmat.m[1][3] = 0.0f;
expectedmat.m[2][0] = 0.0f; expectedmat.m[2][1] = 0.0f; expectedmat.m[2][2] = 4.11f; expectedmat.m[2][3] = 0.0f;
expectedmat.m[3][0] = 0.0f; expectedmat.m[3][1] = 0.0f; expectedmat.m[3][2] = 0.0f; expectedmat.m[3][3] = 1.0f;
D3DXMatrixScaling(&gotmat,0.69f,0.53f,4.11f);
expect_mat(expectedmat,gotmat);
/*____________D3DXMatrixTranspose______________*/
expectedmat.m[0][0] = 10.0f; expectedmat.m[0][1] = 11.0f; expectedmat.m[0][2] = 19.0f; expectedmat.m[0][3] = 2.0f;
expectedmat.m[1][0] = 5.0; expectedmat.m[1][1] = 20.0f; expectedmat.m[1][2] = -21.0f; expectedmat.m[1][3] = 3.0f;

View File

@ -60,6 +60,7 @@ typedef struct D3DXCOLOR
FLOAT WINAPI D3DXMatrixfDeterminant(CONST D3DXMATRIX *pm);
D3DXMATRIX* WINAPI D3DXMatrixMultiply(D3DXMATRIX *pout, CONST D3DXMATRIX *pm1, CONST D3DXMATRIX *pm2);
D3DXMATRIX* WINAPI D3DXMatrixScaling(D3DXMATRIX *pout, FLOAT sx, FLOAT sy, FLOAT sz);
D3DXMATRIX* WINAPI D3DXMatrixTranspose(D3DXMATRIX *pout, CONST D3DXMATRIX *pm);
D3DXQUATERNION* WINAPI D3DXQuaternionNormalize(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq);