From 4428cc32de1f99463ebaa990726c8bd7a3eef6c4 Mon Sep 17 00:00:00 2001 From: Roderick Colenbrander Date: Mon, 28 Apr 2008 21:13:12 +0000 Subject: [PATCH] wined3d: Fix a few small bugs in WineD3D_ChoosePixelFormat. --- dlls/wined3d/context.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index f185c337506..d80ef0660f1 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -133,6 +133,7 @@ static int WineD3D_ChoosePixelFormat(IWineD3DDeviceImpl *This, HDC hdc, WINED3DF /* Find a pixel format which EXACTLY matches our requirements (except for depth) */ for(i=0; iadapter->cfgs[i]; /* For now only accept RGBA formats. Perhaps some day we will * allow floating point formats for pbuffers. */ @@ -194,7 +195,7 @@ static int WineD3D_ChoosePixelFormat(IWineD3DDeviceImpl *This, HDC hdc, WINED3DF if(!iPixelFormat && !findCompatible) { ERR("Can't find a suitable iPixelFormat\n"); return FALSE; - } else { + } else if(!iPixelFormat) { PIXELFORMATDESCRIPTOR pfd; TRACE("Falling back to ChoosePixelFormat as we weren't able to find an exactly matching pixel format\n"); @@ -218,7 +219,7 @@ static int WineD3D_ChoosePixelFormat(IWineD3DDeviceImpl *This, HDC hdc, WINED3DF } } - TRACE("Found iPixelFormat=%d for ColorFormat=%s, DepthStencilFormat=%s\n", cfgs->iPixelFormat, debug_d3dformat(ColorFormat), debug_d3dformat(DepthStencilFormat)); + TRACE("Found iPixelFormat=%d for ColorFormat=%s, DepthStencilFormat=%s\n", iPixelFormat, debug_d3dformat(ColorFormat), debug_d3dformat(DepthStencilFormat)); return iPixelFormat; } -- 2.11.4.GIT