| Summary: | fullscreen support on beos isn't finding the closest mode | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Chris Roberts <cpr420> |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | 1.2.11 | ||
| Hardware: | Other | ||
| OS: | BeOS | ||
| Attachments: | applies the fixes listed in the comments | ||
Created attachment 184 [details]
applies the fixes listed in the comments
I've updated your patch for the latest in source control and applied it. Part 1 is fixed in Subversion revision #2924, and Part 2 is fixed in revision #2925. Thanks! --ryan. Damn, that was fast. You're setting the bar pretty high for other projects ;) Thanks, Chris |
There are two problems in BE_FindClosestFSMode. 1) in one of the if statements height is being compared against width if ( ! modes[i] || (modes[i]->w < width) || (modes[i]->h < width) ) { should be: if ( ! modes[i] || (modes[i]->w < width) || (modes[i]->h < height) ) { 2) the mode list needs to be looped through to find an exact match before proceeding to search for the next closest match. for ( i=0; modes[i] && (modes[i]->w > width) && (modes[i]->h > height); ++i ) { /* still looking */ } should be: bool exactmatch = false; for ( uint32 x = 0; modes[x]; x++ ) { if (modes[x]->w == width && modes[x]->h == height) { exactmatch = true; i = x; break; } } if ( ! exactmatch ) { for ( i=0; modes[i] && (modes[i]->w > width) && (modes[i]->h > height); ++i ) { /* still looking */ } } There may be a better(more elegant) solution, but, this solves the problems.