summaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp10
1 files changed, 7 insertions, 3 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()