invert_mouse config option
authorPerttu Ahola <celeron55@gmail.com>
Sun, 29 May 2011 18:13:29 +0000 (21:13 +0300)
committerPerttu Ahola <celeron55@gmail.com>
Sun, 29 May 2011 18:13:29 +0000 (21:13 +0300)
--HG--
extra : rebase_source : 2695ad71185244cefbcf6e3e28ba1ab5e54c882f

doc/changelog.txt
minetest.conf.example
src/defaultsettings.cpp
src/game.cpp

index cb3594a984a746b9d1f950f7045ee31ee2bf09dc..e886370a64c1c3cd7fec2193648a5e14da9064ed 100644 (file)
@@ -14,6 +14,7 @@ X:
 - Player passwords
 - All textures first searched from texture_path
 - Map directory ("map") has been renamed to "world" (just rename it to load an old world)
+- Mouse inversion (invert_mouse)
 
 2011-04-24:
 - Smooth lighting with simple ambient occlusion
index 5e6393228bd58ee82e66437598ac454af44c8d3e..1a1dbe0fc85e604f52aabead8929d5f8730259f2 100644 (file)
@@ -42,6 +42,8 @@
 #keymap_special1 = KEY_KEY_E
 #keymap_print_debug_stacks = KEY_KEY_P
 
+#invert_mouse = false
+
 # The desired FPS
 #wanted_fps = 30
 
index 1d758a2a4d2a1e2de70c8d46f8d9d60b80f213bc..6fcdc1dbb30c006f8fbedf29c10c99e3c5188640 100644 (file)
@@ -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");
index cc758be7e8a412e7fe936dd9add3045e9380ad7c..6932b45f1f6468fc37bb75b22f103ca50c658a13 100644 (file)
@@ -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;