Skip to content

Commit

Permalink
Fixed potential mode duplication in screen modes list, which in some …
Browse files Browse the repository at this point in the history
…cases could result in not being able to select desired fullscreen resolution properly.
  • Loading branch information
AnotherCommander committed Jun 8, 2017
1 parent 2ba6cf6 commit feb6270
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/SDL/MyOpenGLView.m
Original file line number Diff line number Diff line change
Expand Up @@ -2329,6 +2329,7 @@ - (void) handleStringInput: (SDL_KeyboardEvent *) kbd_event;
}
}


// Full screen mode enumerator.
- (void) populateFullScreenModelist
{
Expand Down Expand Up @@ -2374,14 +2375,18 @@ - (void) populateFullScreenModelist
forKey: kOODisplayHeight];
[mode setValue: [NSNumber numberWithInt: 0]
forKey: kOODisplayRefreshRate];
[screenSizes addObject: mode];
OOLog(@"display.mode.list", @"Added res %d x %d", modes[i]->w, modes[i]->h);
lastw=modes[i]->w;
lasth=modes[i]->h;
if (![screenSizes containsObject:mode])
{
[screenSizes addObject: mode];
OOLog(@"display.mode.list", @"Added res %d x %d", modes[i]->w, modes[i]->h);
lastw=modes[i]->w;
lasth=modes[i]->h;
}
}
}
}


// Save and restore window sizes to/from defaults.
- (void) saveWindowSize: (NSSize) windowSize
{
Expand Down

0 comments on commit feb6270

Please sign in to comment.