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

This commit is contained in:
Jan Zerebecki 2007-02-23 09:27:42 +01:00 committed by Alexandre Julliard
parent 706bc26a69
commit 870310b461
1 changed files with 36 additions and 34 deletions

View File

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