Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.com
-- v6: d3drm: Pass all D3DRM_LOAD* flags directly through to CreateEnumObject() in IDirect3DRMMeshBuilder3::Load().
From: Alistair Leslie-Hughes leslie_alistair@hotmail.com
Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.com Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/d3drm/meshbuilder.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-)
diff --git a/dlls/d3drm/meshbuilder.c b/dlls/d3drm/meshbuilder.c index 1f783baf1fe..2867ea14ebe 100644 --- a/dlls/d3drm/meshbuilder.c +++ b/dlls/d3drm/meshbuilder.c @@ -1462,8 +1462,10 @@ end: static HRESULT WINAPI d3drm_mesh_builder3_Load(IDirect3DRMMeshBuilder3 *iface, void *filename, void *name, D3DRMLOADOPTIONS loadflags, D3DRMLOADTEXTURE3CALLBACK cb, void *arg) { + static const DWORD supported_flags = D3DRMLOAD_FROMFILE | D3DRMLOAD_FROMRESOURCE + | D3DRMLOAD_FROMMEMORY | D3DRMLOAD_FROMSTREAM | D3DRMLOAD_FROMURL; struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder3(iface); - DXFILELOADOPTIONS load_options; + DXFILELOADOPTIONS load_options = loadflags & supported_flags; IDirectXFile *dxfile = NULL; IDirectXFileEnumObject *enum_object = NULL; IDirectXFileData *data = NULL; @@ -1476,22 +1478,10 @@ static HRESULT WINAPI d3drm_mesh_builder3_Load(IDirect3DRMMeshBuilder3 *iface, v TRACE("iface %p, filename %p, name %p, loadflags %#lx, cb %p, arg %p.\n", iface, filename, name, loadflags, cb, arg);
- clean_mesh_builder_data(mesh_builder); + if (loadflags & ~supported_flags) + FIXME("Ignoring flags %#lx.\n", loadflags & ~supported_flags);
- if (loadflags == D3DRMLOAD_FROMMEMORY) - { - load_options = DXFILELOAD_FROMMEMORY; - } - else if (loadflags == D3DRMLOAD_FROMFILE) - { - load_options = DXFILELOAD_FROMFILE; - TRACE("Loading from file %s\n", debugstr_a(filename)); - } - else - { - FIXME("Load options %ld not supported yet\n", loadflags); - return E_NOTIMPL; - } + clean_mesh_builder_data(mesh_builder);
hr = DirectXFileCreate(&dxfile); if (hr != DXFILE_OK) @@ -1503,7 +1493,10 @@ static HRESULT WINAPI d3drm_mesh_builder3_Load(IDirect3DRMMeshBuilder3 *iface, v
hr = IDirectXFile_CreateEnumObject(dxfile, filename, load_options, &enum_object); if (hr != DXFILE_OK) + { + WARN("Failed to create object, load flags %#lx.\n", loadflags); goto end; + }
hr = IDirectXFileEnumObject_GetNextDataObject(enum_object, &data); if (hr != DXFILE_OK)
This merge request was approved by Zebediah Figura.
I've pushed a new version which fixes up a few stylistic nitpicks.