diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-10-23 11:13:53 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-10-26 12:28:03 +0200 |
commit | f0f2496a25cedc0cf9076491ccaccab0647e16f5 (patch) | |
tree | 98ad9ea81011d2e9120d4880dc6e2822b48ba781 /src/client.cpp | |
parent | c6bb66d3bb2d6ee29bd115ccad281c70d7d24177 (diff) | |
download | mana-f0f2496a25cedc0cf9076491ccaccab0647e16f5.tar.gz mana-f0f2496a25cedc0cf9076491ccaccab0647e16f5.tar.bz2 mana-f0f2496a25cedc0cf9076491ccaccab0647e16f5.tar.xz mana-f0f2496a25cedc0cf9076491ccaccab0647e16f5.zip |
Fixed FPS limit being enabled by default
There were some inconsistencies between the values set up in
`Client::initConfiguration` and those in `getConfigDefaults`. These
duplicates have now been removed.
For some of these settings the code getting the values had to be
adjusted to use getBoolValue, to actually rely on the provided default
instead of one provided as a parameter.
Diffstat (limited to 'src/client.cpp')
-rw-r--r-- | src/client.cpp | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/src/client.cpp b/src/client.cpp index f428aaec..fba54c81 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -87,7 +87,7 @@ #include <sys/stat.h> #include <cassert> -// TODO: Get rid fo these globals +// TODO: Get rid of these globals std::string errorMessage; LoginData loginData; @@ -262,10 +262,10 @@ Client::Client(const Options &options): // Add the local data directory to PhysicsFS search path resman->addToSearchPath(mLocalDataDir, false); - bool useOpenGL = !mOptions.noOpenGL && (config.getValue("opengl", 0) == 1); + bool useOpenGL = !mOptions.noOpenGL && config.getBoolValue("opengl"); // Set up the transparency option for low CPU when not using OpenGL. - if (!useOpenGL && (config.getValue("disableTransparency", 0) == 1)) + if (!useOpenGL && config.getBoolValue("disableTransparency")) Image::SDLdisableTransparency(); VideoSettings videoSettings; @@ -394,10 +394,7 @@ Client::Client(const Options &options): listen(Event::ConfigChannel); - //TODO: fix having to fake a option changed event - Event fakeevent(Event::ConfigOptionChanged); - fakeevent.setString("option", "fpslimit"); - event(Event::ConfigChannel, fakeevent); + mFpsLimit = config.getIntValue("fpslimit"); // Initialize PlayerInfo PlayerInfo::init(); @@ -1105,20 +1102,8 @@ void Client::initHomeDir() void Client::initConfiguration() { // Fill configuration with defaults - config.setValue("opengl", false); - config.setValue("screen", false); - config.setValue("sound", true); - config.setValue("guialpha", 0.8f); - config.setValue("remember", true); - config.setValue("sfxVolume", 100); - config.setValue("musicVolume", 60); - config.setValue("fpslimit", 60); - std::string defaultUpdateHost = branding.getValue("defaultUpdateHost", ""); - config.setValue("updatehost", defaultUpdateHost); - config.setValue("customcursor", true); - config.setValue("useScreenshotDirectorySuffix", true); - config.setValue("ChatLogLength", 128); - config.setValue("disableTransparency", false); + config.setValue("updatehost", branding.getValue("defaultUpdateHost", + std::string())); // Checking if the configuration file exists... otherwise create it with // default options. |