wined3d: Avoid a redundant call to EnumDisplaySettingsExW() in wined3d_enum_adapter_modes().

This commit is contained in:
Henri Verbeet 2012-06-28 13:11:11 +02:00 committed by Alexandre Julliard
parent 91f02018c5
commit b6bdb4286d
1 changed files with 15 additions and 27 deletions

View File

@ -2954,7 +2954,6 @@ HRESULT CDECL wined3d_enum_adapter_modes(const struct wined3d *wined3d, UINT ada
const struct wined3d_format *format = wined3d_get_format(&wined3d->adapters[adapter_idx].gl_info, format_id);
UINT format_bits = format->byte_count * CHAR_BIT;
DEVMODEW DevModeW;
int ModeIdx = 0;
UINT i = 0;
int j = 0;
@ -2983,11 +2982,6 @@ HRESULT CDECL wined3d_enum_adapter_modes(const struct wined3d *wined3d, UINT ada
}
}
ModeIdx = j - 1;
/* Now get the display mode via the calculated index */
if (EnumDisplaySettingsExW(NULL, ModeIdx, &DevModeW, 0))
{
mode->width = DevModeW.dmPelsWidth;
mode->height = DevModeW.dmPelsHeight;
mode->refresh_rate = DEFAULT_REFRESH_RATE;
@ -3005,12 +2999,6 @@ HRESULT CDECL wined3d_enum_adapter_modes(const struct wined3d *wined3d, UINT ada
mode->scanline_ordering = WINED3D_SCANLINE_ORDERING_INTERLACED;
else
mode->scanline_ordering = WINED3D_SCANLINE_ORDERING_PROGRESSIVE;
}
else
{
TRACE("Requested mode %u out of range.\n", mode_idx);
return WINED3DERR_INVALIDCALL;
}
TRACE("%ux%u@%u %u bpp, %s %#x.\n", mode->width, mode->height, mode->refresh_rate,
DevModeW.dmBitsPerPel, debug_d3dformat(mode->format_id), mode->scanline_ordering);