Commit c892ed49 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

ddraw: Add a separate function for light initialization.

parent c5a14085
......@@ -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;
......
......@@ -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
......
......@@ -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;
}
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