d3drm: Enum all materials even if only the first one is handled.

This commit is contained in:
Christian Costa 2012-10-21 14:51:32 +02:00 committed by Alexandre Julliard
parent 5e1d854ee5
commit 466c244d18
1 changed files with 8 additions and 3 deletions

View File

@ -1244,10 +1244,7 @@ HRESULT load_mesh_data(IDirect3DRMMeshBuilder3* iface, LPDIRECTXFILEDATA pData)
WARN("Returned size %u does not match expected one %u\n", size, data_size);
if (nb_materials > 1)
{
FIXME("Only one material per mesh supported, first one applies to all faces\n");
nb_materials = 1;
}
while (SUCCEEDED(hr = IDirectXFileData_GetNextObject(pData2, &child)) && (i < nb_materials))
{
@ -1256,6 +1253,14 @@ HRESULT load_mesh_data(IDirect3DRMMeshBuilder3* iface, LPDIRECTXFILEDATA pData)
LPDIRECT3DRMMATERIAL2 material;
LPDIRECTXFILEOBJECT material_child;
if (i >= 1)
{
/* FIXME: Only handle first material but enum all of them */
IDirectXFileObject_Release(child);
i++;
continue;
}
hr = IDirectXFileObject_QueryInterface(child, &IID_IDirectXFileData, (void **)&data);
if (FAILED(hr))
{