]> git.jsancho.org Git - lugaru.git/blobdiff - Source/User/Settings.cpp
Refactored ugly ifs
[lugaru.git] / Source / User / Settings.cpp
index 9948e636c6ee40ae327da93d4573a22d69689f24..b1970d30b792041e9c3991ff844e550cd5102068 100644 (file)
@@ -18,10 +18,11 @@ You should have received a copy of the GNU General Public License
 along with Lugaru.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include "Game.h"
-#include "User/Settings.h"
-#include "Utils/Folders.h"
-#include "Utils/Input.h"
+#include "User/Settings.hpp"
+
+#include "Game.hpp"
+#include "Utils/Folders.hpp"
+#include "Utils/Input.hpp"
 
 using namespace Game;
 
@@ -35,7 +36,7 @@ void DefaultSettings()
     fullscreen = 0;
     floatjump = 0;
     autoslomo = 1;
-    decals = 1;
+    decalstoggle = true;
     invertmouse = 0;
     bloodtoggle = 0;
     foliage = 1;
@@ -61,7 +62,7 @@ void DefaultSettings()
     rightkey = SDL_SCANCODE_D;
     drawkey = SDL_SCANCODE_E;
     throwkey = SDL_SCANCODE_Q;
-    attackkey = MOUSEBUTTON1;
+    attackkey = MOUSEBUTTON_LEFT;
     consolekey = SDL_SCANCODE_GRAVE;
 
     newdetail = detail;
@@ -116,7 +117,7 @@ void SaveSettings()
     opstream << "\nTrilinear:\n";
     opstream << trilinear;
     opstream << "\nDecals(shadows,blood puddles,etc):\n";
-    opstream << decals;
+    opstream << decalstoggle;
     opstream << "\nInvert mouse:\n";
     opstream << invertmouse;
     opstream << "\nGamespeed:\n";
@@ -215,7 +216,7 @@ bool LoadSettings()
             ipstream >> mousejump;
         } else if ( !strncmp(setting, "Ambient sound", 13) ) {
             ipstream >> ambientsound;
-        } else if ( !strncmp(setting, "Blood ", 6) ) {
+        } else if ( !strncmp(setting, "Blood", 5) ) {
             ipstream >> bloodtoggle;
         } else if ( !strncmp(setting, "Auto slomo", 10) ) {
             ipstream >> autoslomo;
@@ -226,7 +227,7 @@ bool LoadSettings()
         } else if ( !strncmp(setting, "Trilinear", 9) ) {
             ipstream >> trilinear;
         } else if ( !strncmp(setting, "Decals", 6) ) {
-            ipstream >> decals;
+            ipstream >> decalstoggle;
         } else if ( !strncmp(setting, "Invert mouse", 12) ) {
             ipstream >> invertmouse;
         } else if ( !strncmp(setting, "Gamespeed", 9) ) {
@@ -240,7 +241,7 @@ bool LoadSettings()
             ipstream >> damageeffects;
         } else if ( !strncmp(setting, "Text", 4) ) {
             ipstream >> texttoggle;
-        } else if ( !strncmp(setting, "Devtools", 5) ) {
+        } else if ( !strncmp(setting, "Devtools", 8) ) {
             ipstream >> devtools;
         } else if ( !strncmp(setting, "Show Points", 11) ) {
             ipstream >> showpoints;