Skip to content

Commit cf50229

Browse files
committed
Filter small video modes earlier
1 parent 6546eeb commit cf50229

3 files changed

Lines changed: 4 additions & 5 deletions

File tree

libs/s25main/desktops/dskOptions.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -766,8 +766,6 @@ void dskOptions::loadVideoModes()
766766
{
767767
// Get available modes
768768
videoModes_ = VIDEODRIVER.ListVideoModes();
769-
// Remove everything below 800x600
770-
helpers::erase_if(videoModes_, [](const auto& it) { return it.width < 800 && it.height < 600; });
771769
// Sort by aspect ratio
772770
std::sort(videoModes_.begin(), videoModes_.end(), cmpVideoModes);
773771
windowSizes_ = VIDEODRIVER.GetDefaultWindowSizes();

libs/s25main/drivers/VideoDriverWrapper.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,10 @@ std::vector<VideoMode> VideoDriverWrapper::ListVideoModes() const
433433
if(!videodriver)
434434
return {};
435435

436-
return videodriver->ListVideoModes();
436+
auto videoModes = videodriver->ListVideoModes();
437+
// Remove everything below 800x600
438+
helpers::erase_if(videoModes, [](const auto& m) { return m.width < 800 && m.height < 600; });
439+
return videoModes;
437440
}
438441

439442
std::vector<VideoMode> VideoDriverWrapper::GetDefaultWindowSizes() const

libs/s25main/ingameWindows/iwSettings.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ iwSettings::iwSettings()
7878
->setChecked(!SETTINGS.video.displayMode.resizeable);
7979

8080
supportedResolutions_ = VIDEODRIVER.ListVideoModes();
81-
// Remove everything below 800x600
82-
helpers::erase_if(supportedResolutions_, [](const auto& it) { return it.width < 800 && it.height < 600; });
8381
for(const auto& videoMode : supportedResolutions_)
8482
{
8583
cbResolution->AddItem(helpers::format("%ux%u", videoMode.width, videoMode.height));

0 commit comments

Comments
 (0)