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.14 by gbeauche, 2005-01-22T17:41:33Z vs.
Revision 1.17 by gbeauche, 2005-03-19T05:34:15Z

# Line 1 | Line 1
1   /*
2   *  video_sdl.cpp - Video/graphics emulation, SDL specific stuff
3   *
4 < *  Basilisk II (C) 1997-2004 Christian Bauer
4 > *  Basilisk II (C) 1997-2005 Christian Bauer
5   *
6   *  This program is free software; you can redistribute it and/or modify
7   *  it under the terms of the GNU General Public License as published by
# Line 82 | Line 82 | static int display_type = DISPLAY_WINDOW
82   #endif
83  
84   // Constants
85 + #ifdef WIN32
86 + const char KEYCODE_FILE_NAME[] = "BasiliskII_keycodes";
87 + #else
88   const char KEYCODE_FILE_NAME[] = DATADIR "/keycodes";
89 + #endif
90  
91  
92   // Global variables
# Line 955 | 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