mirror of
https://github.com/yann64/haikuports.git
synced 2026-05-05 06:28:55 +02:00
38 lines
1.2 KiB
Diff
38 lines
1.2 KiB
Diff
diff -urN SDL-1.2.13/src/video/bwindow/SDL_sysvideo.cc SDL-1.2.13-haiku/src/video/bwindow/SDL_sysvideo.cc
|
|
--- SDL-1.2.13/src/video/bwindow/SDL_sysvideo.cc 2007-12-31 04:48:12.000000000 +0000
|
|
+++ SDL-1.2.13-haiku/src/video/bwindow/SDL_sysvideo.cc 2009-09-19 21:01:51.000000000 +0000
|
|
@@ -358,16 +358,25 @@
|
|
(current.timing.h_total * current.timing.v_total);
|
|
|
|
modes = SDL_modelist[((bpp+7)/8)-1];
|
|
- for ( i=0; modes[i] && (modes[i]->w > width) &&
|
|
- (modes[i]->h > height); ++i ) {
|
|
- /* still looking */
|
|
- }
|
|
- if ( ! modes[i] || (modes[i]->w < width) || (modes[i]->h < width) ) {
|
|
- --i; /* We went too far */
|
|
+
|
|
+ // find end of list (lowest-resolution mode; modes are ordered
|
|
+ // highest-to-lowest).
|
|
+ i = 0; while(modes[i]) i++;
|
|
+ if (!i) return false; // what? no modes at all?
|
|
+
|
|
+ // find first mode with resolution >= requested in both dimensions
|
|
+ for (--i; i >= 0; --i)
|
|
+ {
|
|
+ if (modes[i]->w >= width && modes[i]->h >= height)
|
|
+ break;
|
|
}
|
|
-
|
|
+
|
|
+ // unable to find any mode with that high a resolution!
|
|
+ if (i < 0)
|
|
+ return false;
|
|
+
|
|
width = modes[i]->w;
|
|
- height = modes[i]->h;
|
|
+ height = modes[i]->h;
|
|
|
|
bscreen.GetModeList(&dmodes, &nmodes);
|
|
for ( i = 0; i < nmodes; ++i ) {
|