[PATCH] Also show 24bit modes as supported, but still handle them like 32bit later

Christoph Frick frick at scn-penzberg.de
Wed Sep 13 03:01:42 CDT 2006


hi

would someone please comment on that patch? this is a nearly unchanged
version of my previous attempt - but this time against current git.

---
 dlls/winex11.drv/settings.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/dlls/winex11.drv/settings.c b/dlls/winex11.drv/settings.c
index 5de07eb..c9bced2 100644
--- a/dlls/winex11.drv/settings.c
+++ b/dlls/winex11.drv/settings.c
@@ -39,7 +39,8 @@ static LPDDHALMODEINFO dd_modes = NULL;
 static unsigned int dd_mode_count = 0;
 static unsigned int dd_max_modes = 0;
 static int dd_mode_default = 0;
-static const unsigned int depths[]  = {8, 16, 32};
+static const unsigned int depths[]  = {8, 16, 32, 24};
+static const unsigned int nr_depths = sizeof(depths) / sizeof(depths[0]);
 
 /* pointers to functions that actually do the hard stuff */
 static int (*pGetCurrentMode)(void);
@@ -62,7 +63,7 @@ LPDDHALMODEINFO X11DRV_Settings_SetHandl
     TRACE("Resolution settings now handled by: %s\n", name);
     if (reserve_depths)
         /* leave room for other depths */
-        dd_max_modes = (3+1)*(nmodes);
+        dd_max_modes = nr_depths*nmodes;
     else 
         dd_max_modes = nmodes;
 
@@ -111,7 +112,7 @@ void X11DRV_Settings_AddDepthModes(void)
     int existing_modes = dd_mode_count;
     DWORD dwBpp = screen_depth;
     if (dwBpp == 24) dwBpp = 32;
-    for (j=0; j<3; j++)
+    for (j=0; j<nr_depths; j++)
     {
         if (depths[j] != dwBpp)
         {
@@ -164,8 +165,6 @@ void X11DRV_Settings_Init(void)
  */
 BOOL X11DRV_EnumDisplaySettingsEx( LPCWSTR name, DWORD n, LPDEVMODEW devmode, DWORD flags)
 {
-    DWORD dwBpp = screen_depth;
-    if (dwBpp == 24) dwBpp = 32;
     devmode->dmDisplayFlags = 0;
     devmode->dmDisplayFrequency = 0;
     devmode->dmSize = sizeof(DEVMODEW);
-- 
1.4.2




More information about the wine-devel mailing list