ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/SDL/video_sdl.cpp
(Generate patch)

Comparing BasiliskII/src/SDL/video_sdl.cpp (file contents):
Revision 1.16 by gbeauche, 2005-03-17T00:19:39Z vs.
Revision 1.17 by gbeauche, 2005-03-19T05:34:15Z

# Line 959 | Line 959 | bool VideoInit(bool classic)
959          int max_width = 640, max_height = 480;
960          SDL_Rect **modes = SDL_ListModes(NULL, SDL_FULLSCREEN | SDL_HWSURFACE);
961          if (modes && modes != (SDL_Rect **)-1) {
962 <                max_width = modes[0]->w;
963 <                max_height = modes[0]->h;
962 >                // It turns out that on some implementations, and contrary to the documentation,
963 >                // the returned list is not sorted from largest to smallest (e.g. Windows)
964 >                for (int i = 0; modes[i] != NULL; i++) {
965 >                        const int w = modes[i]->w;
966 >                        const int h = modes[i]->h;
967 >                        if (w > max_width && h > max_height) {
968 >                                max_width = w;
969 >                                max_height = h;
970 >                        }
971 >                }
972                  if (default_width > max_width)
973                          default_width = max_width;
974                  if (default_height > max_height)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines