From 51657e10769faa2617d546a06c42e4c62a19bb50 Mon Sep 17 00:00:00 2001 From: Aki Date: Sun, 30 Jan 2022 17:41:24 +0100 Subject: Removed trailing whitespace all over the place --- Stars45/VideoDX9Enum.cpp | 70 ++++++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 35 deletions(-) (limited to 'Stars45/VideoDX9Enum.cpp') diff --git a/Stars45/VideoDX9Enum.cpp b/Stars45/VideoDX9Enum.cpp index c2445fb..d123175 100644 --- a/Stars45/VideoDX9Enum.cpp +++ b/Stars45/VideoDX9Enum.cpp @@ -269,7 +269,7 @@ VideoDX9Enum::IsModeSupported(int w, int h, int b) const // +--------------------------------------------------------------------+ -HRESULT +HRESULT VideoDX9Enum::Enumerate() { HRESULT hr = E_FAIL; @@ -299,18 +299,18 @@ VideoDX9Enum::Enumerate() adapter_info->adapter_ordinal = ordinal; d3d->GetAdapterIdentifier(ordinal, 0, &adapter_info->adapter_identifier); - // Get list of all display modes on this adapter. + // Get list of all display modes on this adapter. // Also build a temporary list of all display adapter formats. adapter_format_list.clear(); for (size_t iaaf = 0; iaaf < allowed_adapter_format_list.size(); iaaf++) { D3DFORMAT allowed_adapter_format = allowed_adapter_format_list[iaaf]; UINT num_adapter_modes = d3d->GetAdapterModeCount(ordinal, allowed_adapter_format); - + for (UINT mode = 0; mode < num_adapter_modes; mode++) { D3DDISPLAYMODE display_mode; d3d->EnumAdapterModes(ordinal, allowed_adapter_format, mode, &display_mode); - + if (display_mode.Width < min_width || display_mode.Height < min_height || GetColorChannelBits(display_mode.Format) < min_color_bits) { @@ -335,7 +335,7 @@ VideoDX9Enum::Enumerate() } if (!contains_display_mode) adapter_format_list.push_back(display_mode.Format); - + } } @@ -381,7 +381,7 @@ VideoDX9Enum::Enumerate() // +--------------------------------------------------------------------+ -HRESULT +HRESULT VideoDX9Enum::EnumerateDevices(VideoDX9AdapterInfo* adapter_info, std::vector& adapter_format_list) { HRESULT hr = E_FAIL; @@ -396,9 +396,9 @@ VideoDX9Enum::EnumerateDevices(VideoDX9AdapterInfo* adapter_info, std::vectoradapter_ordinal = adapter_info->adapter_ordinal; device_info->device_type = dtypes[i]; - - if (FAILED(d3d->GetDeviceCaps(adapter_info->adapter_ordinal, - device_info->device_type, + + if (FAILED(d3d->GetDeviceCaps(adapter_info->adapter_ordinal, + device_info->device_type, &device_info->caps))) { delete device_info; continue; @@ -430,7 +430,7 @@ VideoDX9Enum::EnumerateDevices(VideoDX9AdapterInfo* adapter_info, std::vector& adapter_format_list) { const D3DFORMAT back_buffer_formats[] = { @@ -448,7 +448,7 @@ VideoDX9Enum::EnumerateDeviceCombos(VideoDX9DeviceInfo* device_info, std::vector D3DFORMAT a_fmt; for (size_t i = 0; i < adapter_format_list.size(); i++) { a_fmt = adapter_format_list[i]; - + D3DFORMAT b_fmt; for (int n = 0; n < 6; n++) { b_fmt = back_buffer_formats[n]; @@ -467,7 +467,7 @@ VideoDX9Enum::EnumerateDeviceCombos(VideoDX9DeviceInfo* device_info, std::vector continue; if (FAILED(d3d->CheckDeviceType(device_info->adapter_ordinal, - device_info->device_type, + device_info->device_type, a_fmt, b_fmt, win))) { @@ -475,7 +475,7 @@ VideoDX9Enum::EnumerateDeviceCombos(VideoDX9DeviceInfo* device_info, std::vector } // At this point, we have an adapter/device/adapterformat/backbufferformat/iswindowed - // DeviceCombo that is supported by the system. We still need to confirm that it's + // DeviceCombo that is supported by the system. We still need to confirm that it's // compatible with the app, and find one or more suitable depth/stencil buffer format, // multisample type, vertex processing type, and present interval. @@ -503,7 +503,7 @@ VideoDX9Enum::EnumerateDeviceCombos(VideoDX9DeviceInfo* device_info, std::vector delete device_combo; continue; } - + BuildDSMSConflictList(device_combo); BuildVertexProcessingTypeList(device_info, device_combo); @@ -522,7 +522,7 @@ VideoDX9Enum::EnumerateDeviceCombos(VideoDX9DeviceInfo* device_info, std::vector return S_OK; } -void +void VideoDX9Enum::BuildDepthStencilFormatList(VideoDX9DeviceCombo* device_combo) { const D3DFORMAT depth_stencil_formats[] = { @@ -543,14 +543,14 @@ VideoDX9Enum::BuildDepthStencilFormatList(VideoDX9DeviceCombo* device_combo) if (GetStencilBits(fmt) < min_stencil_bits) continue; - if (SUCCEEDED(d3d->CheckDeviceFormat(device_combo->adapter_ordinal, + if (SUCCEEDED(d3d->CheckDeviceFormat(device_combo->adapter_ordinal, device_combo->device_type, - device_combo->adapter_format, + device_combo->adapter_format, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_SURFACE, fmt))) { - if (SUCCEEDED(d3d->CheckDepthStencilMatch(device_combo->adapter_ordinal, + if (SUCCEEDED(d3d->CheckDepthStencilMatch(device_combo->adapter_ordinal, device_combo->device_type, device_combo->adapter_format, device_combo->back_buffer_format, @@ -562,10 +562,10 @@ VideoDX9Enum::BuildDepthStencilFormatList(VideoDX9DeviceCombo* device_combo) } } -void +void VideoDX9Enum::BuildMultiSampleTypeList(VideoDX9DeviceCombo* device_combo) { - const D3DMULTISAMPLE_TYPE multisample_type_array[] = { + const D3DMULTISAMPLE_TYPE multisample_type_array[] = { D3DMULTISAMPLE_NONE, D3DMULTISAMPLE_NONMASKABLE, D3DMULTISAMPLE_2_SAMPLES, @@ -590,7 +590,7 @@ VideoDX9Enum::BuildMultiSampleTypeList(VideoDX9DeviceCombo* device_combo) DWORD multisample_qual = 0; if (SUCCEEDED(d3d->CheckDeviceMultiSampleType(device_combo->adapter_ordinal, - device_combo->device_type, + device_combo->device_type, device_combo->back_buffer_format, device_combo->is_windowed, multisample_type, @@ -602,7 +602,7 @@ VideoDX9Enum::BuildMultiSampleTypeList(VideoDX9DeviceCombo* device_combo) } } -void +void VideoDX9Enum::BuildDSMSConflictList(VideoDX9DeviceCombo* device_combo) { for (size_t i = 0; i < device_combo->depth_stencil_fmt_list.size(); i++) { @@ -629,7 +629,7 @@ VideoDX9Enum::BuildDSMSConflictList(VideoDX9DeviceCombo* device_combo) } } -void +void VideoDX9Enum::BuildVertexProcessingTypeList(VideoDX9DeviceInfo* device_info, VideoDX9DeviceCombo* device_combo) { if ((device_info->caps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) != 0) { @@ -647,10 +647,10 @@ VideoDX9Enum::BuildVertexProcessingTypeList(VideoDX9DeviceInfo* device_info, Vid device_combo->vertex_processing_list.push_back(SOFTWARE_VP); } -void +void VideoDX9Enum::BuildPresentIntervalList(VideoDX9DeviceInfo* device_info, VideoDX9DeviceCombo* device_combo) { - const DWORD present_interval_array[] = { + const DWORD present_interval_array[] = { D3DPRESENT_INTERVAL_IMMEDIATE, D3DPRESENT_INTERVAL_DEFAULT, D3DPRESENT_INTERVAL_ONE, @@ -661,7 +661,7 @@ VideoDX9Enum::BuildPresentIntervalList(VideoDX9DeviceInfo* device_info, VideoDX9 for (int i = 0; i < 6; i++) { DWORD interval = present_interval_array[i]; - + if (device_combo->is_windowed && i > 2) { // none of the remaining intervals are supported in windowed mode. break; @@ -678,13 +678,13 @@ VideoDX9Enum::BuildPresentIntervalList(VideoDX9DeviceInfo* device_info, VideoDX9 } } -bool +bool VideoDX9Enum::SuggestWindowSettings(VideoSettings* vs) { if (!vs) return false; - // Get display mode of primary adapter (which is assumed to be where the window + // Get display mode of primary adapter (which is assumed to be where the window // will appear) D3DDISPLAYMODE desktop_display_mode; d3d->GetAdapterDisplayMode(0, &desktop_display_mode); @@ -708,17 +708,17 @@ VideoDX9Enum::SuggestWindowSettings(VideoSettings* vs) VideoDX9DeviceCombo* device_combo = c_iter.value(); bool formats_match = (device_combo->back_buffer_format == device_combo->adapter_format); - + if (!device_combo->is_windowed) continue; - + if (device_combo->adapter_format != desktop_display_mode.Format) continue; // If we haven't found a compatible DeviceCombo yet, or if this set // is better (because it's a HAL, and/or because formats match better), // save it - if (best_device_combo == NULL || + if (best_device_combo == NULL || best_device_combo->device_type != D3DDEVTYPE_HAL && device_combo->device_type == D3DDEVTYPE_HAL || device_combo->device_type == D3DDEVTYPE_HAL && formats_match) { @@ -773,8 +773,8 @@ VideoDX9Enum::SuggestFullscreenSettings(VideoSettings* vs) WORD desired_width = vs->fullscreen_mode.width; WORD desired_height = vs->fullscreen_mode.height; - // For fullscreen, default to first HAL DeviceCombo that supports the current desktop - // display mode, or any display mode if HAL is not compatible with the desktop mode, or + // For fullscreen, default to first HAL DeviceCombo that supports the current desktop + // display mode, or any display mode if HAL is not compatible with the desktop mode, or // non-HAL if no HAL is available D3DDISPLAYMODE desktop_display_mode; D3DDISPLAYMODE best_desktop_display_mode; @@ -849,7 +849,7 @@ EndFullscreenDeviceComboSearch: continue; if (display_mode->width == desired_width && //best_desktop_display_mode.Width && - display_mode->height == desired_height && //best_desktop_display_mode.Height && + display_mode->height == desired_height && //best_desktop_display_mode.Height && display_mode->refresh == best_desktop_display_mode.RefreshRate) { // found a perfect match, so stop @@ -857,7 +857,7 @@ EndFullscreenDeviceComboSearch: break; } else if (display_mode->width == desired_width && //best_desktop_display_mode.Width && - display_mode->height == desired_height && //best_desktop_display_mode.Height && + display_mode->height == desired_height && //best_desktop_display_mode.Height && display_mode->refresh > best_desktop_display_mode.RefreshRate) { // refresh rate doesn't match, but width/height match, so keep this // and keep looking -- cgit v1.1