New fullscreen patch to SDL to fix fullscreen issue in BWindow by rogueeve. Needs further testing and perhaps merged with other recent SDL BWindow patches.

This commit is contained in:
Scott McCreary
2009-10-01 08:10:44 +00:00
parent 5a4ff2a3b1
commit 40061d5cec

View File

@@ -0,0 +1,37 @@
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 ) {