Add mouse_sensitivity option
authorEsteban I. Ruiz Moreno <exio4.com@gmail.com>
Sun, 14 Apr 2013 17:53:00 +0000 (14:53 -0300)
committerKahrl <kahrl@gmx.net>
Mon, 13 May 2013 15:39:16 +0000 (17:39 +0200)
minetest.conf.example
src/defaultsettings.cpp
src/game.cpp

index 36ef31459411ac11b1294024df568cd31e3cc973..7d56f99d80b77bc9762ab6c674c756307f18a166 100644 (file)
 #crosshair_color = (255,255,255)
 # Cross alpha (opaqueness, between 0 and 255)
 #crosshair_alpha = 255
+# Sensitivity multiplier
+#mouse_sensitivity = 0.2
 # Sound settings
 #enable_sound = true
 #sound_volume = 0.7
index 09ec456971cd9cd3b0b6387b5950da1397508b57..f270a47aa4d175d5b36818a70313a820294065c2 100644 (file)
@@ -117,6 +117,7 @@ void set_default_settings(Settings *settings)
        settings->setDefault("selectionbox_color", "(0,0,0)");
        settings->setDefault("crosshair_color", "(255,255,255)");
        settings->setDefault("crosshair_alpha", "255");
+       settings->setDefault("mouse_sensitivity", "0.2");
        settings->setDefault("enable_sound", "true");
        settings->setDefault("sound_volume", "0.8");
        settings->setDefault("desynchronize_mapblock_texture_animation", "true");
index 23e794de2c27870fab713fc25a8763bcfd423025..f63a4a400228d1cb78e99704570924a1725d7e23 100644 (file)
@@ -2061,7 +2061,8 @@ void the_game(
                                if(input->isKeyDown(irr::KEY_RIGHT))
                                        dx += dtime * keyspeed;*/
                                
-                               float d = 0.2;
+                               float d = g_settings->getFloat("mouse_sensitivity");
+                               d = rangelim(d, 0.01, 100.0);
                                camera_yaw -= dx*d;
                                camera_pitch += dy*d;
                                if(camera_pitch < -89.5) camera_pitch = -89.5;