1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Remove duplicated resolutions, e.g. different frequency

This commit is contained in:
Ivan Savenko 2023-05-07 19:45:03 +03:00
parent 8b27780c11
commit 97d266ea2d
2 changed files with 8 additions and 5 deletions

View File

@ -471,5 +471,13 @@ std::vector<Point> WindowHandler::getSupportedResolutions( int displayIndex) con
result.push_back(resolution);
}
boost::range::sort(result, [](const auto & left, const auto & right)
{
return left.x * left.y < right.x * right.y;
});
result.erase(boost::unique(result).end(), result.end());
return result;
}

View File

@ -185,11 +185,6 @@ void GeneralOptionsTab::selectGameResolution()
{
supportedResolutions = GH.windowHandler().getSupportedResolutions();
boost::range::sort(supportedResolutions, [](const auto & left, const auto & right)
{
return left.x * left.y < right.x * right.y;
});
std::vector<std::string> items;
size_t currentResolutionIndex = 0;
size_t i = 0;