patch [5/15]: Implements D3DRMVectorDotProduct [try 2]
David.Adam at math.cnrs.fr
David.Adam at math.cnrs.fr
Thu Apr 19 14:07:54 CDT 2007
-------------- next part --------------
>From 88c2d86952c4913ed1ac1c1600b7036e98063486 Mon Sep 17 00:00:00 2001
From: Adam <David.Adam at math.cnrs.fr>
Date: Fri, 20 Apr 2007 01:53:31 +0200
Subject: [PATCH] Implements D3DRMVectorDotProduct with test.
---
dlls/d3drm/d3drm.spec | 2 +-
dlls/d3drm/math.c | 8 ++++++++
dlls/d3drm/tests/vector.c | 5 +++++
3 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/dlls/d3drm/d3drm.spec b/dlls/d3drm/d3drm.spec
index 4347160..b0a190f 100644
--- a/dlls/d3drm/d3drm.spec
+++ b/dlls/d3drm/d3drm.spec
@@ -10,7 +10,7 @@
@ stub D3DRMQuaternionSlerp
@ stdcall D3DRMVectorAdd(ptr ptr ptr)
@ stdcall D3DRMVectorCrossProduct(ptr ptr ptr)
-@ stub D3DRMVectorDotProduct
+@ stdcall D3DRMVectorDotProduct(ptr)
@ stub D3DRMVectorModulus
@ stub D3DRMVectorNormalize
@ stub D3DRMVectorRandom
diff --git a/dlls/d3drm/math.c b/dlls/d3drm/math.c
index c55abe7..2f452f4 100644
--- a/dlls/d3drm/math.c
+++ b/dlls/d3drm/math.c
@@ -57,3 +57,11 @@ LPD3DVECTOR WINAPI D3DRMVectorCrossProdu
d->z=s1->x * s2->y - s1->y * s2->x;
return d;
}
+
+/* Dot Product of Two vectors */
+D3DVALUE WINAPI D3DRMVectorDotProduct(LPD3DVECTOR s1, LPD3DVECTOR s2)
+{
+ D3DVALUE dot_product;
+ dot_product=s1->x * s2->x + s1->y * s2->y + s1->z * s2->z;
+ return dot_product;
+}
diff --git a/dlls/d3drm/tests/vector.c b/dlls/d3drm/tests/vector.c
index de19ad3..f7b35bf 100644
--- a/dlls/d3drm/tests/vector.c
+++ b/dlls/d3drm/tests/vector.c
@@ -32,6 +32,7 @@ #define expect_vec(expectedvec,gotvec) \
void VectorTest(void)
{
+ D3DVALUE mod;
D3DVECTOR e,r,u,v;
u.x=2.0;u.y=2.0;u.z=1.0;
@@ -51,6 +52,10 @@ void VectorTest(void)
D3DRMVectorCrossProduct(&r,&u,&v);
e.x=-4.0;e.y=4.0;e.z=0.0;
expect_vec(e,r);
+
+/*_______________________VectorDotProduct__________________________*/
+ mod=D3DRMVectorDotProduct(&u,&v);
+ ok((mod == 16.0), "Expected 16.0, Got %f",mod);
}
START_TEST(vector)
--
1.4.2
More information about the wine-patches
mailing list