From cd9f9a18cbec67366aa49cf6720cb139cdf3376c Mon Sep 17 00:00:00 2001 From: stephena Date: Sat, 19 Jan 2002 02:17:19 +0000 Subject: [PATCH] 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 --- stella/src/ui/sdl/mainSDL.cxx | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/stella/src/ui/sdl/mainSDL.cxx b/stella/src/ui/sdl/mainSDL.cxx index 26dff0817..fd9d246ef 100644 --- a/stella/src/ui/sdl/mainSDL.cxx +++ b/stella/src/ui/sdl/mainSDL.cxx @@ -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 @@ -314,16 +314,26 @@ bool setupDisplay() } } + // 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(); - // Keep mouse in game window if grabmouse is selected - grabMouse(theGrabMouseFlag); - - // Show or hide the cursor depending on the 'hidecursor' argument - showCursor(!theHideCursorFlag); - #ifdef IMLIB2_SNAPSHOT SDL_SysWMinfo info; SDL_VERSION(&info.version);