Skip to content

Commit

Permalink
Don't offer resolutions below the minimum size
Browse files Browse the repository at this point in the history
  • Loading branch information
AI0867 committed Jun 12, 2014
1 parent 7960e47 commit 8edbae9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/video.cpp
Expand Up @@ -570,10 +570,13 @@ std::vector<std::pair<int, int> > CVideo::get_available_resolutions()
return result;
}

const std::pair<int,int> min_res = std::make_pair(preferences::min_allowed_width(),preferences::min_allowed_height());

SDL_DisplayMode mode;
for(int i = 0; i < modes; ++i) {
if(SDL_GetDisplayMode(0, i, &mode) == 0) {
result.push_back(std::make_pair(mode.w, mode.h));
if (mode.w >= min_res.first && mode.h >= min_res.second)
result.push_back(std::make_pair(mode.w, mode.h));
}
}

Expand Down

0 comments on commit 8edbae9

Please sign in to comment.