From 76b1b912083621d7af2fd2f6a9110e6dceb6a903 Mon Sep 17 00:00:00 2001 From: Trent Waddington Date: Wed, 5 Sep 2007 19:39:32 +1000 Subject: Ignore bIcon if resource is not a cursor. --- dlls/user32/cursoricon.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c index d528bee..f4a5fac 100644 --- a/dlls/user32/cursoricon.c +++ b/dlls/user32/cursoricon.c @@ -702,8 +702,19 @@ HICON WINAPI CreateIconFromResourceEx( LPBYTE bits, UINT cbSize, else /* get the hotspot */ { POINT16 *pt = (POINT16 *)bits; - hotspot = *pt; bmi = (BITMAPINFO *)(pt + 1); + + /* check if caller is lying */ + if ( (bmi->bmiHeader.biSize != sizeof(BITMAPCOREHEADER)) && + (bmi->bmiHeader.biSize != sizeof(BITMAPINFOHEADER) || + bmi->bmiHeader.biCompression != BI_RGB) ) + { + /* pretend the caller said it was an icon */ + bIcon = TRUE; + bmi = (BITMAPINFO *)bits; + } + else + hotspot = *pt; } size = bitmap_info_size( bmi, DIB_RGB_COLORS ); -- 1.4.4.3 From 28eeac81cd74ea7bc1e31603ea63957cb075a778 Mon Sep 17 00:00:00 2001 From: Trent Waddington Date: Wed, 5 Sep 2007 19:40:16 +1000 Subject: Some hacks to make bad depth buffer usage in ddraw work. --- dlls/ddraw/ddraw.c | 9 ++++++++- dlls/wined3d/device.c | 3 ++- dlls/wined3d/surface_gdi.c | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index 696552d..1c3b18c 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -2382,7 +2382,7 @@ IDirectDrawImpl_CreateSurface(IDirectDraw7 *iface, PixelFormat_WineD3DtoDD(&desc2.u4.ddpfPixelFormat, WINED3DFMT_D32); break; default: - ERR("Unknown Z buffer bit depth\n"); + ERR("Unknown Z buffer bit depth %i\n", desc2.u2.dwMipMapCount); } } else @@ -2390,6 +2390,13 @@ IDirectDrawImpl_CreateSurface(IDirectDraw7 *iface, PixelFormat_WineD3DtoDD(&desc2.u4.ddpfPixelFormat, Mode.Format); } } + else if((desc2.ddsCaps.dwCaps & DDSCAPS_ZBUFFER) && + !desc2.u4.ddpfPixelFormat.dwFlags) + { + TRACE("caps says this is a ZBUFFER but DDPF_ZBUFFER not set in pixel format\n"); + desc2.u4.ddpfPixelFormat.dwFlags = DDPF_ZBUFFER; + desc2.u4.ddpfPixelFormat.DUMMYUNIONNAME1.dwZBufferBitDepth = This->orig_bpp; // XXX + } /* No Width or no Height? Use the original screen size */ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 044e2af..5975ab4 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -789,8 +789,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, U break; }; - if (Usage & WINED3DUSAGE_RENDERTARGET && Pool != WINED3DPOOL_DEFAULT) { + if ((Usage & WINED3DUSAGE_RENDERTARGET) && Pool != WINED3DPOOL_DEFAULT) { FIXME("Trying to create a render target that isn't in the default pool\n"); + Pool = WINED3DPOOL_DEFAULT; } /* mark the texture as dirty so that it gets loaded first time around*/ diff --git a/dlls/wined3d/surface_gdi.c b/dlls/wined3d/surface_gdi.c index 9f49882..8612f71 100644 --- a/dlls/wined3d/surface_gdi.c +++ b/dlls/wined3d/surface_gdi.c @@ -758,6 +758,7 @@ IWineGDISurfaceImpl_Blt(IWineD3DSurface *iface, if (Flags & WINEDDBLT_DEPTHFILL) { FIXME("DDBLT_DEPTHFILL needs to be implemented!\n"); + Flags &= ~WINEDDBLT_DEPTHFILL; } if (Flags & WINEDDBLT_ROP) { -- 1.4.4.3