correct loop check for enum display and include 32bit modes in 24bit

Oliver Stieber oliver_stieber at yahoo.co.uk
Tue Jan 4 11:10:03 CST 2005


Hi, this patch fixes some applications that request
the avaiable display modes.
Firstly they request 24bit, but I'm running x as
32bit, 24bpp so the current display modes arn't
included.

Secondly, the counter check has the wrong lt,gt so the
loop never gets run.

Index: dlls/wined3d/directx.c
===================================================================
RCS file: /home/wine/wine/dlls/wined3d/directx.c,v
retrieving revision 1.15
diff -B -b -U3 -r1.15 directx.c
--- dlls/wined3d/directx.c      14 Dec 2004 11:54:27
-0000      1.15
+++ dlls/wined3d/directx.c      4 Jan 2005 16:57:22
-0000
@@ -562,6 +562,7 @@
             case D3DFMT_X8R8G8B8:
             case D3DFMT_A8R8G8B8:
                    if (min(DevModeW.dmBitsPerPel,
bpp) == 32) i++;
+                   if (min(DevModeW.dmBitsPerPel,
bpp) == 24) i++;
                    break;
             case D3DFMT_X1R5G5B5:
             case D3DFMT_A1R5G5B5:
@@ -618,7 +619,7 @@
             DEVMODEW DevModeWtmp;


-            while ((Mode+1) < i &&
EnumDisplaySettingsExW(NULL, j, &DevModeWtmp, 0)) {
+            while (i<(Mode+1) &&
EnumDisplaySettingsExW(NULL, j, &DevModeWtmp, 0)) {
                 j++;
                 switch (Format)
                 {
@@ -628,6 +629,7 @@
                 case D3DFMT_X8R8G8B8:
                 case D3DFMT_A8R8G8B8:
                        if
(min(DevModeWtmp.dmBitsPerPel, bpp) == 32) i++;
+                       if
(min(DevModeWtmp.dmBitsPerPel, bpp) == 24) i++;
                        break;
                 case D3DFMT_X1R5G5B5:
                 case D3DFMT_A1R5G5B5:



	
	
		
___________________________________________________________ 
ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com



More information about the wine-patches mailing list