Do not return an error when setting a material to NULL.

Fixed access to d3d private data.
This commit is contained in:
Christian Costa 2004-03-23 23:02:37 +00:00 committed by Alexandre Julliard
parent 4a8f7b23ad
commit a501ea73ea
4 changed files with 5 additions and 6 deletions

View File

@ -787,8 +787,7 @@ GL_IDirect3DDeviceImpl_3_2T_SetLightState(LPDIRECT3DDEVICE3 iface,
TRACE(" activating material %p.\n", mat);
mat->activate(mat);
} else {
ERR(" D3DLIGHTSTATE_MATERIAL called with NULL material !!!\n");
return DDERR_INVALIDPARAMS;
FIXME(" D3DLIGHTSTATE_MATERIAL called with NULL material !!!\n");
}
} else if (dwLightStateType == D3DLIGHTSTATE_COLORMODEL /* 3 */) {
switch (dwLightState) {

View File

@ -197,7 +197,7 @@ static void execute(IDirect3DExecuteBufferImpl *This,
if (mat != NULL) {
mat->activate(mat);
} else {
ERR(" D3DLIGHTSTATE_MATERIAL called with NULL material !!!\n");
FIXME(" D3DLIGHTSTATE_MATERIAL called with NULL material !!!\n");
}
}
else if (ci->u1.dlstLightStateType == D3DLIGHTSTATE_COLORMODEL /* 3 */) {

View File

@ -194,7 +194,7 @@ GL_IDirect3DLightImpl_1_Release(LPDIRECT3DLIGHT iface)
TRACE("(%p/%p)->() decrementing from %lu.\n", This, iface, This->ref);
if (!--(This->ref)) {
((IDirect3DGLImpl *) This->d3d)->light_released(This->d3d, glThis->light_num);
((IDirect3DGLImpl *) This->d3d->d3d_private)->light_released(This->d3d, glThis->light_num);
HeapFree(GetProcessHeap(), 0, This);
return 0;
}

View File

@ -82,7 +82,7 @@ GL_IDirect3DImpl_3_2T_1T_CreateLight(LPDIRECT3D3 iface,
IUnknown* pUnkOuter)
{
ICOM_THIS_FROM(IDirectDrawImpl, IDirect3D3, iface);
IDirect3DGLImpl *glThis = (IDirect3DGLImpl *) This;
IDirect3DGLImpl *glThis = (IDirect3DGLImpl *) This->d3d_private;
int fl;
IDirect3DLightImpl *d3dlimpl;
HRESULT ret_value;
@ -292,7 +292,7 @@ GL_IDirect3DImpl_7_3T_CreateVertexBuffer(LPDIRECT3D7 iface,
static void light_released(IDirectDrawImpl *This, GLenum light_num)
{
IDirect3DGLImpl *glThis = (IDirect3DGLImpl *) This;
IDirect3DGLImpl *glThis = (IDirect3DGLImpl *) This->d3d_private;
glThis->free_lights |= (light_num - GL_LIGHT0);
}