d3drm: Implement D3DRMVectorAdd.

This commit is contained in:
David Adam 2007-04-19 21:03:53 +02:00 committed by Alexandre Julliard
parent 0fb6b8e79f
commit f50800b25d
12 changed files with 123 additions and 2 deletions

4
.gitignore vendored
View File

@ -175,6 +175,9 @@ dlls/d3d9/version.res
dlls/d3dim/libd3dim.def dlls/d3dim/libd3dim.def
dlls/d3dim/version.res dlls/d3dim/version.res
dlls/d3drm/libd3drm.def dlls/d3drm/libd3drm.def
dlls/d3drm/tests/*.ok
dlls/d3drm/tests/d3drm_crosstest.exe
dlls/d3drm/tests/testlist.c
dlls/d3drm/version.res dlls/d3drm/version.res
dlls/d3dx8/libd3dx8.def dlls/d3dx8/libd3dx8.def
dlls/d3dxof/libd3dxof.def dlls/d3dxof/libd3dxof.def
@ -819,6 +822,7 @@ programs/winetest/comdlg32_test.exe
programs/winetest/crypt32_test.exe programs/winetest/crypt32_test.exe
programs/winetest/d3d8_test.exe programs/winetest/d3d8_test.exe
programs/winetest/d3d9_test.exe programs/winetest/d3d9_test.exe
programs/winetest/d3drm_test.exe
programs/winetest/ddraw_test.exe programs/winetest/ddraw_test.exe
programs/winetest/dinput_test.exe programs/winetest/dinput_test.exe
programs/winetest/dnsapi_test.exe programs/winetest/dnsapi_test.exe

View File

@ -195,6 +195,7 @@ ALL_MAKEFILES = \
dlls/d3d9/tests/Makefile \ dlls/d3d9/tests/Makefile \
dlls/d3dim/Makefile \ dlls/d3dim/Makefile \
dlls/d3drm/Makefile \ dlls/d3drm/Makefile \
dlls/d3drm/tests/Makefile \
dlls/d3dx8/Makefile \ dlls/d3dx8/Makefile \
dlls/d3dxof/Makefile \ dlls/d3dxof/Makefile \
dlls/dbghelp/Makefile \ dlls/dbghelp/Makefile \
@ -538,6 +539,7 @@ dlls/d3d9/Makefile: dlls/d3d9/Makefile.in dlls/Makedll.rules
dlls/d3d9/tests/Makefile: dlls/d3d9/tests/Makefile.in dlls/Maketest.rules dlls/d3d9/tests/Makefile: dlls/d3d9/tests/Makefile.in dlls/Maketest.rules
dlls/d3dim/Makefile: dlls/d3dim/Makefile.in dlls/Makedll.rules dlls/d3dim/Makefile: dlls/d3dim/Makefile.in dlls/Makedll.rules
dlls/d3drm/Makefile: dlls/d3drm/Makefile.in dlls/Makedll.rules dlls/d3drm/Makefile: dlls/d3drm/Makefile.in dlls/Makedll.rules
dlls/d3drm/tests/Makefile: dlls/d3drm/tests/Makefile.in dlls/Maketest.rules
dlls/d3dx8/Makefile: dlls/d3dx8/Makefile.in dlls/Makedll.rules dlls/d3dx8/Makefile: dlls/d3dx8/Makefile.in dlls/Makedll.rules
dlls/d3dxof/Makefile: dlls/d3dxof/Makefile.in dlls/Makedll.rules dlls/d3dxof/Makefile: dlls/d3dxof/Makefile.in dlls/Makedll.rules
dlls/dbghelp/Makefile: dlls/dbghelp/Makefile.in dlls/Makedll.rules dlls/dbghelp/Makefile: dlls/dbghelp/Makefile.in dlls/Makedll.rules

3
configure vendored
View File

@ -20395,6 +20395,8 @@ ac_config_files="$ac_config_files dlls/d3dim/Makefile"
ac_config_files="$ac_config_files dlls/d3drm/Makefile" ac_config_files="$ac_config_files dlls/d3drm/Makefile"
ac_config_files="$ac_config_files dlls/d3drm/tests/Makefile"
ac_config_files="$ac_config_files dlls/d3dx8/Makefile" ac_config_files="$ac_config_files dlls/d3dx8/Makefile"
ac_config_files="$ac_config_files dlls/d3dxof/Makefile" ac_config_files="$ac_config_files dlls/d3dxof/Makefile"
@ -21580,6 +21582,7 @@ do
"dlls/d3d9/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3d9/tests/Makefile" ;; "dlls/d3d9/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3d9/tests/Makefile" ;;
"dlls/d3dim/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3dim/Makefile" ;; "dlls/d3dim/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3dim/Makefile" ;;
"dlls/d3drm/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3drm/Makefile" ;; "dlls/d3drm/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3drm/Makefile" ;;
"dlls/d3drm/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3drm/tests/Makefile" ;;
"dlls/d3dx8/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3dx8/Makefile" ;; "dlls/d3dx8/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3dx8/Makefile" ;;
"dlls/d3dxof/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3dxof/Makefile" ;; "dlls/d3dxof/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3dxof/Makefile" ;;
"dlls/dbghelp/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dbghelp/Makefile" ;; "dlls/dbghelp/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dbghelp/Makefile" ;;

View File

@ -1522,6 +1522,7 @@ AC_CONFIG_FILES([dlls/d3d9/Makefile])
AC_CONFIG_FILES([dlls/d3d9/tests/Makefile]) AC_CONFIG_FILES([dlls/d3d9/tests/Makefile])
AC_CONFIG_FILES([dlls/d3dim/Makefile]) AC_CONFIG_FILES([dlls/d3dim/Makefile])
AC_CONFIG_FILES([dlls/d3drm/Makefile]) AC_CONFIG_FILES([dlls/d3drm/Makefile])
AC_CONFIG_FILES([dlls/d3drm/tests/Makefile])
AC_CONFIG_FILES([dlls/d3dx8/Makefile]) AC_CONFIG_FILES([dlls/d3dx8/Makefile])
AC_CONFIG_FILES([dlls/d3dxof/Makefile]) AC_CONFIG_FILES([dlls/d3dxof/Makefile])
AC_CONFIG_FILES([dlls/dbghelp/Makefile]) AC_CONFIG_FILES([dlls/dbghelp/Makefile])

View File

@ -234,6 +234,7 @@ TESTSUBDIRS = \
crypt32/tests \ crypt32/tests \
d3d8/tests \ d3d8/tests \
d3d9/tests \ d3d9/tests \
d3drm/tests \
ddraw/tests \ ddraw/tests \
dinput/tests \ dinput/tests \
dnsapi/tests \ dnsapi/tests \

View File

@ -6,7 +6,9 @@ MODULE = d3drm.dll
IMPORTLIB = libd3drm.$(IMPLIBEXT) IMPORTLIB = libd3drm.$(IMPLIBEXT)
IMPORTS = kernel32 IMPORTS = kernel32
C_SRCS = d3drm_main.c C_SRCS = \
d3drm_main.c \
math.c
RC_SRCS = version.rc RC_SRCS = version.rc

View File

@ -8,7 +8,7 @@
@ stub D3DRMQuaternionFromRotation @ stub D3DRMQuaternionFromRotation
@ stub D3DRMQuaternionMultiply @ stub D3DRMQuaternionMultiply
@ stub D3DRMQuaternionSlerp @ stub D3DRMQuaternionSlerp
@ stub D3DRMVectorAdd @ stdcall D3DRMVectorAdd(ptr ptr ptr)
@ stub D3DRMVectorCrossProduct @ stub D3DRMVectorCrossProduct
@ stub D3DRMVectorDotProduct @ stub D3DRMVectorDotProduct
@ stub D3DRMVectorModulus @ stub D3DRMVectorModulus

42
dlls/d3drm/math.c Normal file
View File

@ -0,0 +1,42 @@
/*
* Copyright 2007 David Adam
* Copyright 2007 Vijay Kiran Kamuju
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <assert.h>
#include <math.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "d3drmdef.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(d3drm);
/* Add Two Vectors */
LPD3DVECTOR WINAPI D3DRMVectorAdd(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

@ -0,0 +1,13 @@
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../../..
SRCDIR = @srcdir@
VPATH = @srcdir@
TESTDLL = d3drm.dll
IMPORTS = d3drm kernel32
EXTRALIBS = -ldxguid
CTESTS = vector.c
@MAKE_TEST_RULES@
@DEPENDENCIES@ # everything below this line is overwritten by make depend

49
dlls/d3drm/tests/vector.c Normal file
View File

@ -0,0 +1,49 @@
/*
* Copyright 2007 Vijay Kiran Kamuju
* Copyright 2007 David Adam
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <assert.h>
#include "wine/test.h"
#include "d3drmdef.h"
#include <math.h>
#define PI (4*atan(1.0))
#define admit_error 0.000001
#define expect_vec(expectedvec,gotvec) \
ok( ((fabs(expectedvec.x-gotvec.x)<admit_error)&&(fabs(expectedvec.y-gotvec.y)<admit_error)&&(fabs(expectedvec.z-gotvec.z)<admit_error)), \
"Expected Vector= (%f, %f, %f)\n , Got Vector= (%f, %f, %f)\n", \
expectedvec.x,expectedvec.y,expectedvec.z, gotvec.x, gotvec.y, gotvec.z);
void VectorTest(void)
{
D3DVECTOR e,r,u,v;
u.x=2.0;u.y=2.0;u.z=1.0;
v.x=4.0;v.y=4.0;v.z=0.0;
/*______________________VectorAdd_________________________________*/
D3DRMVectorAdd(&r,&u,&v);
e.x=6.0;e.y=6.0;e.z=1.0;
expect_vec(e,r);
}
START_TEST(vector)
{
VectorTest();
}

View File

@ -33,6 +33,7 @@ TESTBINS = \
crypt32_test.exe \ crypt32_test.exe \
d3d8_test.exe \ d3d8_test.exe \
d3d9_test.exe \ d3d9_test.exe \
d3drm_test.exe \
ddraw_test.exe \ ddraw_test.exe \
dinput_test.exe \ dinput_test.exe \
dnsapi_test.exe \ dnsapi_test.exe \
@ -105,6 +106,8 @@ d3d8_test.exe: $(DLLDIR)/d3d8/tests/d3d8_test.exe$(DLLEXT)
cp $(DLLDIR)/d3d8/tests/d3d8_test.exe$(DLLEXT) $@ && $(STRIP) $@ cp $(DLLDIR)/d3d8/tests/d3d8_test.exe$(DLLEXT) $@ && $(STRIP) $@
d3d9_test.exe: $(DLLDIR)/d3d9/tests/d3d9_test.exe$(DLLEXT) d3d9_test.exe: $(DLLDIR)/d3d9/tests/d3d9_test.exe$(DLLEXT)
cp $(DLLDIR)/d3d9/tests/d3d9_test.exe$(DLLEXT) $@ && $(STRIP) $@ cp $(DLLDIR)/d3d9/tests/d3d9_test.exe$(DLLEXT) $@ && $(STRIP) $@
d3drm_test.exe: $(DLLDIR)/d3drm/tests/d3drm_test.exe$(DLLEXT)
cp $(DLLDIR)/d3drm/tests/d3drm_test.exe$(DLLEXT) $@ && $(STRIP) $@
ddraw_test.exe: $(DLLDIR)/ddraw/tests/ddraw_test.exe$(DLLEXT) ddraw_test.exe: $(DLLDIR)/ddraw/tests/ddraw_test.exe$(DLLEXT)
cp $(DLLDIR)/ddraw/tests/ddraw_test.exe$(DLLEXT) $@ && $(STRIP) $@ cp $(DLLDIR)/ddraw/tests/ddraw_test.exe$(DLLEXT) $@ && $(STRIP) $@
dinput_test.exe: $(DLLDIR)/dinput/tests/dinput_test.exe$(DLLEXT) dinput_test.exe: $(DLLDIR)/dinput/tests/dinput_test.exe$(DLLEXT)

View File

@ -156,6 +156,7 @@ comdlg32_test.exe TESTRES "comdlg32_test.exe"
crypt32_test.exe TESTRES "crypt32_test.exe" crypt32_test.exe TESTRES "crypt32_test.exe"
d3d8_test.exe TESTRES "d3d8_test.exe" d3d8_test.exe TESTRES "d3d8_test.exe"
d3d9_test.exe TESTRES "d3d9_test.exe" d3d9_test.exe TESTRES "d3d9_test.exe"
d3drm_test.exe TESTRES "d3drm_test.exe"
ddraw_test.exe TESTRES "ddraw_test.exe" ddraw_test.exe TESTRES "ddraw_test.exe"
dinput_test.exe TESTRES "dinput_test.exe" dinput_test.exe TESTRES "dinput_test.exe"
dnsapi_test.exe TESTRES "dnsapi_test.exe" dnsapi_test.exe TESTRES "dnsapi_test.exe"