aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-05-29 21:13:29 +0300
committerPerttu Ahola <celeron55@gmail.com>2011-05-29 21:13:29 +0300
commit9f7c21a0b48285fe03bef1060557f6e75976d625 (patch)
tree2aafd04cb8e658d4245d0c810639fa3d8535b878 /src
parent63611932ebae93620386b26cfa82f7c4552b22ff (diff)
downloadminetest-9f7c21a0b48285fe03bef1060557f6e75976d625.tar.gz
minetest-9f7c21a0b48285fe03bef1060557f6e75976d625.tar.bz2
minetest-9f7c21a0b48285fe03bef1060557f6e75976d625.zip
invert_mouse config option
--HG-- extra : rebase_source : 2695ad71185244cefbcf6e3e28ba1ab5e54c882f
Diffstat (limited to 'src')
-rw-r--r--src/defaultsettings.cpp1
-rw-r--r--src/game.cpp4
2 files changed, 5 insertions, 0 deletions
diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp
index 1d758a2a4..6fcdc1dbb 100644
--- a/src/defaultsettings.cpp
+++ b/src/defaultsettings.cpp
@@ -65,6 +65,7 @@ void set_default_settings()
g_settings.setDefault("free_move", "false");
g_settings.setDefault("continuous_forward", "false");
g_settings.setDefault("fast_move", "false");
+ g_settings.setDefault("invert_mouse", "false");
// Server stuff
g_settings.setDefault("enable_experimental", "false");
diff --git a/src/game.cpp b/src/game.cpp
index cc758be7e..6932b45f1 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -894,6 +894,8 @@ void the_game(
core::list<float> frametime_log;
float damage_flash_timer = 0;
+
+ bool invert_mouse = g_settings.getBool("invert_mouse");
/*
Main loop
@@ -1306,6 +1308,8 @@ void the_game(
else{
s32 dx = input->getMousePos().X - displaycenter.X;
s32 dy = input->getMousePos().Y - displaycenter.Y;
+ if(invert_mouse)
+ dy = -dy;
//std::cout<<"window active, pos difference "<<dx<<","<<dy<<std::endl;
/*const float keyspeed = 500;