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

Alexandre Julliard julliard at winehq.org
Mon Oct 22 13:42:45 CDT 2012


Module: wine
Branch: master
Commit: 466c244d1833f6644abae540030ef662a187984d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=466c244d1833f6644abae540030ef662a187984d

Author: Christian Costa <titan.costa at gmail.com>
Date:   Sun Oct 21 14:51:32 2012 +0200

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

---

 dlls/d3drm/meshbuilder.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/dlls/d3drm/meshbuilder.c b/dlls/d3drm/meshbuilder.c
index 180a8a9..22efb00 100644
--- a/dlls/d3drm/meshbuilder.c
+++ b/dlls/d3drm/meshbuilder.c
@@ -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))
                 {




More information about the wine-cvs mailing list