Skip to content

Commit 822723c

Browse files
EXio4kahrl
authored andcommittedMay 13, 2013
Add mouse_sensitivity option
1 parent bda62bd commit 822723c

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed
 

‎minetest.conf.example

+2
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@
151151
#crosshair_color = (255,255,255)
152152
# Cross alpha (opaqueness, between 0 and 255)
153153
#crosshair_alpha = 255
154+
# Sensitivity multiplier
155+
#mouse_sensitivity = 0.2
154156
# Sound settings
155157
#enable_sound = true
156158
#sound_volume = 0.7

‎src/defaultsettings.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ void set_default_settings(Settings *settings)
117117
settings->setDefault("selectionbox_color", "(0,0,0)");
118118
settings->setDefault("crosshair_color", "(255,255,255)");
119119
settings->setDefault("crosshair_alpha", "255");
120+
settings->setDefault("mouse_sensitivity", "0.2");
120121
settings->setDefault("enable_sound", "true");
121122
settings->setDefault("sound_volume", "0.8");
122123
settings->setDefault("desynchronize_mapblock_texture_animation", "true");

‎src/game.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -2061,7 +2061,8 @@ void the_game(
20612061
if(input->isKeyDown(irr::KEY_RIGHT))
20622062
dx += dtime * keyspeed;*/
20632063

2064-
float d = 0.2;
2064+
float d = g_settings->getFloat("mouse_sensitivity");
2065+
d = rangelim(d, 0.01, 100.0);
20652066
camera_yaw -= dx*d;
20662067
camera_pitch += dy*d;
20672068
if(camera_pitch < -89.5) camera_pitch = -89.5;

0 commit comments

Comments
 (0)
Please sign in to comment.