Commit 2979ca03 authored by Ryan C. Gordon's avatar Ryan C. Gordon

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
parent d029ec6e
......@@ -370,6 +370,16 @@ extern "C"
(current.timing.h_total * current.timing.v_total);
modes = SDL_modelist[((bpp + 7) / 8) - 1];
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 */
......@@ -377,6 +387,7 @@ extern "C"
if (!modes[i] || (modes[i]->w < width) || (modes[i]->h < height)) {
--i; /* We went too far */
}
}
width = modes[i]->w;
height = modes[i]->h;
bscreen.GetModeList(&dmodes, &nmodes);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment