ddraw: Add a separate function for light initialization.

This commit is contained in:
Henri Verbeet 2010-08-18 19:26:21 +02:00 committed by Alexandre Julliard
parent c5a14085d4
commit c892ed497c
3 changed files with 10 additions and 7 deletions

View File

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

View File

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

View File

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