Module: wine Branch: master Commit: c892ed497c7faecfe9060a2e4b146812269701c4 URL: http://source.winehq.org/git/wine.git/?a=commit;h=c892ed497c7faecfe9060a2e4b...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Wed Aug 18 19:26:21 2010 +0200
ddraw: Add a separate function for light initialization.
---
dlls/ddraw/ddraw.c | 4 +--- dlls/ddraw/ddraw_private.h | 4 +--- dlls/ddraw/light.c | 9 ++++++++- 3 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index 55753c4..28af7d0 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -4375,9 +4375,7 @@ static HRESULT WINAPI d3d3_CreateLight(IDirect3D3 *iface, IDirect3DLight **light return DDERR_OUTOFMEMORY; }
- object->lpVtbl = &IDirect3DLight_Vtbl; - object->ref = 1; - object->ddraw = ddraw_from_d3d3(iface); + d3d_light_init(object, ddraw_from_d3d3(iface));
TRACE("Created light %p.\n", object); *light = (IDirect3DLight *)object; diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h index fe65b79..f7ea61d 100644 --- a/dlls/ddraw/ddraw_private.h +++ b/dlls/ddraw/ddraw_private.h @@ -525,12 +525,10 @@ struct IDirect3DLightImpl IDirect3DLightImpl *next; };
-/* Vtable */ -extern const IDirect3DLightVtbl IDirect3DLight_Vtbl DECLSPEC_HIDDEN; - /* Helper functions */ void light_activate(IDirect3DLightImpl *light) DECLSPEC_HIDDEN; void light_deactivate(IDirect3DLightImpl *light) DECLSPEC_HIDDEN; +void d3d_light_init(IDirect3DLightImpl *light, IDirectDrawImpl *ddraw) DECLSPEC_HIDDEN;
/****************************************************************************** * IDirect3DMaterial implementation structure - Wraps to D3D7 diff --git a/dlls/ddraw/light.c b/dlls/ddraw/light.c index 9726d86..3cf26b5 100644 --- a/dlls/ddraw/light.c +++ b/dlls/ddraw/light.c @@ -287,7 +287,7 @@ IDirect3DLightImpl_GetLight(IDirect3DLight *iface, return DD_OK; }
-const IDirect3DLightVtbl IDirect3DLight_Vtbl = +static const struct IDirect3DLightVtbl d3d_light_vtbl = { /*** IUnknown Methods ***/ IDirect3DLightImpl_QueryInterface, @@ -298,3 +298,10 @@ const IDirect3DLightVtbl IDirect3DLight_Vtbl = IDirect3DLightImpl_SetLight, IDirect3DLightImpl_GetLight }; + +void d3d_light_init(IDirect3DLightImpl *light, IDirectDrawImpl *ddraw) +{ + light->lpVtbl = &d3d_light_vtbl; + light->ref = 1; + light->ddraw = ddraw; +}