summaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-02-21 03:33:54 +0300
committerAndrei Karas <akaras@inbox.ru>2012-02-21 03:33:54 +0300
commite4dabfe2b75a20378bdb1bf32b53249b5d55740b (patch)
tree8c14cc39a4f0a5b730d377a1d89b0304c9b8122d /src/client.cpp
parent2eef004b8b70861fd377ad50393a9a0ccbbbc152 (diff)
downloadmv-e4dabfe2b75a20378bdb1bf32b53249b5d55740b.tar.gz
mv-e4dabfe2b75a20378bdb1bf32b53249b5d55740b.tar.bz2
mv-e4dabfe2b75a20378bdb1bf32b53249b5d55740b.tar.xz
mv-e4dabfe2b75a20378bdb1bf32b53249b5d55740b.zip
Bit cleanup visual settings page.
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 949dbacd2..d0c573e13 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -563,6 +563,7 @@ void Client::gameInit()
}
applyGrabMode();
+ applyGamma();
// Initialize for drawing
mainGraphics->_beginDraw();
@@ -665,6 +666,8 @@ void Client::gameInit()
setFramerate(fpsLimit);
config.addListener("fpslimit", this);
config.addListener("guialpha", this);
+ config.addListener("gamma", this);
+ config.addListener("particleEmitterSkip", this);
setGuiAlpha(config.getFloatValue("guialpha"));
optionChanged("fpslimit");
@@ -704,6 +707,8 @@ void Client::gameClear()
logger->log1("Quitting1");
config.removeListener("fpslimit", this);
config.removeListener("guialpha", this);
+ config.removeListener("gamma", this);
+ config.removeListener("particleEmitterSkip", this);
SDL_RemoveTimer(mLogicCounterId);
SDL_RemoveTimer(mSecondsCounterId);
@@ -1492,6 +1497,15 @@ void Client::optionChanged(const std::string &name)
else if (name == "guialpha")
{
setGuiAlpha(config.getFloatValue("guialpha"));
+ Image::setEnableAlpha(config.getFloatValue("guialpha") != 1.0f);
+ }
+ else if (name == "gamma")
+ {
+ applyGamma();
+ }
+ else if (name == "particleEmitterSkip")
+ {
+ Particle::emitterSkip = config.getIntValue("particleEmitterSkip") + 1;
}
}
@@ -2437,3 +2451,9 @@ void Client::applyGrabMode()
SDL_WM_GrabInput(config.getBoolValue("grabinput")
? SDL_GRAB_ON : SDL_GRAB_OFF);
}
+
+void Client::applyGamma()
+{
+ float val = config.getFloatValue("gamma");
+ SDL_SetGamma(val, val, val);
+} \ No newline at end of file