Skip to content

Commit

Permalink
No longer video modes duplicated
Browse files Browse the repository at this point in the history
  • Loading branch information
yvt committed Feb 14, 2014
1 parent 50d3bc7 commit 33043c1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Sources/Gui/StartupScreenHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,16 @@ namespace spades {
SDL_DisplayMode mode;
modes.clear();
if(numDisplayMode > 0){
std::set<std::pair<int,int>> foundModes;
for(int i = 0; i < numDisplayMode; i++) {
SDL_GetDisplayMode(idDisplay, i, &mode);
if(mode.w < 800 || mode.h < 600)
continue;
modes.push_back(spades::IntVector3::Make(mode.w, mode.h, 0));
if(foundModes.find(std::make_pair(mode.w, mode.h)) != foundModes.end())
continue;

foundModes.insert(std::make_pair(mode.w, mode.h));
modes.push_back(spades::IntVector3::Make(mode.w, mode.h, 0));
SPLog("Video Mode Found: %dx%d", mode.w, mode.h);
}
}else{
Expand Down

0 comments on commit 33043c1

Please sign in to comment.