From a442fcc9c62ec07d9bcb408483454016061dd129 Mon Sep 17 00:00:00 2001 From: Christian Costa Date: Tue, 22 May 2012 22:05:32 +0200 Subject: [PATCH] d3drm: Implement IDirect3DRMXImpl_CreateMaterial. --- dlls/d3drm/d3drm.c | 28 +++++++++++++++++----------- dlls/d3drm/d3drm_private.h | 1 + 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/dlls/d3drm/d3drm.c b/dlls/d3drm/d3drm.c index 292be714740..be7ba7f58af 100644 --- a/dlls/d3drm/d3drm.c +++ b/dlls/d3drm/d3drm.c @@ -221,13 +221,13 @@ static HRESULT WINAPI IDirect3DRMImpl_CreateLightRGB(IDirect3DRM* iface, D3DRMLI return IDirect3DRM3_CreateLightRGB(&This->IDirect3DRM3_iface, type, red, green, blue, Light); } -static HRESULT WINAPI IDirect3DRMImpl_CreateMaterial(IDirect3DRM* iface, D3DVALUE m, LPDIRECT3DRMMATERIAL * ppMaterial) +static HRESULT WINAPI IDirect3DRMImpl_CreateMaterial(IDirect3DRM* iface, D3DVALUE power, LPDIRECT3DRMMATERIAL * material) { IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface); - FIXME("(%p/%p)->(%f,%p): stub\n", iface, This, m, ppMaterial); + TRACE("(%p/%p)->(%f,%p)\n", iface, This, power, material); - return E_NOTIMPL; + return IDirect3DRM3_CreateMaterial(&This->IDirect3DRM3_iface, power, (LPDIRECT3DRMMATERIAL2*)material); } static HRESULT WINAPI IDirect3DRMImpl_CreateDevice(IDirect3DRM* iface, DWORD width, DWORD height, LPDIRECT3DRMDEVICE * ppDevice) @@ -593,14 +593,14 @@ static HRESULT WINAPI IDirect3DRM2Impl_CreateLightRGB(IDirect3DRM2* iface, D3DRM return IDirect3DRM3_CreateLightRGB(&This->IDirect3DRM3_iface, type, red, green, blue, Light); } -static HRESULT WINAPI IDirect3DRM2Impl_CreateMaterial(IDirect3DRM2* iface, D3DVALUE m, - LPDIRECT3DRMMATERIAL * ppMaterial) +static HRESULT WINAPI IDirect3DRM2Impl_CreateMaterial(IDirect3DRM2* iface, D3DVALUE power, + LPDIRECT3DRMMATERIAL * material) { IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface); - FIXME("(%p/%p)->(%f,%p): stub\n", iface, This, m, ppMaterial); + TRACE("(%p/%p)->(%f,%p)\n", iface, This, power, material); - return E_NOTIMPL; + return IDirect3DRM3_CreateMaterial(&This->IDirect3DRM3_iface, power, (LPDIRECT3DRMMATERIAL2*)material); } static HRESULT WINAPI IDirect3DRM2Impl_CreateDevice(IDirect3DRM2* iface, DWORD width, DWORD height, @@ -1036,14 +1036,20 @@ static HRESULT WINAPI IDirect3DRM3Impl_CreateLightRGB(IDirect3DRM3* iface, D3DRM return ret; } -static HRESULT WINAPI IDirect3DRM3Impl_CreateMaterial(IDirect3DRM3* iface, D3DVALUE m, - LPDIRECT3DRMMATERIAL2* Material) +static HRESULT WINAPI IDirect3DRM3Impl_CreateMaterial(IDirect3DRM3* iface, D3DVALUE power, + LPDIRECT3DRMMATERIAL2* material) { IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface); + HRESULT ret; - FIXME("(%p/%p)->(%f,%p): stub\n", iface, This, m, Material); + TRACE("(%p/%p)->(%f,%p)\n", iface, This, power, material); - return E_NOTIMPL; + ret = Direct3DRMMaterial_create(material); + + if (SUCCEEDED(ret)) + IDirect3DRMMaterial2_SetPower(*material, power); + + return ret; } static HRESULT WINAPI IDirect3DRM3Impl_CreateDevice(IDirect3DRM3* iface, DWORD width, DWORD height, diff --git a/dlls/d3drm/d3drm_private.h b/dlls/d3drm/d3drm_private.h index aabb878d998..ae561246e32 100644 --- a/dlls/d3drm/d3drm_private.h +++ b/dlls/d3drm/d3drm_private.h @@ -30,6 +30,7 @@ HRESULT Direct3DRMFrame_create(REFIID riid, IUnknown* parent_frame, IUnknown** r HRESULT Direct3DRMLight_create(IUnknown** ppObj) DECLSPEC_HIDDEN; HRESULT Direct3DRMMeshBuilder_create(REFIID riid, IUnknown** ppObj) DECLSPEC_HIDDEN; HRESULT Direct3DRMViewport_create(REFIID riid, IUnknown** ppObj) DECLSPEC_HIDDEN; +HRESULT Direct3DRMMaterial_create(IDirect3DRMMaterial2** ret_iface) DECLSPEC_HIDDEN; HRESULT load_mesh_data(IDirect3DRMMeshBuilder3* iface, LPDIRECTXFILEDATA pData) DECLSPEC_HIDDEN;