[D3D] Some light and material fixes
Christian Costa
titan.costa at wanadoo.fr
Mon Mar 22 16:20:58 CST 2004
Hi,
Setting a material to NULL is correct. It is supposed to disable
lighting in some way.
For now let's only output a FIXME.
Scrabble works now.
Changelog:
Do not return an error when setting a material to NULL.
Fixed access to d3d private data.
Christian Costa titan.costa at wanadoo.fr
-------------- next part --------------
Index: d3dexecutebuffer.c
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/d3dexecutebuffer.c,v
retrieving revision 1.35
diff -u -r1.35 d3dexecutebuffer.c
--- d3dexecutebuffer.c 15 Sep 2003 19:59:19 -0000 1.35
+++ d3dexecutebuffer.c 22 Mar 2004 21:02:59 -0000
@@ -197,7 +197,7 @@
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 */) {
Index: d3dlight.c
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/d3dlight.c,v
retrieving revision 1.17
diff -u -r1.17 d3dlight.c
--- d3dlight.c 5 Sep 2003 23:08:41 -0000 1.17
+++ d3dlight.c 22 Mar 2004 21:03:00 -0000
@@ -194,7 +194,7 @@
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;
}
Index: d3ddevice/mesa.c
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/d3ddevice/mesa.c,v
retrieving revision 1.152
diff -u -r1.152 mesa.c
--- d3ddevice/mesa.c 20 Mar 2004 02:33:17 -0000 1.152
+++ d3ddevice/mesa.c 22 Mar 2004 21:03:10 -0000
@@ -787,8 +787,7 @@
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) {
Index: direct3d/mesa.c
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/direct3d/mesa.c,v
retrieving revision 1.31
diff -u -r1.31 mesa.c
--- direct3d/mesa.c 18 Nov 2003 23:20:25 -0000 1.31
+++ direct3d/mesa.c 22 Mar 2004 21:03:10 -0000
@@ -82,7 +82,7 @@
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 @@
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);
}
More information about the wine-patches
mailing list