mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-29 11:38:52 +02:00
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:
37
media-libs/libsdl/sdl-1.2.13-haiku-bwindow-sysvideo.diff
Normal file
37
media-libs/libsdl/sdl-1.2.13-haiku-bwindow-sysvideo.diff
Normal 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 ) {
|
||||||
Reference in New Issue
Block a user