d3drm: Implement IDirect3DRMMesh_GetGroupTexture.
This commit is contained in:
parent
6e15d91927
commit
b340501a93
|
@ -43,6 +43,7 @@ typedef struct {
|
||||||
unsigned vertex_per_face;
|
unsigned vertex_per_face;
|
||||||
DWORD face_data_size;
|
DWORD face_data_size;
|
||||||
unsigned* face_data;
|
unsigned* face_data;
|
||||||
|
IDirect3DRMTexture3* texture;
|
||||||
} mesh_group;
|
} mesh_group;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -2451,6 +2452,8 @@ static HRESULT WINAPI IDirect3DRMMeshImpl_AddGroup(IDirect3DRMMesh* iface,
|
||||||
|
|
||||||
memcpy(group->face_data, face_data, group->face_data_size * sizeof(unsigned));
|
memcpy(group->face_data, face_data, group->face_data_size * sizeof(unsigned));
|
||||||
|
|
||||||
|
group->texture = NULL;
|
||||||
|
|
||||||
*return_id = This->nb_groups++;
|
*return_id = This->nb_groups++;
|
||||||
|
|
||||||
return D3DRM_OK;
|
return D3DRM_OK;
|
||||||
|
@ -2630,13 +2633,24 @@ static HRESULT WINAPI IDirect3DRMMeshImpl_GetGroupMaterial(IDirect3DRMMesh* ifac
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI IDirect3DRMMeshImpl_GetGroupTexture(IDirect3DRMMesh* iface,
|
static HRESULT WINAPI IDirect3DRMMeshImpl_GetGroupTexture(IDirect3DRMMesh* iface,
|
||||||
D3DRMGROUPINDEX id, LPDIRECT3DRMTEXTURE *returnPtr)
|
D3DRMGROUPINDEX id, LPDIRECT3DRMTEXTURE *texture)
|
||||||
{
|
{
|
||||||
IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
|
IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
|
||||||
|
|
||||||
FIXME("(%p)->(%u,%p): stub\n", This, id, returnPtr);
|
TRACE("(%p)->(%u,%p)\n", This, id, texture);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
if (id >= This->nb_groups)
|
||||||
|
return D3DRMERR_BADVALUE;
|
||||||
|
|
||||||
|
if (!texture)
|
||||||
|
return E_POINTER;
|
||||||
|
|
||||||
|
if (This->groups[id].texture)
|
||||||
|
IDirect3DRMTexture_QueryInterface(This->groups[id].texture, &IID_IDirect3DRMTexture, (void**)texture);
|
||||||
|
else
|
||||||
|
*texture = NULL;
|
||||||
|
|
||||||
|
return D3DRM_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct IDirect3DRMMeshVtbl Direct3DRMMesh_Vtbl =
|
static const struct IDirect3DRMMeshVtbl Direct3DRMMesh_Vtbl =
|
||||||
|
|
|
@ -354,7 +354,7 @@ static void test_MeshBuilder(void)
|
||||||
unsigned nb_vertices, nb_faces, nb_face_vertices;
|
unsigned nb_vertices, nb_faces, nb_face_vertices;
|
||||||
DWORD data_size;
|
DWORD data_size;
|
||||||
LPDIRECT3DRMMATERIAL material;
|
LPDIRECT3DRMMATERIAL material;
|
||||||
LPDIRECT3DRMTEXTURE texture;
|
LPDIRECT3DRMTEXTURE texture = (LPDIRECT3DRMTEXTURE)0xdeadbeef;
|
||||||
D3DVALUE values[3];
|
D3DVALUE values[3];
|
||||||
|
|
||||||
nb_groups = IDirect3DRMMesh_GetGroupCount(mesh);
|
nb_groups = IDirect3DRMMesh_GetGroupCount(mesh);
|
||||||
|
@ -368,8 +368,8 @@ static void test_MeshBuilder(void)
|
||||||
todo_wine ok(nb_face_vertices == 3, "Wrong number of vertices per face %u (must be 3)\n", nb_face_vertices);
|
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);
|
todo_wine ok(data_size == 3, "Wrong number of face data bytes %u (must be 3)\n", data_size);
|
||||||
hr = IDirect3DRMMesh_GetGroupTexture(mesh, 0, &texture);
|
hr = IDirect3DRMMesh_GetGroupTexture(mesh, 0, &texture);
|
||||||
todo_wine ok(hr == D3DRM_OK, "GetCroupTexture failed returning hr = %x\n", hr);
|
ok(hr == D3DRM_OK, "GetCroupTexture failed returning hr = %x\n", hr);
|
||||||
todo_wine ok(texture == NULL, "No texture should be present\n");
|
ok(texture == NULL, "No texture should be present\n");
|
||||||
hr = IDirect3DRMMesh_GetGroupMaterial(mesh, 0, &material);
|
hr = IDirect3DRMMesh_GetGroupMaterial(mesh, 0, &material);
|
||||||
todo_wine ok(hr == D3DRM_OK, "GetCroupMaterial failed returning hr = %x\n", hr);
|
todo_wine ok(hr == D3DRM_OK, "GetCroupMaterial failed returning hr = %x\n", hr);
|
||||||
todo_wine ok(material != NULL, "No material should be present\n");
|
todo_wine ok(material != NULL, "No material should be present\n");
|
||||||
|
|
Loading…
Reference in New Issue