Fixed mixup in the config reading that caused keyboard to reset, also use reference...
authorIngo Ruhnke <grumbel@gmail.com>
Wed, 20 Aug 2014 01:47:40 +0000 (03:47 +0200)
committerIngo Ruhnke <grumbel@gmail.com>
Wed, 20 Aug 2014 01:47:40 +0000 (03:47 +0200)
src/control/joystick_config.cpp
src/control/joystick_config.hpp
src/supertux/gameconfig.cpp

index e155cf1..6a0db69 100644 (file)
@@ -155,12 +155,12 @@ JoystickConfig::bind_joybutton(JoyId joy_id, int button, Controller::Control con
 }
 
 void
-JoystickConfig::read(const lisp::Lisp* joystick_lisp)
+JoystickConfig::read(const lisp::Lisp& joystick_lisp)
 {
-  joystick_lisp->get("dead-zone", dead_zone);
-  joystick_lisp->get("jump-with-up", jump_with_up_joy);
+  joystick_lisp.get("dead-zone", dead_zone);
+  joystick_lisp.get("jump-with-up", jump_with_up_joy);
 
-  lisp::ListIterator iter(joystick_lisp);
+  lisp::ListIterator iter(&joystick_lisp);
   while(iter.next())
   {
     if (iter.item() == "map")
index 80aa275..fd427f2 100644 (file)
@@ -55,7 +55,7 @@ public:
   void bind_joyaxis(JoyId joy_id, int axis, Controller::Control c);
   void bind_joyhat(JoyId joy_id, int dir, Controller::Control c);
 
-  void read(const lisp::Lisp* joystick_lisp);
+  void read(const lisp::Lisp& joystick_lisp);
   void write(Writer& writer);
 
 private:
index 13408a7..eea7955 100644 (file)
@@ -108,13 +108,13 @@ Config::load()
     const lisp::Lisp* keymap_lisp = config_control_lisp->get_lisp("keymap");
     if (keymap_lisp)
     {
-      keyboard_config.read(*config_control_lisp);
+      keyboard_config.read(*keymap_lisp);
     }
 
     const lisp::Lisp* joystick_lisp = config_control_lisp->get_lisp("joystick");
     if (joystick_lisp)
     {
-      joystick_config.read(joystick_lisp);
+      joystick_config.read(*joystick_lisp);
     }
   }