Chris Robinson : winex11: Simplify ConvertPixelFormatWGLtoGLX.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Sep 12 07:50:42 CDT 2007


Module: wine
Branch: master
Commit: 6c5b58a44adcb52fba92058be7f09df1b77743cc
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6c5b58a44adcb52fba92058be7f09df1b77743cc

Author: Chris Robinson <chris.kcat at gmail.com>
Date:   Tue Sep 11 13:09:14 2007 -0700

winex11: Simplify ConvertPixelFormatWGLtoGLX.

---

 dlls/winex11.drv/opengl.c |   20 ++++++++------------
 1 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index be215ae..6fffb80 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -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
      * iPixelFormat in case of probing the number of pixelformats.
      */
-    if((iPixelFormat <= 0) || (iPixelFormat > WineGLPixelFormatListSize)) {
-        if(AllowOffscreen)
-            *fmt_count = WineGLPixelFormatListSize;
-        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) {
+    if((iPixelFormat > 0) && (iPixelFormat <= WineGLPixelFormatListSize) &&
+       ((WineGLPixelFormatList[iPixelFormat-1].offscreenOnly == FALSE) ||
+        AllowOffscreen)) {
         res = &WineGLPixelFormatList[iPixelFormat-1];
-        *fmt_count = WineGLPixelFormatListSize;
         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);
 
     return res;




More information about the wine-cvs mailing list