d3drm: Implement IDirect3DRMMesh_GetGroup.

This commit is contained in:
Christian Costa 2012-05-22 08:57:21 +02:00 committed by Alexandre Julliard
parent 42eb57dfa7
commit f0d3f207ab
2 changed files with 28 additions and 4 deletions

View File

@ -2514,14 +2514,28 @@ static DWORD WINAPI IDirect3DRMMeshImpl_GetGroupCount(IDirect3DRMMesh* iface)
} }
static HRESULT WINAPI IDirect3DRMMeshImpl_GetGroup(IDirect3DRMMesh* iface, static HRESULT WINAPI IDirect3DRMMeshImpl_GetGroup(IDirect3DRMMesh* iface,
D3DRMGROUPINDEX id, unsigned *vCount, unsigned *fCount, unsigned *vPerFace, D3DRMGROUPINDEX id, unsigned *vertex_count, unsigned *face_count, unsigned *vertex_per_face,
DWORD *fDataSize, unsigned *fData) DWORD *face_data_size, unsigned *face_data)
{ {
IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface); IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
FIXME("(%p)->(%u,%p,%p,%p,%p,%p): stub\n", This, id, vCount, fCount, vPerFace, fDataSize, fData); TRACE("(%p)->(%u,%p,%p,%p,%p,%p)\n", This, id, vertex_count, face_count, vertex_per_face, face_data_size, face_data);
return E_NOTIMPL; if (id >= This->nb_groups)
return D3DRMERR_BADVALUE;
if (vertex_count)
*vertex_count = This->groups[id].nb_vertices;
if (face_count)
*face_count = This->groups[id].nb_faces;
if (vertex_per_face)
*vertex_per_face = This->groups[id].vertex_per_face;
if (face_data_size)
*face_data_size = This->groups[id].face_data_size;
if (face_data)
memcpy(face_data, This->groups[id].face_data, This->groups[id].face_data_size);
return D3DRM_OK;
} }
static HRESULT WINAPI IDirect3DRMMeshImpl_GetVertices(IDirect3DRMMesh* iface, static HRESULT WINAPI IDirect3DRMMeshImpl_GetVertices(IDirect3DRMMesh* iface,

View File

@ -344,9 +344,19 @@ static void test_MeshBuilder(void)
if (hr == D3DRM_OK) if (hr == D3DRM_OK)
{ {
DWORD nb_groups; DWORD nb_groups;
unsigned nb_vertices, nb_faces, nb_face_vertices;
DWORD data_size;
nb_groups = IDirect3DRMMesh_GetGroupCount(mesh); nb_groups = IDirect3DRMMesh_GetGroupCount(mesh);
ok(nb_groups == 1, "GetCroupCount returned %u\n", nb_groups); ok(nb_groups == 1, "GetCroupCount returned %u\n", nb_groups);
hr = IDirect3DRMMesh_GetGroup(mesh, 1, &nb_vertices, &nb_faces, &nb_face_vertices, &data_size, NULL);
ok(hr == D3DRMERR_BADVALUE, "GetCroup returned hr = %x\n", hr);
hr = IDirect3DRMMesh_GetGroup(mesh, 0, &nb_vertices, &nb_faces, &nb_face_vertices, &data_size, NULL);
ok(hr == D3DRM_OK, "GetCroup failed returning hr = %x\n", hr);
ok(nb_vertices == 3, "Wrong number of vertices %u (must be 3)\n", nb_vertices);
ok(nb_faces == 1, "Wrong number of faces %u (must be 1)\n", nb_faces);
todo_wine ok(nb_face_vertices == 3, "Wrong number of vertices per face %u (must be 3)\n", nb_face_vertices);
todo_wine ok(data_size == 3, "Wrong number of face data bytes %u (must be 3)\n", data_size);
IDirect3DRMMesh_Release(mesh); IDirect3DRMMesh_Release(mesh);
} }