We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 370 - fullscreen support on beos isn't finding the closest mode
Summary: fullscreen support on beos isn't finding the closest mode
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 1.2.11
Hardware: Other BeOS
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-07 18:42 UTC by Chris Roberts
Modified: 2006-12-07 19:57 UTC (History)
0 users

See Also:


Attachments
applies the fixes listed in the comments (1.10 KB, patch)
2006-12-07 18:43 UTC, Chris Roberts
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Roberts 2006-12-07 18:42:30 UTC
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.
Comment 1 Chris Roberts 2006-12-07 18:43:15 UTC
Created attachment 184 [details]
applies the fixes listed in the comments
Comment 2 Ryan C. Gordon 2006-12-07 19:46:07 UTC
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.

Comment 3 Chris Roberts 2006-12-07 19:57:13 UTC
Damn, that was fast. You're setting the bar pretty high for other projects ;)

Thanks,
Chris