x11dvr: return support for 24bit - but handle them like 32bit

Christoph Frick frick at sc-networks.de
Fri Sep 8 03:28:41 CDT 2006


hiho

the game ``NASCAR Racing Season 2003`` from Papyrus actually asks when
using the OpenGL driver in the game for 24 bit modes. Otherwise it
complains, that it can not find any display modes (it works with 16bit -
but the game seem only to accept the modes the current desktop runs in).

so what i did is adding the 24bit depth back into the list (last one)
and replaced some magic ints and some unused code on my way through
this.

still this game now does no longer work with wine (it worked a year
ago). no it stumbles when calling wglShareLists.

License: LGPL
ChangeLog: 
	- also list 24bit modes; but still handle them later as 32bit

-- 
cu

diff --git a/dlls/winex11.drv/settings.c b/dlls/winex11.drv/settings.c
index 5de07eb..f6e2807 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(unsigned int);
 
 /* 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);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 163 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20060908/dbeabcef/attachment.pgp


More information about the wine-devel mailing list