d3drm: Hande parent when creating a new frame.

This commit is contained in:
Christian Costa 2012-05-17 10:10:07 +02:00 committed by Alexandre Julliard
parent 8aba0e2ec3
commit 22856e9c96
3 changed files with 24 additions and 27 deletions

View File

@ -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);
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_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);
TRACE("(%p/%p)->(%p,%p)\n", iface, This, parent_frame, frame);
if (FrameParent)
FIXME("(%p/%p): Parent frame not yet supported\n", iface, This);
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)

View File

@ -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;

View File

@ -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;
}