aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEsteban I. Ruiz Moreno <exio4.com@gmail.com>2013-04-14 14:53:00 -0300
committerKahrl <kahrl@gmx.net>2013-05-13 17:39:16 +0200
commit822723c2468ea763cdef447218059a5586e8e033 (patch)
tree4e92eecdfda716386413c7f2d2b8e92b3fa4fd7e
parentbda62bd3bf7f41a25f2c6294ddc0ec144081e3ef (diff)
downloadminetest-822723c2468ea763cdef447218059a5586e8e033.tar.gz
minetest-822723c2468ea763cdef447218059a5586e8e033.tar.bz2
minetest-822723c2468ea763cdef447218059a5586e8e033.zip
Add mouse_sensitivity option
-rw-r--r--minetest.conf.example2
-rw-r--r--src/defaultsettings.cpp1
-rw-r--r--src/game.cpp3
3 files changed, 5 insertions, 1 deletions
diff --git a/minetest.conf.example b/minetest.conf.example
index 36ef31459..7d56f99d8 100644
--- a/minetest.conf.example
+++ b/minetest.conf.example
@@ -151,6 +151,8 @@
#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
diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp
index 09ec45697..f270a47aa 100644
--- a/src/defaultsettings.cpp
+++ b/src/defaultsettings.cpp
@@ -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");
diff --git a/src/game.cpp b/src/game.cpp
index 23e794de2..f63a4a400 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -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;