Fixed bug in app window centering, recently addressed in a 3.2.2 release.

git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2133 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2010-09-17 19:19:25 +00:00
parent 057f6ff495
commit cb6d2cf602
1 changed files with 5 additions and 4 deletions

View File

@ -132,10 +132,11 @@ FBInitStatus FrameBuffer::initialize(const string& title, uInt32 width, uInt32 h
// Attempt to center the application window in non-fullscreen mode
if(!fullScreen() && myOSystem->settings().getBool("center"))
{
myOSystem->setAppWindowPos(
(myOSystem->desktopWidth() - mode.screen_w) / 2,
(myOSystem->desktopHeight() - mode.screen_h) / 2,
mode.screen_w, mode.screen_h);
int x = mode.screen_w >= myOSystem->desktopWidth() ? 0 :
((myOSystem->desktopWidth() - mode.screen_w) >> 1);
int y = mode.screen_h >= myOSystem->desktopHeight() ? 0 :
((myOSystem->desktopHeight() - mode.screen_h) >> 1);
myOSystem->setAppWindowPos(x, y, mode.screen_w, mode.screen_h);
}
myImageRect.setWidth(mode.image_w);