mirror of
https://github.com/yawut/SDL.git
synced 2026-08-22 08:45:31 -05:00
Look for an exact match first when setting a video mode on BeOS.
Fixes Bugzilla #370.
This commit is contained in:
@@ -370,12 +370,23 @@ extern "C"
|
||||
(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 */
|
||||
|
||||
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 (!modes[i] || (modes[i]->w < width) || (modes[i]->h < height)) {
|
||||
--i; /* We went too far */
|
||||
if (!exactmatch) {
|
||||
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 < height)) {
|
||||
--i; /* We went too far */
|
||||
}
|
||||
}
|
||||
width = modes[i]->w;
|
||||
height = modes[i]->h;
|
||||
|
||||
Reference in New Issue
Block a user