| Summary: | Failure to select correct fullscreen mode: 1.2.13 & SVN 1.3 | ||
|---|---|---|---|
| Product: | SDL | Reporter: | kty |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | scottmc2 |
| Version: | HG 1.2 | ||
| Hardware: | Other | ||
| OS: | BeOS | ||
kty@lavabit.com's patch has been added into another bwindow related patch by Bruno Albuquerque (bga) and checked into HaikuPorts svn: http://ports.haiku-files.org/browser/haikuports/trunk/media-libs/libsdl/sdl-1.2-svn-4901-haiku.diff There's a link at the bottom of that page to get the plain text version for applying. This is the same patch I emailed a few days ago, just following up here in case it got lost in the email. There's still some quirkiness to the saving and restoring of the previous video mode, but this is a step in the right direction. -scottmc This is in for the next release, thanks! |
The stable release of SDL 1.2.13 for BeOS/Haiku has a bug in BE_FindClosestFSMode that causes it to sometimes not select the best mode when going fullscreen. There are in fact two bugs in the implementation but I will not go into specifics because there is already a patch for it in the developer SVN 1.3. However I am still reporting it because I believe the following code is a better patch for the issue. The current implementation on SVN only works if it is able to find an exact match for the requested mode. However, by scanning from lowest-to-highest resolution instead of highest-to-lowest, one can find the best mode at all times: (this code is intended to go in /src/video/bwindow/SDL_sysvideo.cc, around line 360 for stable 1.2.13 and line 372 for the latest pull of SVN 1.3). <--snip--> modes = SDL_modelist[((bpp+7)/8)-1]; // 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; <--snip-->