diff --git a/docs/graphics/options_video.png b/docs/graphics/options_video.png
index 0adc7adce..4b121b0af 100644
Binary files a/docs/graphics/options_video.png and b/docs/graphics/options_video.png differ
diff --git a/docs/index.html b/docs/index.html
index 76fe3ce96..fe080608d 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -684,8 +684,9 @@
- -fullscreen <1|0> |
- Play the game in fullscreen mode. |
+ -fullscreen <1|0|-1> |
+ Play the game in fullscreen mode (1 or 0), or completely disable
+ fullscreen mode (-1). |
diff --git a/src/emucore/FrameBuffer.cxx b/src/emucore/FrameBuffer.cxx
index 1911a30e7..9303fce1a 100644
--- a/src/emucore/FrameBuffer.cxx
+++ b/src/emucore/FrameBuffer.cxx
@@ -92,7 +92,7 @@ bool FrameBuffer::initialize(const string& title, uInt32 width, uInt32 height)
// This must be done before any modes are initialized
mySDLFlags = 0;
#ifdef WINDOWED_SUPPORT
- if(myOSystem->settings().getBool("fullscreen")) mySDLFlags = SDL_FULLSCREEN;
+ if(myOSystem->settings().getString("fullscreen") == "1") mySDLFlags = SDL_FULLSCREEN;
#endif
// Set the available video modes for this framebuffer
@@ -121,7 +121,10 @@ bool FrameBuffer::initialize(const string& title, uInt32 width, uInt32 height)
myScreenRect.setHeight(mode.screen_h);
// Did we get the requested fullscreen state?
- myOSystem->settings().setBool("fullscreen", fullScreen());
+ const string& fullscreen = myOSystem->settings().getString("fullscreen");
+ if(fullscreen != "-1")
+ myOSystem->settings().setString("fullscreen", fullScreen() ? "1" : "0");
+ setCursorState();
}
}
else
@@ -609,7 +612,8 @@ void FrameBuffer::toggleFullscreen()
void FrameBuffer::setFullscreen(bool enable)
{
#ifdef WINDOWED_SUPPORT
- if(enable)
+ // '-1' means fullscreen mode is completely disabled
+ if(enable && myOSystem->settings().getString("fullscreen") != "-1" )
mySDLFlags |= SDL_FULLSCREEN;
else
mySDLFlags &= ~SDL_FULLSCREEN;
@@ -654,11 +658,13 @@ bool FrameBuffer::changeVidMode(int direction)
myScreenRect.setHeight(vidmode.screen_h);
// Did we get the requested fullscreen state?
- myOSystem->settings().setBool("fullscreen", fullScreen());
+ const string& fullscreen = myOSystem->settings().getString("fullscreen");
+ if(fullscreen != "-1")
+ myOSystem->settings().setString("fullscreen", fullScreen() ? "1" : "0");
+ setCursorState();
if(!inUIMode)
{
- setCursorState();
if(direction != 0) // only show message when mode actually changes
showMessage(vidmode.gfxmode.description);
}
@@ -701,6 +707,7 @@ void FrameBuffer::setCursorState()
break;
default:
showCursor(true);
+ break;
}
}
diff --git a/src/emucore/Settings.cxx b/src/emucore/Settings.cxx
index 9cead5cb9..d90c7585a 100644
--- a/src/emucore/Settings.cxx
+++ b/src/emucore/Settings.cxx
@@ -50,7 +50,7 @@ Settings::Settings(OSystem* osystem)
// Framebuffer-related options
setInternal("tia_filter", "zoom2x");
- setInternal("fullscreen", "false");
+ setInternal("fullscreen", "0");
setInternal("fullres", "auto");
setInternal("center", "true");
setInternal("grabmouse", "false");
@@ -329,7 +329,7 @@ void Settings::usage()
<< endl
#endif
<< " -tia_filter Use the specified filter in emulation mode\n"
- << " -fullscreen <1|0> Play the game in fullscreen mode\n"
+ << " -fullscreen <1|0|-1> Use fullscreen mode (1 or 0), or disable switching to fullscreen entirely\n"
<< " -fullres The resolution to use in fullscreen mode\n"
<< " -center <1|0> Centers game window (if possible)\n"
<< " -grabmouse <1|0> Keeps the mouse in the game window\n"
diff --git a/src/gui/VideoDialog.cxx b/src/gui/VideoDialog.cxx
index 37b7c265a..7e2e9f68c 100644
--- a/src/gui/VideoDialog.cxx
+++ b/src/gui/VideoDialog.cxx
@@ -56,7 +56,7 @@ VideoDialog::VideoDialog(OSystem* osystem, DialogContainer* parent,
StringMap items;
// Set real dimensions
- _w = 49 * fontWidth + 10;
+ _w = 52 * fontWidth + 10;
_h = 15 * (lineHeight + 4) + 10;
// The tab widget
@@ -170,19 +170,24 @@ VideoDialog::VideoDialog(OSystem* osystem, DialogContainer* parent,
// Add message concerning usage
ypos += (lineHeight + 4) * 2;
- lwidth = font.getStringWidth("(*) Requires application restart");
- new StaticTextWidget(myTab, font, 10, ypos, lwidth, fontHeight,
- "(*) Requires application restart",
- kTextAlignLeft);
+ new StaticTextWidget(myTab, font, 10, ypos,
+ font.getStringWidth("(*) Requires application restart"), fontHeight,
+ "(*) Requires application restart", kTextAlignLeft);
// Move over to the next column
xpos += myNAspectRatioSlider->getWidth() + myNAspectRatioLabel->getWidth() + 10;
ypos = 10;
// Fullscreen
- myFullscreenCheckbox = new CheckboxWidget(myTab, font, xpos, ypos,
- "Fullscreen mode", kFullScrChanged);
- wid.push_back(myFullscreenCheckbox);
+ items.clear();
+ items.push_back("On", "1");
+ items.push_back("Off", "0");
+ items.push_back("Disabled", "-1");
+ lwidth = font.getStringWidth("Fullscreen: ");
+ myFullscreenPopup =
+ new PopUpWidget(myTab, font, xpos, ypos, pwidth, lineHeight,
+ items, "Fullscreen: ", lwidth, kFullScrChanged);
+ wid.push_back(myFullscreenPopup);
ypos += lineHeight + 4;
// PAL color-loss effect
@@ -391,9 +396,9 @@ void VideoDialog::loadConfig()
instance().settings().getString("framerate"));
// Fullscreen
- bool b = instance().settings().getBool("fullscreen");
- myFullscreenCheckbox->setState(b);
- handleFullscreenChange(b);
+ const string& fullscreen = instance().settings().getString("fullscreen");
+ myFullscreenPopup->setSelected(fullscreen, "0");
+ handleFullscreenChange(fullscreen == "1");
// PAL color-loss effect
myColorLossCheckbox->setState(instance().settings().getBool("colorloss"));
@@ -488,7 +493,7 @@ void VideoDialog::saveConfig()
}
// Fullscreen
- instance().settings().setBool("fullscreen", myFullscreenCheckbox->getState());
+ instance().settings().setString("fullscreen", myFullscreenPopup->getSelectedTag());
// PAL color-loss effect
instance().settings().setBool("colorloss", myColorLossCheckbox->getState());
@@ -542,7 +547,7 @@ void VideoDialog::setDefaults()
myFrameRateSlider->setValue(0);
myFrameRateLabel->setLabel("0");
- myFullscreenCheckbox->setState(false);
+ myFullscreenPopup->setSelected("0", "");
myColorLossCheckbox->setState(false);
myGLStretchCheckbox->setState(false);
myUseVSyncCheckbox->setState(true);
@@ -601,7 +606,7 @@ void VideoDialog::handleCommand(CommandSender* sender, int cmd,
break;
case kFullScrChanged:
- handleFullscreenChange(myFullscreenCheckbox->getState());
+ handleFullscreenChange(myFullscreenPopup->getSelectedTag() == "1");
break;
default:
diff --git a/src/gui/VideoDialog.hxx b/src/gui/VideoDialog.hxx
index 140766182..050b308af 100644
--- a/src/gui/VideoDialog.hxx
+++ b/src/gui/VideoDialog.hxx
@@ -67,7 +67,7 @@ class VideoDialog : public Dialog
SliderWidget* myFrameRateSlider;
StaticTextWidget* myFrameRateLabel;
- CheckboxWidget* myFullscreenCheckbox;
+ PopUpWidget* myFullscreenPopup;
CheckboxWidget* myColorLossCheckbox;
CheckboxWidget* myGLStretchCheckbox;
CheckboxWidget* myUseVSyncCheckbox;