d3dx9: Implement D3DXVec3ProjectArray.

Philip Nilsson pnilsson at nullref.se
Sun Mar 16 06:48:53 CDT 2008


---
 dlls/d3dx9_36/Makefile.in   |    3 +-
 dlls/d3dx9_36/d3dx9_36.spec |    2 +-
 dlls/d3dx9_36/math.c        |   46 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 49 insertions(+), 2 deletions(-)
 create mode 100644 dlls/d3dx9_36/math.c

diff --git a/dlls/d3dx9_36/Makefile.in b/dlls/d3dx9_36/Makefile.in
index c4cdbb4..2ed85ea 100644
--- a/dlls/d3dx9_36/Makefile.in
+++ b/dlls/d3dx9_36/Makefile.in
@@ -8,7 +8,8 @@ IMPORTS   = d3d9 d3dx8 kernel32
 
 C_SRCS = \
 	d3dx9_36_main.c \
-	font.c
+	font.c \
+	math.c
 
 @MAKE_DLL_RULES@
 
diff --git a/dlls/d3dx9_36/d3dx9_36.spec b/dlls/d3dx9_36/d3dx9_36.spec
index 46c7cd5..d555e9e 100644
--- a/dlls/d3dx9_36/d3dx9_36.spec
+++ b/dlls/d3dx9_36/d3dx9_36.spec
@@ -317,7 +317,7 @@
 @ stdcall D3DXVec3Hermite(ptr ptr ptr ptr ptr long) d3dx8.D3DXVec3Hermite
 @ stdcall D3DXVec3Normalize(ptr ptr) d3dx8.D3DXVec3Normalize
 @ stdcall D3DXVec3Project(ptr ptr ptr ptr ptr ptr) d3dx8.D3DXVec3Project
-@ stub D3DXVec3ProjectArray
+@ stdcall D3DXVec3ProjectArray(ptr long ptr long ptr ptr ptr ptr long) D3DXVec3ProjectArray
 @ stdcall D3DXVec3Transform(ptr ptr ptr) d3dx8.D3DXVec3Transform
 @ stub D3DXVec3TransformArray
 @ stdcall D3DXVec3TransformCoord(ptr ptr ptr) d3dx8.D3DXVec3TransformCoord
diff --git a/dlls/d3dx9_36/math.c b/dlls/d3dx9_36/math.c
new file mode 100644
index 0000000..e7187bd
--- /dev/null
+++ b/dlls/d3dx9_36/math.c
@@ -0,0 +1,46 @@
+/*
+ * Mathematical operations specific to D3DX9.
+ *
+ * Copyright (C) 2008 Philip Nilsson
+ *
+ * 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 "config.h"
+#include "windef.h"
+#include "wingdi.h"
+#include "wine/debug.h"
+#include "d3dx9.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(d3dx);
+
+/*************************************************************************
+ * D3DXVec3ProjectArray
+ *
+ * Projects an array of vectors to the screen.
+ */
+D3DXVECTOR3* WINAPI D3DXVec3ProjectArray(
+    D3DXVECTOR3* out, UINT outstride, CONST D3DXVECTOR3* in, UINT instride,
+    CONST D3DVIEWPORT9* viewport, CONST D3DXMATRIX* projection,
+    CONST D3DXMATRIX* view, CONST D3DXMATRIX* world, UINT elements)
+{
+    unsigned int i;
+    for (i = 0; i < elements; ++i) {
+        D3DXVec3Project(
+            out + (outstride * i), in + (instride * i),
+            viewport, projection, view, world);
+    }
+    return out;
+}
-- 
1.5.3.7




More information about the wine-patches mailing list