Fixed bug where using -center and -fullscreen at the same time didn't work

correctly.  The emulator would start fullscreen, but if switched to
windowed mode, it wouldn't be centered.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@37 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2002-01-19 02:17:19 +00:00
parent 72d209a88d
commit cd9f9a18cb
1 changed files with 17 additions and 7 deletions

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: mainSDL.cxx,v 1.4 2002-01-16 15:09:21 stephena Exp $
// $Id: mainSDL.cxx,v 1.5 2002-01-19 02:17:19 stephena Exp $
//============================================================================
#include <assert.h>
@ -314,15 +314,25 @@ bool setupDisplay()
}
}
// Center the window if centering is selected and not fullscreen
if(theCenterWindowFlag && !theUseFullScreenFlag)
centerWindow();
// Make sure that theUseFullScreenFlag sets up fullscreen mode correctly
if(theUseFullScreenFlag)
{
grabMouse(true);
showCursor(false);
isFullscreen = true;
}
else
{
// Keep mouse in game window if grabmouse is selected
grabMouse(theGrabMouseFlag);
// Show or hide the cursor depending on the 'hidecursor' argument
showCursor(!theHideCursorFlag);
}
// Center the window if centering is selected and not fullscreen
if(theCenterWindowFlag && !theUseFullScreenFlag)
centerWindow();
#ifdef IMLIB2_SNAPSHOT
SDL_SysWMinfo info;