From e205a210d262d8a4259a854d822492d814f5d10b Mon Sep 17 00:00:00 2001 From: David Adam Date: Thu, 18 Oct 2007 18:32:17 +0200 Subject: [PATCH] d3dx8: Implement D3DX*Add with a test. --- dlls/d3dx8/tests/math.c | 30 ++++++++++++++++++++++++++++-- include/d3dx8math.inl | 19 +++++++++++++++++++ 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx8/tests/math.c index a22236298ac..631c8eef4a3 100644 --- a/dlls/d3dx8/tests/math.c +++ b/dlls/d3dx8/tests/math.c @@ -26,6 +26,10 @@ #define expect_vec(expectedvec,gotvec) ok((fabs(expectedvec.x-gotvec.x)x = pv1->x + pv2->x; + pout->y = pv1->y + pv2->y; + pout->z = pv1->z + pv2->z; + return pout; +} + static inline FLOAT D3DXVec3Dot(CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2) { if ( !pv1 || !pv2 ) return 0.0f; @@ -115,6 +124,16 @@ static inline FLOAT D3DXVec3LengthSq(CONST D3DXVECTOR3 *pv) /*__________________D3DXVECTOR4_______________________*/ +static inline D3DXVECTOR4* D3DXVec4Add(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2) +{ + if ( !pout || !pv1 || !pv2) return NULL; + pout->x = pv1->x + pv2->x; + pout->y = pv1->y + pv2->y; + pout->z = pv1->z + pv2->z; + pout->w = pv1->w + pv2->w; + return pout; +} + static inline FLOAT D3DXVec4Dot(CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2) { if (!pv1 || !pv2 ) return 0.0f;