Commit a501ea73 authored by Christian Costa's avatar Christian Costa Committed by Alexandre Julliard

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

Fixed access to d3d private data.
parent 4a8f7b23
...@@ -787,8 +787,7 @@ GL_IDirect3DDeviceImpl_3_2T_SetLightState(LPDIRECT3DDEVICE3 iface, ...@@ -787,8 +787,7 @@ GL_IDirect3DDeviceImpl_3_2T_SetLightState(LPDIRECT3DDEVICE3 iface,
TRACE(" activating material %p.\n", mat); TRACE(" activating material %p.\n", mat);
mat->activate(mat); mat->activate(mat);
} else { } else {
ERR(" D3DLIGHTSTATE_MATERIAL called with NULL material !!!\n"); FIXME(" D3DLIGHTSTATE_MATERIAL called with NULL material !!!\n");
return DDERR_INVALIDPARAMS;
} }
} else if (dwLightStateType == D3DLIGHTSTATE_COLORMODEL /* 3 */) { } else if (dwLightStateType == D3DLIGHTSTATE_COLORMODEL /* 3 */) {
switch (dwLightState) { switch (dwLightState) {
......
...@@ -197,7 +197,7 @@ static void execute(IDirect3DExecuteBufferImpl *This, ...@@ -197,7 +197,7 @@ static void execute(IDirect3DExecuteBufferImpl *This,
if (mat != NULL) { if (mat != NULL) {
mat->activate(mat); mat->activate(mat);
} else { } 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 */) { else if (ci->u1.dlstLightStateType == D3DLIGHTSTATE_COLORMODEL /* 3 */) {
......
...@@ -194,7 +194,7 @@ GL_IDirect3DLightImpl_1_Release(LPDIRECT3DLIGHT iface) ...@@ -194,7 +194,7 @@ GL_IDirect3DLightImpl_1_Release(LPDIRECT3DLIGHT iface)
TRACE("(%p/%p)->() decrementing from %lu.\n", This, iface, This->ref); TRACE("(%p/%p)->() decrementing from %lu.\n", This, iface, This->ref);
if (!--(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); HeapFree(GetProcessHeap(), 0, This);
return 0; return 0;
} }
......
...@@ -82,7 +82,7 @@ GL_IDirect3DImpl_3_2T_1T_CreateLight(LPDIRECT3D3 iface, ...@@ -82,7 +82,7 @@ GL_IDirect3DImpl_3_2T_1T_CreateLight(LPDIRECT3D3 iface,
IUnknown* pUnkOuter) IUnknown* pUnkOuter)
{ {
ICOM_THIS_FROM(IDirectDrawImpl, IDirect3D3, iface); ICOM_THIS_FROM(IDirectDrawImpl, IDirect3D3, iface);
IDirect3DGLImpl *glThis = (IDirect3DGLImpl *) This; IDirect3DGLImpl *glThis = (IDirect3DGLImpl *) This->d3d_private;
int fl; int fl;
IDirect3DLightImpl *d3dlimpl; IDirect3DLightImpl *d3dlimpl;
HRESULT ret_value; HRESULT ret_value;
...@@ -292,7 +292,7 @@ GL_IDirect3DImpl_7_3T_CreateVertexBuffer(LPDIRECT3D7 iface, ...@@ -292,7 +292,7 @@ GL_IDirect3DImpl_7_3T_CreateVertexBuffer(LPDIRECT3D7 iface,
static void light_released(IDirectDrawImpl *This, GLenum light_num) 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); glThis->free_lights |= (light_num - GL_LIGHT0);
} }
......
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