d3dx9: Return error if D3DXMESH_VB_SHARE and new declaration.

This commit is contained in:
Michael Mc Donnell 2011-11-09 13:50:38 -05:00 committed by Alexandre Julliard
parent be8dd2e876
commit 8f5543c34e
2 changed files with 7 additions and 4 deletions

View File

@ -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);

View File

@ -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;