d3drm: Implement D3DVectorSubtract.

This commit is contained in:
David Adam 2007-04-19 21:05:56 +02:00 committed by Alexandre Julliard
parent f50800b25d
commit 70a1cef5e4
3 changed files with 15 additions and 1 deletions

View File

@ -17,7 +17,7 @@
@ stub D3DRMVectorReflect @ stub D3DRMVectorReflect
@ stub D3DRMVectorRotate @ stub D3DRMVectorRotate
@ stub D3DRMVectorScale @ stub D3DRMVectorScale
@ stub D3DRMVectorSubtract @ stdcall D3DRMVectorSubtract(ptr ptr ptr)
@ stub Direct3DRMCreate @ stub Direct3DRMCreate
@ stub DllCanUnloadNow @ stub DllCanUnloadNow
@ stub DllGetClassObject @ stub DllGetClassObject

View File

@ -40,3 +40,12 @@ LPD3DVECTOR WINAPI D3DRMVectorAdd(LPD3DVECTOR d, LPD3DVECTOR s1, LPD3DVECTOR s2)
d->z=s1->z + s2->z; d->z=s1->z + s2->z;
return d; return d;
} }
/* Subtract Two Vectors */
LPD3DVECTOR WINAPI D3DRMVectorSubtract(LPD3DVECTOR d, LPD3DVECTOR s1, LPD3DVECTOR s2)
{
d->x=s1->x - s2->x;
d->y=s1->y - s2->y;
d->z=s1->z - s2->z;
return d;
}

View File

@ -41,6 +41,11 @@ void VectorTest(void)
D3DRMVectorAdd(&r,&u,&v); D3DRMVectorAdd(&r,&u,&v);
e.x=6.0;e.y=6.0;e.z=1.0; e.x=6.0;e.y=6.0;e.z=1.0;
expect_vec(e,r); expect_vec(e,r);
/*_______________________VectorSubtract__________________________*/
D3DRMVectorSubtract(&r,&u,&v);
e.x=-2.0;e.y=-2.0;e.z=1.0;
expect_vec(e,r);
} }
START_TEST(vector) START_TEST(vector)