As I hate spending one hour finding a bug that would have been spotted right away with the right TRACEs, add some TRACEs to the DDraw code :-) Changelog: Add some TRACEs to the ddraw code -- Lionel Ulmer - http://www.bbrox.org/
? PATCH_D3D8 ? PATCH_DDRAW_TRACE Index: dlls/ddraw/d3d_private.h =================================================================== RCS file: /home/wine/wine/dlls/ddraw/d3d_private.h,v retrieving revision 1.7 diff -u -r1.7 d3d_private.h --- dlls/ddraw/d3d_private.h 31 May 2002 23:25:45 -0000 1.7 +++ dlls/ddraw/d3d_private.h 10 Oct 2002 19:11:49 -0000 @@ -570,7 +570,7 @@ extern int is_OpenGL(REFCLSID rguid, IDirectDrawSurfaceImpl* surface, IDirect3DDevice2Impl** device, IDirect3D2Impl* d3d); -extern void _dump_renderstate(D3DRENDERSTATETYPE type, DWORD value); +extern const char *_get_renderstate(D3DRENDERSTATETYPE type); #define dump_mat(mat) \ TRACE("%f %f %f %f\n", (mat)->_11, (mat)->_12, (mat)->_13, (mat)->_14); \ Index: dlls/ddraw/d3dcommon.c =================================================================== RCS file: /home/wine/wine/dlls/ddraw/d3dcommon.c,v retrieving revision 1.4 diff -u -r1.4 d3dcommon.c --- dlls/ddraw/d3dcommon.c 9 Mar 2002 23:29:35 -0000 1.4 +++ dlls/ddraw/d3dcommon.c 10 Oct 2002 19:11:49 -0000 @@ -29,9 +29,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(ddraw); -void _dump_renderstate(D3DRENDERSTATETYPE type, DWORD value) { - char *states[] = { - NULL, +const char *_get_renderstate(D3DRENDERSTATETYPE type) { + static const char * const states[] = { + "ERR", "D3DRENDERSTATE_TEXTUREHANDLE", "D3DRENDERSTATE_ANTIALIAS", "D3DRENDERSTATE_TEXTUREADDRESS", @@ -117,5 +117,6 @@ "D3DRENDERSTATE_STIPPLEPATTERN30", "D3DRENDERSTATE_STIPPLEPATTERN31" }; - DPRINTF(" %s = 0x%08lx\n", states[type], value); + if (type >= (sizeof(states) / sizeof(states[0]))) return "ERR"; + return states[type]; } Index: dlls/ddraw/mesa.c =================================================================== RCS file: /home/wine/wine/dlls/ddraw/mesa.c,v retrieving revision 1.7 diff -u -r1.7 mesa.c --- dlls/ddraw/mesa.c 25 Sep 2002 03:18:38 -0000 1.7 +++ dlls/ddraw/mesa.c 10 Oct 2002 19:11:49 -0000 @@ -37,7 +37,7 @@ { if (TRACE_ON(ddraw)) - _dump_renderstate(dwRenderStateType, dwRenderState); + TRACE("%s = %08x\n", _get_renderstate(dwRenderStateType), dwRenderState); /* First, all the stipple patterns */ if ((dwRenderStateType >= D3DRENDERSTATE_STIPPLEPATTERN00) && @@ -269,7 +269,7 @@ break; default: - ERR("Unhandled dwRenderStateType %d!\n",dwRenderStateType); + ERR("Unhandled dwRenderStateType %s !\n", _get_renderstate(dwRenderStateType)); break; } Index: dlls/ddraw/dsurface/main.c =================================================================== RCS file: /home/wine/wine/dlls/ddraw/dsurface/main.c,v retrieving revision 1.28 diff -u -r1.28 main.c --- dlls/ddraw/dsurface/main.c 26 Sep 2002 03:20:07 -0000 1.28 +++ dlls/ddraw/dsurface/main.c 10 Oct 2002 19:11:49 -0000 @@ -924,9 +924,10 @@ /* First, copy the Surface description */ DD_STRUCT_COPY_BYSIZE(pDDSD,&(This->surface_desc)); - TRACE("locked surface: height=%ld, width=%ld, pitch=%ld\n", + TRACE("locked surface returning description : \n", pDDSD->dwHeight,pDDSD->dwWidth,pDDSD->u1.lPitch); - + if (TRACE_ON(ddraw)) DDRAW_dump_surface_desc(pDDSD); + /* If asked only for a part, change the surface pointer. * (Not documented.) */ if (prect != NULL) {