Changelog: - fix mipmap texture creation - some logging improvements Lionel PS (for Alexandre) : I reattached patch 29 as I found out that it was a bit broken due to my hand-editing. This one should apply now... -- Lionel Ulmer - http://www.bbrox.org/
--- /home/ulmer/Wine/wine_base//dlls/ddraw/d3dtexture.c 2002-12-22 12:12:23.000000000 +0100 +++ /home/ulmer/Wine/wine_work//dlls/ddraw/d3dtexture.c 2002-12-22 14:59:14.000000000 +0100 @@ -791,10 +791,11 @@ if (mipmap_level == 0) { glGenTextures(1, &(private->tex_name)); if (private->tex_name == 0) ERR("Error at creation of OpenGL texture ID !\n"); - TRACE(" GL texture created (private data at %p and GL id %d).\n", private, private->tex_name); + TRACE(" GL texture created for surface %p (private data at %p and GL id %d).\n", surf, private, private->tex_name); } else { - private->tex_name = ((IDirect3DTextureGLImpl *) main->tex_private)->tex_name; - TRACE(" GL texture created (private data at %p and GL id reusing id %d).\n", private, private->tex_name); + private->tex_name = ((IDirect3DTextureGLImpl *) (main->tex_private))->tex_name; + TRACE(" GL texture created for surface %p (private data at %p and GL id reusing id %d from surface %p (%p)).\n", + surf, private, private->tex_name, main, main->tex_private); } if ((at_creation == FALSE) && --- /home/ulmer/Wine/wine_base//dlls/ddraw/ddraw/main.c 2002-12-22 12:19:11.000000000 +0100 +++ /home/ulmer/Wine/wine_work//dlls/ddraw/ddraw/main.c 2002-12-22 15:00:22.000000000 +0100 @@ -397,7 +397,7 @@ IDirectDrawSurface7_Release(*ppSurf); return hr; } - if (This->d3d) This->d3d->create_texture(This->d3d, ICOM_OBJECT(IDirectDrawSurfaceImpl, IDirectDrawSurface7, *ppSurf), TRUE, + if (This->d3d) This->d3d->create_texture(This->d3d, ICOM_OBJECT(IDirectDrawSurfaceImpl, IDirectDrawSurface7, mipmap), TRUE, ICOM_OBJECT(IDirectDrawSurfaceImpl, IDirectDrawSurface7, *ppSurf), mipmap_level); IDirectDrawSurface7_AddAttachedSurface(prev_mipmap, mipmap); --- /home/ulmer/Wine/wine_base//dlls/ddraw/dsurface/dib.c 2002-12-22 12:06:18.000000000 +0100 +++ /home/ulmer/Wine/wine_work//dlls/ddraw/dsurface/dib.c 2002-12-22 14:49:22.000000000 +0100 @@ -354,14 +354,6 @@ TRACE("(%p)->(%p,%p,%p,%08lx,%p)\n", This,rdst,src,rsrc,dwFlags,lpbltfx); - DD_STRUCT_INIT(&ddesc); - DD_STRUCT_INIT(&sdesc); - - sdesc.dwSize = sizeof(sdesc); - if (src) IDirectDrawSurface7_Lock(src, NULL, &sdesc, DDLOCK_READONLY, 0); - ddesc.dwSize = sizeof(ddesc); - IDirectDrawSurface7_Lock(iface,NULL,&ddesc,DDLOCK_WRITEONLY,0); - if (TRACE_ON(ddraw)) { if (rdst) TRACE("\tdestrect :%dx%d-%dx%d\n",rdst->left,rdst->top,rdst->right,rdst->bottom); if (rsrc) TRACE("\tsrcrect :%dx%d-%dx%d\n",rsrc->left,rsrc->top,rsrc->right,rsrc->bottom); @@ -373,6 +365,14 @@ } } + DD_STRUCT_INIT(&ddesc); + DD_STRUCT_INIT(&sdesc); + + sdesc.dwSize = sizeof(sdesc); + if (src) IDirectDrawSurface7_Lock(src, NULL, &sdesc, DDLOCK_READONLY, 0); + ddesc.dwSize = sizeof(ddesc); + IDirectDrawSurface7_Lock(iface,NULL,&ddesc,DDLOCK_WRITEONLY,0); + if (rdst) { memcpy(&xdst,rdst,sizeof(xdst)); } else {
--- ../wine_base/dlls/ddraw/d3ddevice/mesa.c Mon Dec 16 22:47:16 2002 +++ dlls/ddraw/d3ddevice/mesa.c Sat Dec 21 12:46:58 2002 @@ -117,18 +117,26 @@ pc->dwMiscCaps = D3DPMISCCAPS_CONFORMANT | D3DPMISCCAPS_CULLCCW | D3DPMISCCAPS_CULLCW | D3DPMISCCAPS_LINEPATTERNREP | D3DPMISCCAPS_MASKZ; pc->dwRasterCaps = D3DPRASTERCAPS_DITHER | D3DPRASTERCAPS_FOGRANGE | D3DPRASTERCAPS_FOGTABLE | - D3DPRASTERCAPS_FOGVERTEX | D3DPRASTERCAPS_STIPPLE | D3DPRASTERCAPS_ZBIAS | D3DPRASTERCAPS_ZTEST; - pc->dwZCmpCaps = 0xFFFFFFFF; /* All Z test can be done */ - pc->dwSrcBlendCaps = 0xFFFFFFFF; /* FIXME: need REAL values */ - pc->dwDestBlendCaps = 0xFFFFFFFF; /* FIXME: need REAL values */ - pc->dwAlphaCmpCaps = 0xFFFFFFFF; /* FIXME: need REAL values */ - pc->dwShadeCaps = 0xFFFFFFFF; /* FIXME: need REAL values */ - pc->dwTextureCaps = D3DPTEXTURECAPS_ALPHA | D3DPTEXTURECAPS_BORDER | D3DPTEXTURECAPS_PERSPECTIVE | + D3DPRASTERCAPS_FOGVERTEX | D3DPRASTERCAPS_STIPPLE | D3DPRASTERCAPS_ZBIAS | D3DPRASTERCAPS_ZTEST | D3DPRASTERCAPS_SUBPIXEL; + pc->dwZCmpCaps = D3DPCMPCAPS_ALWAYS | D3DPCMPCAPS_EQUAL | D3DPCMPCAPS_GREATER | D3DPCMPCAPS_GREATEREQUAL | + D3DPCMPCAPS_LESS | D3DPCMPCAPS_LESSEQUAL | D3DPCMPCAPS_NEVER | D3DPCMPCAPS_NOTEQUAL; + pc->dwSrcBlendCaps = D3DPBLENDCAPS_ZERO | D3DPBLENDCAPS_ONE | D3DPBLENDCAPS_DESTCOLOR | D3DPBLENDCAPS_INVDESTCOLOR | + D3DPBLENDCAPS_SRCALPHA | D3DPBLENDCAPS_INVSRCALPHA | D3DPBLENDCAPS_DESTALPHA | D3DPBLENDCAPS_INVDESTALPHA | D3DPBLENDCAPS_SRCALPHASAT | + D3DPBLENDCAPS_BOTHSRCALPHA | D3DPBLENDCAPS_BOTHINVSRCALPHA; + pc->dwDestBlendCaps = D3DPBLENDCAPS_ZERO | D3DPBLENDCAPS_ONE | D3DPBLENDCAPS_SRCCOLOR | D3DPBLENDCAPS_INVSRCCOLOR | + D3DPBLENDCAPS_SRCALPHA | D3DPBLENDCAPS_INVSRCALPHA | D3DPBLENDCAPS_DESTALPHA | D3DPBLENDCAPS_INVDESTALPHA | D3DPBLENDCAPS_SRCALPHASAT | + D3DPBLENDCAPS_BOTHSRCALPHA | D3DPBLENDCAPS_BOTHINVSRCALPHA; + pc->dwAlphaCmpCaps = D3DPCMPCAPS_ALWAYS | D3DPCMPCAPS_EQUAL | D3DPCMPCAPS_GREATER | D3DPCMPCAPS_GREATEREQUAL | + D3DPCMPCAPS_LESS | D3DPCMPCAPS_LESSEQUAL | D3DPCMPCAPS_NEVER | D3DPCMPCAPS_NOTEQUAL; + pc->dwShadeCaps = D3DPSHADECAPS_ALPHAFLATBLEND | D3DPSHADECAPS_ALPHAGOURAUDBLEND | D3DPSHADECAPS_COLORFLATRGB | D3DPSHADECAPS_COLORGOURAUDRGB | + D3DPSHADECAPS_FOGFLAT | D3DPSHADECAPS_FOGGOURAUD | D3DPSHADECAPS_SPECULARFLATRGB | D3DPSHADECAPS_SPECULARGOURAUDRGB; + pc->dwTextureCaps = D3DPTEXTURECAPS_ALPHA | D3DPTEXTURECAPS_ALPHAPALETTE | D3DPTEXTURECAPS_BORDER | D3DPTEXTURECAPS_PERSPECTIVE | D3DPTEXTURECAPS_POW2 | D3DPTEXTURECAPS_TRANSPARENCY; pc->dwTextureFilterCaps = D3DPTFILTERCAPS_LINEAR | D3DPTFILTERCAPS_LINEARMIPLINEAR | D3DPTFILTERCAPS_LINEARMIPNEAREST | D3DPTFILTERCAPS_MIPLINEAR | D3DPTFILTERCAPS_MIPNEAREST | D3DPTFILTERCAPS_NEAREST; - pc->dwTextureBlendCaps = 0xFFFFFFFF; /* FIXME: need REAL values */ - pc->dwTextureAddressCaps = D3DPTADDRESSCAPS_BORDER | D3DPTADDRESSCAPS_CLAMP | D3DPTADDRESSCAPS_WRAP; + pc->dwTextureBlendCaps = D3DPTBLENDCAPS_ADD | D3DPTBLENDCAPS_COPY | D3DPTBLENDCAPS_DECAL | D3DPTBLENDCAPS_DECALALPHA | D3DPTBLENDCAPS_DECALMASK | + D3DPTBLENDCAPS_MODULATE | D3DPTBLENDCAPS_MODULATEALPHA | D3DPTBLENDCAPS_MODULATEMASK; + pc->dwTextureAddressCaps = D3DPTADDRESSCAPS_BORDER | D3DPTADDRESSCAPS_CLAMP | D3DPTADDRESSCAPS_WRAP | D3DPTADDRESSCAPS_INDEPENDENTUV; pc->dwStippleWidth = 32; pc->dwStippleHeight = 32; } @@ -444,7 +452,6 @@ LPD3DFINDDEVICESEARCH lpD3DDFS, LPD3DFINDDEVICERESULT lplpD3DDevice) { - DWORD dwSize; D3DDEVICEDESC desc; if ((lpD3DDFS->dwFlags & D3DFDS_COLORMODEL) && @@ -461,18 +468,16 @@ } } /* Now return our own GUID */ lplpD3DDevice->guid = IID_D3DDEVICE_OpenGL; fill_opengl_caps(&desc); - dwSize = lplpD3DDevice->ddHwDesc.dwSize; - memset(&(lplpD3DDevice->ddHwDesc), 0, dwSize); - memcpy(&(lplpD3DDevice->ddHwDesc), &desc, (dwSize <= desc.dwSize ? dwSize : desc.dwSize)); - dwSize = lplpD3DDevice->ddSwDesc.dwSize; - memset(&(lplpD3DDevice->ddSwDesc), 0, dwSize); - memcpy(&(lplpD3DDevice->ddSwDesc), &desc, (dwSize <= desc.dwSize ? dwSize : desc.dwSize)); + lplpD3DDevice->ddHwDesc = desc; + lplpD3DDevice->ddSwDesc = desc; + + TRACE(" returning Wine's OpenGL device with (undumped) capabilities\n"); return D3D_OK; }