Look for an exact match first when setting a video mode on BeOS.
Fixes Bugzilla #370. --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402246
This commit is contained in:
parent
d029ec6ee5
commit
2979ca03a6
1 changed files with 16 additions and 5 deletions
|
@ -370,12 +370,23 @@ extern "C"
|
||||||
(current.timing.h_total * current.timing.v_total);
|
(current.timing.h_total * current.timing.v_total);
|
||||||
|
|
||||||
modes = SDL_modelist[((bpp + 7) / 8) - 1];
|
modes = SDL_modelist[((bpp + 7) / 8) - 1];
|
||||||
for (i = 0; modes[i] && (modes[i]->w > width) &&
|
|
||||||
(modes[i]->h > height); ++i) {
|
bool exactmatch = false;
|
||||||
/* still looking */
|
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)) {
|
if (!exactmatch) {
|
||||||
--i; /* We went too far */
|
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;
|
width = modes[i]->w;
|
||||||
height = modes[i]->h;
|
height = modes[i]->h;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue