[PATCH 2/2] d3dx9: Add stub and basic test for D3DXCreateSphere.

Misha Koshelev misha680 at gmail.com
Tue Jun 22 22:56:29 CDT 2010


---
 dlls/d3dx9_36/d3dx9_36.spec |    2 +-
 dlls/d3dx9_36/mesh.c        |    8 ++++++++
 dlls/d3dx9_36/tests/mesh.c  |    9 +++++++++
 include/d3dx9shape.h        |    7 +++++++
 4 files changed, 25 insertions(+), 1 deletions(-)

diff --git a/dlls/d3dx9_36/d3dx9_36.spec b/dlls/d3dx9_36/d3dx9_36.spec
index 19406e7..b9a00da 100644
--- a/dlls/d3dx9_36/d3dx9_36.spec
+++ b/dlls/d3dx9_36/d3dx9_36.spec
@@ -87,7 +87,7 @@
 @ stub D3DXCreateSkinInfo
 @ stub D3DXCreateSkinInfoFromBlendedMesh
 @ stub D3DXCreateSkinInfoFVF
-@ stub D3DXCreateSphere
+@ stdcall D3DXCreateSphere(ptr long long long ptr ptr)
 @ stdcall D3DXCreateSprite(ptr ptr)
 @ stub D3DXCreateTeapot
 @ stub D3DXCreateTextA
diff --git a/dlls/d3dx9_36/mesh.c b/dlls/d3dx9_36/mesh.c
index 9691eed..5611030 100644
--- a/dlls/d3dx9_36/mesh.c
+++ b/dlls/d3dx9_36/mesh.c
@@ -335,3 +335,11 @@ HRESULT WINAPI D3DXCreateBox(LPDIRECT3DDEVICE9 device, FLOAT width, FLOAT height
 
     return E_NOTIMPL;
 }
+
+HRESULT WINAPI D3DXCreateSphere(LPDIRECT3DDEVICE9 device, FLOAT radius, UINT slices,
+                             UINT stacks, LPD3DXMESH* mesh, LPD3DXBUFFER* adjacency)
+{
+    FIXME("(%p, %f, %d, %d, %p, %p): stub\n", device, radius, slices, stacks, mesh, adjacency);
+
+    return E_NOTIMPL;
+}
diff --git a/dlls/d3dx9_36/tests/mesh.c b/dlls/d3dx9_36/tests/mesh.c
index 8e4e26d..0086bb3 100644
--- a/dlls/d3dx9_36/tests/mesh.c
+++ b/dlls/d3dx9_36/tests/mesh.c
@@ -476,6 +476,14 @@ static void D3DXIntersectTriTest(void)
     ok( got_res == exp_res, "Expected result = %d, got %d\n",exp_res,got_res);
 }
 
+static void D3DXCreateSphereTest(void)
+{
+    HRESULT hr;
+
+    hr = D3DXCreateSphere(NULL, 0.0, 0, 0, NULL, NULL);
+    todo_wine ok( hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n",hr,D3DERR_INVALIDCALL);       
+}
+
 static void test_get_decl_vertex_size(void)
 {
     static const D3DVERTEXELEMENT9 declaration1[] =
@@ -556,5 +564,6 @@ START_TEST(mesh)
     D3DXDeclaratorFromFVFTest();
     D3DXGetFVFVertexSizeTest();
     D3DXIntersectTriTest();
+    D3DXCreateSphereTest();
     test_get_decl_vertex_size();
 }
diff --git a/include/d3dx9shape.h b/include/d3dx9shape.h
index e1bf231..36bca6b 100644
--- a/include/d3dx9shape.h
+++ b/include/d3dx9shape.h
@@ -32,6 +32,13 @@ HRESULT WINAPI D3DXCreateBox(LPDIRECT3DDEVICE9 device,
                              LPD3DXMESH* mesh,
                              LPD3DXBUFFER* adjacency);
 
+HRESULT WINAPI D3DXCreateSphere(LPDIRECT3DDEVICE9 device,
+                                FLOAT radius,
+                                UINT slices,
+                                UINT stacks,
+                                LPD3DXMESH* mesh,
+                                LPD3DXBUFFER* adjacency);
+
 #ifdef __cplusplus
 }
 #endif
-- 
1.7.1






More information about the wine-patches mailing list