summaryrefslogtreecommitdiff
path: root/src/gui/setup_video.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-01-05 00:39:57 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-01-05 00:40:42 +0100
commit550a02997572b5d090b436b7c05d19c1823556a9 (patch)
tree65b6bf872711d67d1ed2b7e530bd47cb88a155af /src/gui/setup_video.cpp
parent8b6bfeb0a70d4f97cc2d20ce04fc240b65082cf1 (diff)
parent91387e410c9f9ea16c5b41bd1cc576cbd85cf835 (diff)
downloadmana-550a02997572b5d090b436b7c05d19c1823556a9.tar.gz
mana-550a02997572b5d090b436b7c05d19c1823556a9.tar.bz2
mana-550a02997572b5d090b436b7c05d19c1823556a9.tar.xz
mana-550a02997572b5d090b436b7c05d19c1823556a9.zip
Merged with 'master'
Diffstat (limited to 'src/gui/setup_video.cpp')
-rw-r--r--src/gui/setup_video.cpp29
1 files changed, 20 insertions, 9 deletions
diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp
index 51cee8e3..bac342a0 100644
--- a/src/gui/setup_video.cpp
+++ b/src/gui/setup_video.cpp
@@ -106,8 +106,8 @@ Setup_Video::Setup_Video():
mCustomCursorEnabled(config.getValue("customcursor", 1)),
mVisibleNamesEnabled(config.getValue("visiblenames", 1)),
mOpacity(config.getValue("guialpha", 0.8)),
- mFps((int)config.getValue("fpslimit", 60)),
- mModeListModel(new ModeListModel()),
+ mFps((int) config.getValue("fpslimit", 0)),
+ mModeListModel(new ModeListModel),
mModeList(new ListBox(mModeListModel)),
mFsCheckBox(new CheckBox(_("Full screen"), mFullScreenEnabled)),
mOpenGLCheckBox(new CheckBox(_("OpenGL"), mOpenGLEnabled)),
@@ -116,13 +116,13 @@ Setup_Video::Setup_Video():
mAlphaSlider(new Slider(0.2, 1.0)),
mFpsCheckBox(new CheckBox(_("FPS Limit:"))),
mFpsSlider(new Slider(10, 200)),
- mFpsField(new TextField()),
- mOriginalScrollLaziness((int) config.getValue("ScrollLaziness", 32)),
+ mFpsField(new TextField),
+ mOriginalScrollLaziness((int) config.getValue("ScrollLaziness", 16)),
mScrollLazinessSlider(new Slider(1, 64)),
- mScrollLazinessField(new TextField()),
- mOriginalScrollRadius((int) config.getValue("ScrollRadius", 32)),
+ mScrollLazinessField(new TextField),
+ mOriginalScrollRadius((int) config.getValue("ScrollRadius", 0)),
mScrollRadiusSlider(new Slider(0, 128)),
- mScrollRadiusField(new TextField()),
+ mScrollRadiusField(new TextField),
mOverlayDetail((int) config.getValue("OverlayDetail", 2)),
mOverlayDetailSlider(new Slider(0, 2)),
mOverlayDetailField(new gcn::Label(""))
@@ -189,7 +189,7 @@ Setup_Video::Setup_Video():
mScrollRadiusSlider->setDimension(gcn::Rectangle(10, 140, 75, 10));
gcn::Label *scrollRadiusLabel = new gcn::Label(_("Scroll radius"));
scrollRadiusLabel->setPosition(90, 140);
- mScrollRadiusField->setPosition(180, 140);
+ mScrollRadiusField->setPosition(mFpsField->getX(), 140);
mScrollRadiusField->setWidth(30);
mScrollRadiusField->setText(toString(mOriginalScrollRadius));
mScrollRadiusSlider->setValue(mOriginalScrollRadius);
@@ -197,7 +197,7 @@ Setup_Video::Setup_Video():
mScrollLazinessSlider->setDimension(gcn::Rectangle(10, 160, 75, 10));
gcn::Label *scrollLazinessLabel = new gcn::Label(_("Scroll laziness"));
scrollLazinessLabel->setPosition(90, 160);
- mScrollLazinessField->setPosition(180, 160);
+ mScrollLazinessField->setPosition(mFpsField->getX(), 160);
mScrollLazinessField->setWidth(30);
mScrollLazinessField->setText(toString(mOriginalScrollLaziness));
mScrollLazinessSlider->setValue(mOriginalScrollLaziness);
@@ -253,9 +253,18 @@ void Setup_Video::apply()
bool fullscreen = mFsCheckBox->isSelected();
if (fullscreen != (config.getValue("screen", 0) == 1))
{
+ /* The OpenGL test is only necessary on Windows, since switching
+ * to/from full screen works fine on Linux. On Windows we'd have to
+ * reinitialize the OpenGL state and reload all textures.
+ *
+ * See http://libsdl.org/cgi/docwiki.cgi/SDL_SetVideoMode
+ */
+
+#ifdef WIN32
// checks for opengl usage
if (!(config.getValue("opengl", 0) == 1))
{
+#endif
if (!graphics->setFullscreen(fullscreen))
{
fullscreen = !fullscreen;
@@ -269,10 +278,12 @@ void Setup_Video::apply()
logger->error(error.str());
}
}
+#ifdef WIN32
} else {
new OkDialog(_("Switching to full screen"),
_("Restart needed for changes to take effect."));
}
+#endif
config.setValue("screen", fullscreen ? 1 : 0);
}