d3drm: Implement IDirect3DRMMeshImpl_GetGroupMaterial.

This commit is contained in:
Christian Costa 2012-05-27 17:44:51 +02:00 committed by Alexandre Julliard
parent b340501a93
commit 3fbe4914bd
2 changed files with 19 additions and 6 deletions

View File

@ -43,6 +43,7 @@ typedef struct {
unsigned vertex_per_face;
DWORD face_data_size;
unsigned* face_data;
IDirect3DRMMaterial2* material;
IDirect3DRMTexture3* texture;
} mesh_group;
@ -2452,6 +2453,7 @@ static HRESULT WINAPI IDirect3DRMMeshImpl_AddGroup(IDirect3DRMMesh* iface,
memcpy(group->face_data, face_data, group->face_data_size * sizeof(unsigned));
group->material = NULL;
group->texture = NULL;
*return_id = This->nb_groups++;
@ -2623,13 +2625,24 @@ static D3DRMRENDERQUALITY WINAPI IDirect3DRMMeshImpl_GetGroupQuality(IDirect3DRM
}
static HRESULT WINAPI IDirect3DRMMeshImpl_GetGroupMaterial(IDirect3DRMMesh* iface,
D3DRMGROUPINDEX id, LPDIRECT3DRMMATERIAL *returnPtr)
D3DRMGROUPINDEX id, LPDIRECT3DRMMATERIAL *material)
{
IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
FIXME("(%p)->(%u,%p): stub\n", This, id, returnPtr);
TRACE("(%p)->(%u,%p)\n", This, id, material);
return E_NOTIMPL;
if (id >= This->nb_groups)
return D3DRMERR_BADVALUE;
if (!material)
return E_POINTER;
if (This->groups[id].material)
IDirect3DRMTexture_QueryInterface(This->groups[id].material, &IID_IDirect3DRMMaterial, (void**)material);
else
*material = NULL;
return D3DRM_OK;
}
static HRESULT WINAPI IDirect3DRMMeshImpl_GetGroupTexture(IDirect3DRMMesh* iface,

View File

@ -353,7 +353,7 @@ static void test_MeshBuilder(void)
DWORD nb_groups;
unsigned nb_vertices, nb_faces, nb_face_vertices;
DWORD data_size;
LPDIRECT3DRMMATERIAL material;
LPDIRECT3DRMMATERIAL material = (LPDIRECT3DRMMATERIAL)0xdeadbeef;
LPDIRECT3DRMTEXTURE texture = (LPDIRECT3DRMTEXTURE)0xdeadbeef;
D3DVALUE values[3];
@ -371,8 +371,8 @@ static void test_MeshBuilder(void)
ok(hr == D3DRM_OK, "GetCroupTexture failed returning hr = %x\n", hr);
ok(texture == NULL, "No texture should be present\n");
hr = IDirect3DRMMesh_GetGroupMaterial(mesh, 0, &material);
todo_wine ok(hr == D3DRM_OK, "GetCroupMaterial failed returning hr = %x\n", hr);
todo_wine ok(material != NULL, "No material should be present\n");
ok(hr == D3DRM_OK, "GetCroupMaterial failed returning hr = %x\n", hr);
todo_wine ok(material != NULL, "No material present\n");
if ((hr == D3DRM_OK) && material)
{
hr = IDirect3DRMMaterial_GetEmissive(material, &values[0], &values[1], &values[2]);