[PATCH 09/10] d3dx9: Implement D3DXCreateBox for the case of incorrect parameters.

Misha Koshelev misha680 at gmail.com
Fri Jul 16 17:21:01 CDT 2010


---
 dlls/d3dx9_36/mesh.c       |    9 ++++++++-
 dlls/d3dx9_36/tests/mesh.c |    8 ++++----
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/dlls/d3dx9_36/mesh.c b/dlls/d3dx9_36/mesh.c
index bfa1c23..53a978a 100644
--- a/dlls/d3dx9_36/mesh.c
+++ b/dlls/d3dx9_36/mesh.c
@@ -331,7 +331,14 @@ BOOL WINAPI D3DXSphereBoundProbe(CONST D3DXVECTOR3 *pcenter, FLOAT radius, CONST
 HRESULT WINAPI D3DXCreateBox(LPDIRECT3DDEVICE9 device, FLOAT width, FLOAT height,
                              FLOAT depth, LPD3DXMESH* mesh, LPD3DXBUFFER* adjacency)
 {
-    FIXME("(%p, %f, %f, %f, %p, %p): stub\n", device, width, height, depth, mesh, adjacency);
+    TRACE("(%p, %f, %f, %f, %p, %p)\n", device, width, height, depth, mesh, adjacency);
+
+    if ( device == NULL || width == 0.0f || height == 0.0f || depth == 0.0f )
+    {
+        return D3DERR_INVALIDCALL;
+    }
+
+    FIXME("Case of correct parameters not implemented.\n");
 
     return E_NOTIMPL;
 }
diff --git a/dlls/d3dx9_36/tests/mesh.c b/dlls/d3dx9_36/tests/mesh.c
index 3a78ff8..45584a9 100644
--- a/dlls/d3dx9_36/tests/mesh.c
+++ b/dlls/d3dx9_36/tests/mesh.c
@@ -514,16 +514,16 @@ static void D3DXCreateBoxTest(void)
     };
 
     hr = D3DXCreateBox(NULL, 0.0f, 0.0f, 0.0f, NULL, NULL);
-    todo_wine ok( hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n",hr,D3DERR_INVALIDCALL);
+    ok( hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n",hr,D3DERR_INVALIDCALL);
 
     hr = D3DXCreateBox(NULL, 1.0f, 0.0f, 0.0f, NULL, NULL);
-    todo_wine ok( hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n",hr,D3DERR_INVALIDCALL);
+    ok( hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n",hr,D3DERR_INVALIDCALL);
 
     hr = D3DXCreateBox(NULL, 0.0f, 1.0f, 0.0f, NULL, NULL);
-    todo_wine ok( hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n",hr,D3DERR_INVALIDCALL);
+    ok( hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n",hr,D3DERR_INVALIDCALL);
 
     hr = D3DXCreateBox(NULL, 0.0f, 0.0f, 1.0f, NULL, NULL);
-    todo_wine ok( hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n",hr,D3DERR_INVALIDCALL);
+    ok( hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n",hr,D3DERR_INVALIDCALL);
 
     wnd = CreateWindow("static", "d3dx9_test", 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
     d3d = Direct3DCreate9(D3D_SDK_VERSION);
-- 
1.7.1







More information about the wine-patches mailing list