Module: wine Branch: master Commit: ccbcf8f2919f5d85955f70b48e5b4d1d2b4b34a2 URL: http://source.winehq.org/git/wine.git/?a=commit;h=ccbcf8f2919f5d85955f70b48e...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Thu Nov 19 11:41:24 2009 +0100
d3d10core: Add a separate function for device initialization.
---
dlls/d3d10core/d3d10core_main.c | 8 +------- dlls/d3d10core/d3d10core_private.h | 5 ++--- dlls/d3d10core/device.c | 15 ++++++++++++--- 3 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/dlls/d3d10core/d3d10core_main.c b/dlls/d3d10core/d3d10core_main.c index 273f15d..4151dd0 100644 --- a/dlls/d3d10core/d3d10core_main.c +++ b/dlls/d3d10core/d3d10core_main.c @@ -81,13 +81,7 @@ static HRESULT WINAPI layer_create(enum dxgi_device_layer_id id, void **layer_ba }
object = *layer_base; - - object->vtbl = &d3d10_device_vtbl; - object->inner_unknown_vtbl = &d3d10_device_inner_unknown_vtbl; - object->device_parent_vtbl = &d3d10_wined3d_device_parent_vtbl; - object->refcount = 1; - - object->outer_unknown = device_object; + d3d10_device_init(object, device_object); *device_layer = &object->inner_unknown_vtbl;
TRACE("Created d3d10 device at %p\n", object); diff --git a/dlls/d3d10core/d3d10core_private.h b/dlls/d3d10core/d3d10core_private.h index f4535ce..35d5ed3 100644 --- a/dlls/d3d10core/d3d10core_private.h +++ b/dlls/d3d10core/d3d10core_private.h @@ -67,9 +67,6 @@ HRESULT parse_dxbc(const char *data, SIZE_T data_size, HRESULT (*chunk_handler)(const char *data, DWORD data_size, DWORD tag, void *ctx), void *ctx) DECLSPEC_HIDDEN;
/* IDirect3D10Device */ -extern const struct ID3D10DeviceVtbl d3d10_device_vtbl DECLSPEC_HIDDEN; -extern const struct IUnknownVtbl d3d10_device_inner_unknown_vtbl DECLSPEC_HIDDEN; -extern const struct IWineD3DDeviceParentVtbl d3d10_wined3d_device_parent_vtbl DECLSPEC_HIDDEN; struct d3d10_device { const struct ID3D10DeviceVtbl *vtbl; @@ -81,6 +78,8 @@ struct d3d10_device IWineD3DDevice *wined3d_device; };
+void d3d10_device_init(struct d3d10_device *device, void *outer_unknown) DECLSPEC_HIDDEN; + /* ID3D10Texture2D */ struct d3d10_texture2d { diff --git a/dlls/d3d10core/device.c b/dlls/d3d10core/device.c index b3da2ed..4898a09 100644 --- a/dlls/d3d10core/device.c +++ b/dlls/d3d10core/device.c @@ -1117,7 +1117,7 @@ static void STDMETHODCALLTYPE d3d10_device_GetTextFilterSize(ID3D10Device *iface FIXME("iface %p, width %p, height %p stub!\n", iface, width, height); }
-const struct ID3D10DeviceVtbl d3d10_device_vtbl = +static const struct ID3D10DeviceVtbl d3d10_device_vtbl = { /* IUnknown methods */ d3d10_device_QueryInterface, @@ -1221,7 +1221,7 @@ const struct ID3D10DeviceVtbl d3d10_device_vtbl = d3d10_device_GetTextFilterSize, };
-const struct IUnknownVtbl d3d10_device_inner_unknown_vtbl = +static const struct IUnknownVtbl d3d10_device_inner_unknown_vtbl = { /* IUnknown methods */ d3d10_device_inner_QueryInterface, @@ -1425,7 +1425,7 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateSwapChain(IWineD3DDevicePar return S_OK; }
-const struct IWineD3DDeviceParentVtbl d3d10_wined3d_device_parent_vtbl = +static const struct IWineD3DDeviceParentVtbl d3d10_wined3d_device_parent_vtbl = { /* IUnknown methods */ device_parent_QueryInterface, @@ -1439,3 +1439,12 @@ const struct IWineD3DDeviceParentVtbl d3d10_wined3d_device_parent_vtbl = device_parent_CreateVolume, device_parent_CreateSwapChain, }; + +void d3d10_device_init(struct d3d10_device *device, void *outer_unknown) +{ + device->vtbl = &d3d10_device_vtbl; + device->inner_unknown_vtbl = &d3d10_device_inner_unknown_vtbl; + device->device_parent_vtbl = &d3d10_wined3d_device_parent_vtbl; + device->refcount = 1; + device->outer_unknown = outer_unknown; +}