mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
don't list resolutions larger than the current screen's in the game options
This commit is contained in:
@@ -562,9 +562,15 @@ void CSystemOptionsWindow::selectGameRes()
|
|||||||
std::vector<std::string> items;
|
std::vector<std::string> items;
|
||||||
const JsonNode & texts = CGI->generaltexth->localizedTexts["systemOptions"]["resolutionMenu"];
|
const JsonNode & texts = CGI->generaltexth->localizedTexts["systemOptions"]["resolutionMenu"];
|
||||||
|
|
||||||
|
SDL_Rect displayBounds;
|
||||||
|
SDL_GetDisplayBounds(std::max(0, SDL_GetWindowDisplayIndex(mainWindow)), &displayBounds);
|
||||||
|
|
||||||
for(const auto & it : conf.guiOptions)
|
for(const auto & it : conf.guiOptions)
|
||||||
{
|
{
|
||||||
const auto & resolution = it.first;
|
const auto & resolution = it.first;
|
||||||
|
if(displayBounds.w < resolution.first || displayBounds.h < resolution.second)
|
||||||
|
continue;
|
||||||
|
|
||||||
std::string resX = boost::lexical_cast<std::string>(resolution.first);
|
std::string resX = boost::lexical_cast<std::string>(resolution.first);
|
||||||
std::string resY = boost::lexical_cast<std::string>(resolution.second);
|
std::string resY = boost::lexical_cast<std::string>(resolution.second);
|
||||||
items.push_back(resX + 'x' + resY);
|
items.push_back(resX + 'x' + resY);
|
||||||
|
Reference in New Issue
Block a user