From 9f7c21a0b48285fe03bef1060557f6e75976d625 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sun, 29 May 2011 21:13:29 +0300 Subject: invert_mouse config option --HG-- extra : rebase_source : 2695ad71185244cefbcf6e3e28ba1ab5e54c882f --- src/defaultsettings.cpp | 1 + src/game.cpp | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'src') 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 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 "<