From a501ea73eab8e53eec32b18ab2b7de7e290317bc Mon Sep 17 00:00:00 2001 From: Christian Costa Date: Tue, 23 Mar 2004 23:02:37 +0000 Subject: [PATCH] Do not return an error when setting a material to NULL. Fixed access to d3d private data. --- dlls/ddraw/d3ddevice/mesa.c | 3 +-- dlls/ddraw/d3dexecutebuffer.c | 2 +- dlls/ddraw/d3dlight.c | 2 +- dlls/ddraw/direct3d/mesa.c | 4 ++-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/dlls/ddraw/d3ddevice/mesa.c b/dlls/ddraw/d3ddevice/mesa.c index 36f28b976b2..dc7ce1a26ce 100644 --- a/dlls/ddraw/d3ddevice/mesa.c +++ b/dlls/ddraw/d3ddevice/mesa.c @@ -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) { diff --git a/dlls/ddraw/d3dexecutebuffer.c b/dlls/ddraw/d3dexecutebuffer.c index 88f5b9527d9..e7111097856 100644 --- a/dlls/ddraw/d3dexecutebuffer.c +++ b/dlls/ddraw/d3dexecutebuffer.c @@ -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 */) { diff --git a/dlls/ddraw/d3dlight.c b/dlls/ddraw/d3dlight.c index 35aeafe5126..b757295fa0d 100644 --- a/dlls/ddraw/d3dlight.c +++ b/dlls/ddraw/d3dlight.c @@ -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; } diff --git a/dlls/ddraw/direct3d/mesa.c b/dlls/ddraw/direct3d/mesa.c index 37630e37d49..5e345c8a3db 100644 --- a/dlls/ddraw/direct3d/mesa.c +++ b/dlls/ddraw/direct3d/mesa.c @@ -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); } -- 2.11.4.GIT