Skip to content

Commit

Permalink
Merge branch 'swrenderer'
Browse files Browse the repository at this point in the history
  • Loading branch information
yvt committed Feb 14, 2014
2 parents 8a5b91c + 33043c1 commit b236c4b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions 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 Expand Up @@ -527,12 +532,12 @@ namespace spades {
}

int StartupScreenHelper::GetVideoModeWidth(int index) {
if(index < 0 || index >= GetNumReportLines())
if(index < 0 || index >= GetNumVideoModes())
SPInvalidArgument("index");
return modes[index].x;
}
int StartupScreenHelper::GetVideoModeHeight(int index) {
if(index < 0 || index >= GetNumReportLines())
if(index < 0 || index >= GetNumVideoModes())
SPInvalidArgument("index");
return modes[index].y;
}
Expand Down

0 comments on commit b236c4b

Please sign in to comment.