From: Ingo Ruhnke Date: Wed, 20 Aug 2014 01:47:40 +0000 (+0200) Subject: Fixed mixup in the config reading that caused keyboard to reset, also use reference... X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=77d77203e2a94a45a6aa1e66f1ea3e28323a3acb;p=supertux.git Fixed mixup in the config reading that caused keyboard to reset, also use reference instead of pointer in JoystickConfig --- diff --git a/src/control/joystick_config.cpp b/src/control/joystick_config.cpp index e155cf119..6a0db6902 100644 --- a/src/control/joystick_config.cpp +++ b/src/control/joystick_config.cpp @@ -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") diff --git a/src/control/joystick_config.hpp b/src/control/joystick_config.hpp index 80aa27593..fd427f276 100644 --- a/src/control/joystick_config.hpp +++ b/src/control/joystick_config.hpp @@ -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: diff --git a/src/supertux/gameconfig.cpp b/src/supertux/gameconfig.cpp index 13408a787..eea7955fb 100644 --- a/src/supertux/gameconfig.cpp +++ b/src/supertux/gameconfig.cpp @@ -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); } }