Constrain the window's aspect ratio

This commit is contained in:
Jonathan Adamczewski 2014-03-23 01:20:54 -07:00
parent 740a7ba516
commit c98c31f33b

View File

@ -101,7 +101,8 @@ int main(int /*argc*/, char** /*argv*/)
} }
else else
{ {
width = vi->current_w - 20; width = rcMin(vi->current_w, (int)(vi->current_h * 16.0 / 9.0));
width = width - 80;
height = vi->current_h - 80; height = vi->current_h - 80;
screen = SDL_SetVideoMode(width, height, 0, SDL_OPENGL); screen = SDL_SetVideoMode(width, height, 0, SDL_OPENGL);
} }