Commit 870310b4 authored by Jan Zerebecki's avatar Jan Zerebecki Committed by Alexandre Julliard

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

parent 706bc26a
......@@ -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");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment