Commit 759fd517 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

ddraw: Add a separate function for parent initialization.

parent 921bd1bf
......@@ -4701,8 +4701,8 @@ static HRESULT WINAPI d3d7_CreateDevice(IDirect3D7 *iface, REFCLSID riid,
LeaveCriticalSection(&ddraw_cs);
return DDERR_OUTOFMEMORY;
}
index_buffer_parent->lpVtbl = &IParent_Vtbl;
index_buffer_parent->ref = 1;
ddraw_parent_init(index_buffer_parent);
/* Create an Index Buffer. WineD3D needs one for Drawing indexed primitives
* Create a (hopefully) long enough buffer, and copy the indices into it
......@@ -5928,8 +5928,7 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateSwapChain(IWineD3DDevicePar
return DDERR_OUTOFVIDEOMEMORY;
}
object->lpVtbl = &IParent_Vtbl;
object->ref = 1;
ddraw_parent_init(object);
hr = IWineD3DDevice_CreateSwapChain(This->wineD3DDevice, present_parameters,
swapchain, (IUnknown *)object, This->ImplType);
......
......@@ -315,7 +315,7 @@ struct IParentImpl
};
extern const IParentVtbl IParent_Vtbl DECLSPEC_HIDDEN;
void ddraw_parent_init(IParentImpl *parent) DECLSPEC_HIDDEN;
/*****************************************************************************
* IDirect3DDevice implementation
......
......@@ -121,9 +121,15 @@ static ULONG WINAPI IParentImpl_Release(IParent *iface)
/*****************************************************************************
* The VTable
*****************************************************************************/
const IParentVtbl IParent_Vtbl =
static const struct IParentVtbl ddraw_parent_vtbl =
{
IParentImpl_QueryInterface,
IParentImpl_AddRef,
IParentImpl_Release,
};
void ddraw_parent_init(IParentImpl *parent)
{
parent->lpVtbl = &ddraw_parent_vtbl;
parent->ref = 1;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment