Jan Zerebecki : wined3d: replace #ifdef with if() for DEBUG_SINGLE_MODE.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Feb 23 05:28:17 CST 2007


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

Author: Jan Zerebecki <jan.wine at zerebecki.de>
Date:   Fri Feb 23 09:27:42 2007 +0100

wined3d: replace #ifdef with if() for DEBUG_SINGLE_MODE.

---

 dlls/wined3d/directx.c |   70 ++++++++++++++++++++++++-----------------------
 1 files changed, 36 insertions(+), 34 deletions(-)

diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 653c183..58b00d7 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -23,8 +23,10 @@
 
 /* Compile time diagnostics: */
 
-/* Uncomment this to force only a single display mode to be exposed: */
-/*#define DEBUG_SINGLE_MODE*/
+#ifndef DEBUG_SINGLE_MODE
+/* Set to 1 to force only a single display mode to be exposed: */
+#define DEBUG_SINGLE_MODE 0
+#endif
 
 
 #include "config.h"
@@ -1095,32 +1097,34 @@ static UINT     WINAPI IWineD3DImpl_GetAdapterModeCount(IWineD3D *iface, UINT Ad
     if (Adapter == 0) { /* Display */
         int i = 0;
         int j = 0;
-#if !defined( DEBUG_SINGLE_MODE )
-        DEVMODEW DevModeW;
 
-        while (EnumDisplaySettingsExW(NULL, j, &DevModeW, 0)) {
-            j++;
-            switch (Format)
-            {
-                case WINED3DFMT_UNKNOWN:
-                    if (DevModeW.dmBitsPerPel == 32 ||
-                        DevModeW.dmBitsPerPel == 16) i++;
-                    break;
-                case WINED3DFMT_X8R8G8B8:
-                    if (DevModeW.dmBitsPerPel == 32) i++;
-                    break;
-                case WINED3DFMT_R5G6B5:
-                    if (DevModeW.dmBitsPerPel == 16) i++;
-                    break;
-                default:
-                    /* Skip other modes as they do not match the requested format */
-                    break;
+        if (!DEBUG_SINGLE_MODE) {
+            DEVMODEW DevModeW;
+
+            while (EnumDisplaySettingsExW(NULL, j, &DevModeW, 0)) {
+                j++;
+                switch (Format)
+                {
+                    case WINED3DFMT_UNKNOWN:
+                        if (DevModeW.dmBitsPerPel == 32 ||
+                            DevModeW.dmBitsPerPel == 16) i++;
+                        break;
+                    case WINED3DFMT_X8R8G8B8:
+                        if (DevModeW.dmBitsPerPel == 32) i++;
+                        break;
+                    case WINED3DFMT_R5G6B5:
+                        if (DevModeW.dmBitsPerPel == 16) i++;
+                        break;
+                    default:
+                        /* Skip other modes as they do not match the requested format */
+                        break;
+                }
             }
+        } else {
+            i = 1;
+            j = 1;
         }
-#else
-        i = 1;
-        j = 1;
-#endif
+
         TRACE_(d3d_caps)("(%p}->(Adapter: %d) => %d (out of %d)\n", This, Adapter, i, j);
         return i;
     } else {
@@ -1141,8 +1145,7 @@ static HRESULT WINAPI IWineD3DImpl_EnumAdapterModes(IWineD3D *iface, UINT Adapte
         return WINED3DERR_INVALIDCALL;
     }
 
-    if (Adapter == 0) { /* Display */
-#if !defined( DEBUG_SINGLE_MODE )
+    if (Adapter == 0 && !DEBUG_SINGLE_MODE) { /* Display */
         DEVMODEW DevModeW;
         int ModeIdx = 0;
         int i = 0;
@@ -1207,18 +1210,17 @@ static HRESULT WINAPI IWineD3DImpl_EnumAdapterModes(IWineD3D *iface, UINT Adapte
             return WINED3DERR_INVALIDCALL;
         }
 
-#else
+        TRACE_(d3d_caps)("W %d H %d rr %d fmt (%x - %s) bpp %u\n", pMode->Width, pMode->Height,
+                pMode->RefreshRate, pMode->Format, debug_d3dformat(pMode->Format),
+                DevModeW.dmBitsPerPel);
+
+    } else if (DEBUG_SINGLE_MODE) {
         /* Return one setting of the format requested */
         if (Mode > 0) return WINED3DERR_INVALIDCALL;
         pMode->Width        = 800;
         pMode->Height       = 600;
-        pMode->RefreshRate  = WINED3DADAPTER_DEFAULT;
+        pMode->RefreshRate  = 60;
         pMode->Format       = (Format == WINED3DFMT_UNKNOWN) ? WINED3DFMT_X8R8G8B8 : Format;
-#endif
-        TRACE_(d3d_caps)("W %d H %d rr %d fmt (%x - %s) bpp %u\n", pMode->Width, pMode->Height,
-                 pMode->RefreshRate, pMode->Format, debug_d3dformat(pMode->Format),
-                 DevModeW.dmBitsPerPel);
-
     } else {
         FIXME_(d3d_caps)("Adapter not primary display\n");
     }




More information about the wine-cvs mailing list