Michael Mc Donnell : d3dx9: Return error if D3DXMESH_VB_SHARE and new declaration.

Alexandre Julliard julliard at winehq.org
Tue Nov 15 13:17:33 CST 2011


Module: wine
Branch: master
Commit: 8f5543c34e8b6d2c2480696744cf17fa2e712cb8
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8f5543c34e8b6d2c2480696744cf17fa2e712cb8

Author: Michael Mc Donnell <michael at mcdonnell.dk>
Date:   Wed Nov  9 13:50:38 2011 -0500

d3dx9: Return error if D3DXMESH_VB_SHARE and new declaration.

---

 dlls/d3dx9_36/mesh.c       |    5 ++++-
 dlls/d3dx9_36/tests/mesh.c |    6 +++---
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/dlls/d3dx9_36/mesh.c b/dlls/d3dx9_36/mesh.c
index d1693c4..ec77a37 100644
--- a/dlls/d3dx9_36/mesh.c
+++ b/dlls/d3dx9_36/mesh.c
@@ -707,7 +707,10 @@ static HRESULT WINAPI ID3DXMeshImpl_CloneMesh(ID3DXMesh *iface, DWORD options, C
     same_declaration = declaration_equals(declaration, orig_declaration);
 
     if (options & D3DXMESH_VB_SHARE) {
-        if (!same_declaration) goto error;
+        if (!same_declaration) {
+            hr = D3DERR_INVALIDCALL;
+            goto error;
+        }
         IDirect3DVertexBuffer9_AddRef(This->vertex_buffer);
         /* FIXME: refactor to avoid creating a new vertex buffer */
         IDirect3DVertexBuffer9_Release(cloned_this->vertex_buffer);
diff --git a/dlls/d3dx9_36/tests/mesh.c b/dlls/d3dx9_36/tests/mesh.c
index 838e406..50e0e6b 100644
--- a/dlls/d3dx9_36/tests/mesh.c
+++ b/dlls/d3dx9_36/tests/mesh.c
@@ -9916,9 +9916,9 @@ static void test_clone_mesh(void)
     hr = mesh->lpVtbl->CloneMesh(mesh, tc[2].create_options | D3DXMESH_VB_SHARE,
                                  tc[2].new_declaration, test_context->device,
                                  &mesh_clone);
-    todo_wine ok(hr == D3DERR_INVALIDCALL, "CloneMesh D3DXMESH_VB_SHARE with new"
-                 " declaration. Got %x, expected D3DERR_INVALIDCALL\n",
-                 hr);
+    ok(hr == D3DERR_INVALIDCALL, "CloneMesh D3DXMESH_VB_SHARE with new"
+       " declaration. Got %x, expected D3DERR_INVALIDCALL\n",
+       hr);
     mesh->lpVtbl->Release(mesh);
     mesh = NULL;
     mesh_clone = NULL;




More information about the wine-cvs mailing list