From 22856e9c96758d3f676f1502e6a9472c390ffaab Mon Sep 17 00:00:00 2001 From: Christian Costa Date: Thu, 17 May 2012 10:10:07 +0200 Subject: [PATCH] d3drm: Hande parent when creating a new frame. --- dlls/d3drm/d3drm.c | 33 +++++++++++---------------------- dlls/d3drm/d3drm_private.h | 2 +- dlls/d3drm/frame.c | 16 ++++++++++++---- 3 files changed, 24 insertions(+), 27 deletions(-) diff --git a/dlls/d3drm/d3drm.c b/dlls/d3drm/d3drm.c index a96ff52fdea..8dc9523b2ac 100644 --- a/dlls/d3drm/d3drm.c +++ b/dlls/d3drm/d3drm.c @@ -137,16 +137,13 @@ static HRESULT WINAPI IDirect3DRMImpl_CreateObject(IDirect3DRM* iface, REFCLSID return E_NOTIMPL; } -static HRESULT WINAPI IDirect3DRMImpl_CreateFrame(IDirect3DRM* iface, LPDIRECT3DRMFRAME pFrameParent, LPDIRECT3DRMFRAME * ppFrame) +static HRESULT WINAPI IDirect3DRMImpl_CreateFrame(IDirect3DRM* iface, LPDIRECT3DRMFRAME parent_frame, LPDIRECT3DRMFRAME * frame) { IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface); - TRACE("(%p/%p)->(%p,%p)\n", iface, This, pFrameParent, ppFrame); + TRACE("(%p/%p)->(%p,%p)\n", iface, This, parent_frame, frame); - if (pFrameParent) - FIXME("(%p/%p): Parent frame not yet supported\n", iface, This); - - return Direct3DRMFrame_create(&IID_IDirect3DRMFrame, (IUnknown**)ppFrame); + return Direct3DRMFrame_create(&IID_IDirect3DRMFrame, (IUnknown*)parent_frame, (IUnknown**)frame); } static HRESULT WINAPI IDirect3DRMImpl_CreateMesh(IDirect3DRM* iface, LPDIRECT3DRMMESH * ppMesh) @@ -507,18 +504,14 @@ static HRESULT WINAPI IDirect3DRM2Impl_CreateObject(IDirect3DRM2* iface, REFCLSI return E_NOTIMPL; } -static HRESULT WINAPI IDirect3DRM2Impl_CreateFrame(IDirect3DRM2* iface, - LPDIRECT3DRMFRAME pFrameParent, - LPDIRECT3DRMFRAME2 * ppFrame) +static HRESULT WINAPI IDirect3DRM2Impl_CreateFrame(IDirect3DRM2* iface, LPDIRECT3DRMFRAME parent_frame, + LPDIRECT3DRMFRAME2 * frame) { IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface); - TRACE("(%p/%p)->(%p,%p)\n", iface, This, pFrameParent, ppFrame); - - if (pFrameParent) - FIXME("(%p/%p): Parent frame not yet supported\n", iface, This); + TRACE("(%p/%p)->(%p,%p)\n", iface, This, parent_frame, frame); - return Direct3DRMFrame_create(&IID_IDirect3DRMFrame2, (IUnknown**)ppFrame); + return Direct3DRMFrame_create(&IID_IDirect3DRMFrame2, (IUnknown*)parent_frame, (IUnknown**)frame); } static HRESULT WINAPI IDirect3DRM2Impl_CreateMesh(IDirect3DRM2* iface, LPDIRECT3DRMMESH * ppMesh) @@ -936,18 +929,14 @@ static HRESULT WINAPI IDirect3DRM3Impl_CreateObject(IDirect3DRM3* iface, REFCLSI return E_NOTIMPL; } -static HRESULT WINAPI IDirect3DRM3Impl_CreateFrame(IDirect3DRM3* iface, - LPDIRECT3DRMFRAME3 FrameParent, - LPDIRECT3DRMFRAME3* Frame) +static HRESULT WINAPI IDirect3DRM3Impl_CreateFrame(IDirect3DRM3* iface, LPDIRECT3DRMFRAME3 parent_frame, + LPDIRECT3DRMFRAME3* frame) { IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface); - TRACE("(%p/%p)->(%p,%p)\n", iface, This, FrameParent, Frame); - - if (FrameParent) - FIXME("(%p/%p): Parent frame not yet supported\n", iface, This); + TRACE("(%p/%p)->(%p,%p)\n", iface, This, parent_frame, frame); - return Direct3DRMFrame_create(&IID_IDirect3DRMFrame3, (IUnknown**)Frame); + return Direct3DRMFrame_create(&IID_IDirect3DRMFrame3, (IUnknown*)parent_frame, (IUnknown**)frame); } static HRESULT WINAPI IDirect3DRM3Impl_CreateMesh(IDirect3DRM3* iface, LPDIRECT3DRMMESH* Mesh) diff --git a/dlls/d3drm/d3drm_private.h b/dlls/d3drm/d3drm_private.h index 18d8e0a4786..aabb878d998 100644 --- a/dlls/d3drm/d3drm_private.h +++ b/dlls/d3drm/d3drm_private.h @@ -26,7 +26,7 @@ HRESULT Direct3DRM_create(IUnknown** ppObj) DECLSPEC_HIDDEN; HRESULT Direct3DRMDevice_create(REFIID riid, IUnknown** ppObj) DECLSPEC_HIDDEN; -HRESULT Direct3DRMFrame_create(REFIID riid, IUnknown** ppObj) DECLSPEC_HIDDEN; +HRESULT Direct3DRMFrame_create(REFIID riid, IUnknown* parent_frame, IUnknown** ret_iface) DECLSPEC_HIDDEN; 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; diff --git a/dlls/d3drm/frame.c b/dlls/d3drm/frame.c index e530dcdcedb..574e2f8398a 100644 --- a/dlls/d3drm/frame.c +++ b/dlls/d3drm/frame.c @@ -2274,11 +2274,11 @@ static inline IDirect3DRMFrameImpl *unsafe_impl_from_IDirect3DRMFrame3(IDirect3D return impl_from_IDirect3DRMFrame3(iface); } -HRESULT Direct3DRMFrame_create(REFIID riid, IUnknown** ppObj) +HRESULT Direct3DRMFrame_create(REFIID riid, IUnknown* parent, IUnknown** ret_iface) { IDirect3DRMFrameImpl* object; - TRACE("(%p)\n", ppObj); + TRACE("(%s, %p, %p)\n", wine_dbgstr_guid(riid), parent, ret_iface); object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DRMFrameImpl)); if (!object) @@ -2294,9 +2294,17 @@ HRESULT Direct3DRMFrame_create(REFIID riid, IUnknown** ppObj) memcpy(&object->transform[0][0], &identity[0][0], sizeof(D3DRMMATRIX4D)); if (IsEqualGUID(riid, &IID_IDirect3DRMFrame3)) - *ppObj = (IUnknown*)&object->IDirect3DRMFrame3_iface; + { + if (parent) + IDirect3DRMFrame3_AddChild((IDirect3DRMFrame3*)parent, &object->IDirect3DRMFrame3_iface); + *ret_iface = (IUnknown*)&object->IDirect3DRMFrame3_iface; + } else - *ppObj = (IUnknown*)&object->IDirect3DRMFrame2_iface; + { + if (parent) + IDirect3DRMFrame2_AddChild((IDirect3DRMFrame2*)parent, (IDirect3DRMFrame*)&object->IDirect3DRMFrame2_iface); + *ret_iface = (IUnknown*)&object->IDirect3DRMFrame2_iface; + } return S_OK; } -- 2.11.4.GIT