Module: wine Branch: master Commit: f0d3f207aba7a84d57235219d71b7048aed1c38b URL: http://source.winehq.org/git/wine.git/?a=commit;h=f0d3f207aba7a84d57235219d7...
Author: Christian Costa titan.costa@gmail.com Date: Tue May 22 08:57:21 2012 +0200
d3drm: Implement IDirect3DRMMesh_GetGroup.
---
dlls/d3drm/meshbuilder.c | 22 ++++++++++++++++++---- dlls/d3drm/tests/d3drm.c | 10 ++++++++++ 2 files changed, 28 insertions(+), 4 deletions(-)
diff --git a/dlls/d3drm/meshbuilder.c b/dlls/d3drm/meshbuilder.c index 4333516..77b68e4 100644 --- a/dlls/d3drm/meshbuilder.c +++ b/dlls/d3drm/meshbuilder.c @@ -2514,14 +2514,28 @@ static DWORD WINAPI IDirect3DRMMeshImpl_GetGroupCount(IDirect3DRMMesh* iface) }
static HRESULT WINAPI IDirect3DRMMeshImpl_GetGroup(IDirect3DRMMesh* iface, - D3DRMGROUPINDEX id, unsigned *vCount, unsigned *fCount, unsigned *vPerFace, - DWORD *fDataSize, unsigned *fData) + D3DRMGROUPINDEX id, unsigned *vertex_count, unsigned *face_count, unsigned *vertex_per_face, + DWORD *face_data_size, unsigned *face_data) { 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, diff --git a/dlls/d3drm/tests/d3drm.c b/dlls/d3drm/tests/d3drm.c index ffe571a..4f7eed6 100644 --- a/dlls/d3drm/tests/d3drm.c +++ b/dlls/d3drm/tests/d3drm.c @@ -344,9 +344,19 @@ static void test_MeshBuilder(void) if (hr == D3DRM_OK) { DWORD nb_groups; + unsigned nb_vertices, nb_faces, nb_face_vertices; + DWORD data_size;
nb_groups = IDirect3DRMMesh_GetGroupCount(mesh); 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); }