summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-12-17 20:57:16 +0300
committerAndrei Karas <akaras@inbox.ru>2012-12-17 20:57:16 +0300
commitb0d439c392d9ef3ccaf29eca70e16bd3618c7bb0 (patch)
tree5d1e7a8faf9f8ca3537a1b3658a5aacad518774e /src
parentd220dec50c6fb9218092e8caab87fcee6ef11e71 (diff)
downloadmv-b0d439c392d9ef3ccaf29eca70e16bd3618c7bb0.tar.gz
mv-b0d439c392d9ef3ccaf29eca70e16bd3618c7bb0.tar.bz2
mv-b0d439c392d9ef3ccaf29eca70e16bd3618c7bb0.tar.xz
mv-b0d439c392d9ef3ccaf29eca70e16bd3618c7bb0.zip
Add option to disable gamma correction.
Gamma correction disable by default for MacOSX.
Diffstat (limited to 'src')
-rw-r--r--src/client.cpp10
-rw-r--r--src/defaults.cpp5
-rw-r--r--src/gui/setup_visual.cpp9
3 files changed, 20 insertions, 4 deletions
diff --git a/src/client.cpp b/src/client.cpp
index fe7d8f987..0f02375a1 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -663,6 +663,7 @@ void Client::gameInit()
config.addListener("fpslimit", this);
config.addListener("guialpha", this);
config.addListener("gamma", this);
+ config.addListener("enableGamma", this);
config.addListener("particleEmitterSkip", this);
config.addListener("vsync", this);
config.addListener("repeateDelay", this);
@@ -1682,7 +1683,7 @@ void Client::optionChanged(const std::string &name)
setGuiAlpha(config.getFloatValue("guialpha"));
ImageHelper::setEnableAlpha(config.getFloatValue("guialpha") != 1.0f);
}
- else if (name == "gamma")
+ else if (name == "gamma" || name == "enableGamma")
{
applyGamma();
}
@@ -2711,8 +2712,11 @@ void Client::applyGrabMode()
void Client::applyGamma()
{
- const float val = config.getFloatValue("gamma");
- SDL_SetGamma(val, val, val);
+ if (config.getFloatValue("enableGamma"))
+ {
+ const float val = config.getFloatValue("gamma");
+ SDL_SetGamma(val, val, val);
+ }
}
void Client::applyVSync()
diff --git a/src/defaults.cpp b/src/defaults.cpp
index bd51110ce..57b87dafe 100644
--- a/src/defaults.cpp
+++ b/src/defaults.cpp
@@ -284,6 +284,11 @@ DefaultsData* getConfigDefaults()
AddDEF("protectChatFocus", true);
AddDEF("screenButtonsSize", 1);
AddDEF("screenJoystickSize", 1);
+#if defined(__APPLE__)
+ AddDEF("enableGamma", false);
+#else
+ AddDEF("enableGamma", true);
+#endif
return configData;
}
diff --git a/src/gui/setup_visual.cpp b/src/gui/setup_visual.cpp
index e1ef59e06..835c3640f 100644
--- a/src/gui/setup_visual.cpp
+++ b/src/gui/setup_visual.cpp
@@ -97,11 +97,18 @@ Setup_Visual::Setup_Visual(const Widget2 *const widget) :
new SetupItemSlider2(_("Particle physics"), "", "particleFastPhysics",
this, "particleFastPhysicsEvent", 0, 2, mParticleTypeList);
- new SetupItemLabel(_("Other"), "", this);
+
+ new SetupItemLabel(_("Gamma"), "", this);
+
+ new SetupItemCheckBox(_("Enable gamma control"),
+ "", "enableGamma", this, "enableGammaEvent");
new SetupItemSlider(_("Gamma"), "", "gamma",
this, "gammeEvent", 1, 20, 350, true);
+
+ new SetupItemLabel(_("Other"), "", this);
+
mVSyncList->push_back(_("default"));
mVSyncList->push_back(_("off"));
mVSyncList->push_back(_("on"));