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 |
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 |
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) |