winex11: Simplify ConvertPixelFormatWGLtoGLX.

This commit is contained in:
Chris Robinson 2007-09-11 13:09:14 -07:00 committed by Alexandre Julliard
parent 5221921fa6
commit 6c5b58a44a
1 changed files with 8 additions and 12 deletions

View File

@ -894,22 +894,18 @@ static WineGLPixelFormat* ConvertPixelFormatWGLtoGLX(Display *display, int iPixe
/* Check if the pixelformat is valid. Note that it is legal to pass an invalid /* Check if the pixelformat is valid. Note that it is legal to pass an invalid
* iPixelFormat in case of probing the number of pixelformats. * iPixelFormat in case of probing the number of pixelformats.
*/ */
if((iPixelFormat <= 0) || (iPixelFormat > WineGLPixelFormatListSize)) { if((iPixelFormat > 0) && (iPixelFormat <= WineGLPixelFormatListSize) &&
if(AllowOffscreen) ((WineGLPixelFormatList[iPixelFormat-1].offscreenOnly == FALSE) ||
*fmt_count = WineGLPixelFormatListSize; AllowOffscreen)) {
else
*fmt_count = 1; /* Only show the format of our main visual */
}
else if(iPixelFormat == 1) {
res = &WineGLPixelFormatList[0];
*fmt_count = 1; /* Only show the format of our main visual */
}
else if((WineGLPixelFormatList[iPixelFormat-1].offscreenOnly == TRUE) && AllowOffscreen) {
res = &WineGLPixelFormatList[iPixelFormat-1]; res = &WineGLPixelFormatList[iPixelFormat-1];
*fmt_count = WineGLPixelFormatListSize;
TRACE("Returning FBConfig=%p for iPixelFormat=%d\n", res->fbconfig, iPixelFormat); TRACE("Returning FBConfig=%p for iPixelFormat=%d\n", res->fbconfig, iPixelFormat);
} }
if(AllowOffscreen)
*fmt_count = WineGLPixelFormatListSize;
else
*fmt_count = 1;
TRACE("Number of returned pixelformats=%d\n", *fmt_count); TRACE("Number of returned pixelformats=%d\n", *fmt_count);
return res; return res;