From: Tobias Markus Date: Sat, 31 Aug 2013 18:19:53 +0000 (+0200) Subject: Few more fixes to SDL2 conversion X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=38cd30cd8e337dc41022c4706a99390042c5adf7;p=supertux.git Few more fixes to SDL2 conversion --- diff --git a/src/supertux/menu/joystick_menu.cpp b/src/supertux/menu/joystick_menu.cpp index 38733ffcb..9c454a0e7 100644 --- a/src/supertux/menu/joystick_menu.cpp +++ b/src/supertux/menu/joystick_menu.cpp @@ -60,8 +60,11 @@ JoystickMenu::recreateMenu() add_inactive(-1,""); add_entry(SCAN_JOYSTICKS, _("Scan for Joysticks")); //Show Joysticks currently activated: //edit by giby - joy = SDL_JoystickOpen(0) - if (SDL_NumJoysticks() > 0) {joy = SDL_JoystickOpen(0); + SDL_Joystick *joy; + if (SDL_NumJoysticks() > 0) { + joy = SDL_JoystickOpen(0); + } + for(std::vector::iterator i = controller->joysticks.begin(); i != controller->joysticks.end(); ++i) { if(*i != 0) @@ -73,8 +76,9 @@ JoystickMenu::recreateMenu() update(); } +/* std::string -/*JoystickMenu::get_button_name(int button) +JoystickMenu::get_button_name(int button) { if(button < 0) return _("None"); diff --git a/src/supertux/menu/keyboard_menu.hpp b/src/supertux/menu/keyboard_menu.hpp index c83cb4bc0..b09c4061c 100644 --- a/src/supertux/menu/keyboard_menu.hpp +++ b/src/supertux/menu/keyboard_menu.hpp @@ -28,7 +28,7 @@ public: ~KeyboardMenu(); void update(); - std::string SDL_GetKeyName(SDL_Keycode* key); + std::string get_key_name(SDL_Keycode key); virtual void menu_action(MenuItem* item); JoystickKeyboardController* controller; void check_menu() {}