diff --git a/src/karts/player_kart.cpp b/src/karts/player_kart.cpp index 7897f5c94..7616b2ff6 100644 --- a/src/karts/player_kart.cpp +++ b/src/karts/player_kart.cpp @@ -123,6 +123,10 @@ void PlayerKart::action(KartAction action, int value) //----------------------------------------------------------------------------- void PlayerKart::steer(float dt, int steer_val) { + if(user_config->m_gamepad_debug) + { + printf("steering: steer_val %d ", steer_val); + } const float STEER_CHANGE = dt/getTimeFullSteer(); // amount the steering is changed if (steer_val < 0) { @@ -153,6 +157,10 @@ void PlayerKart::steer(float dt, int steer_val) if(m_controls.m_steer>0.0f) m_controls.m_steer=0.0f; } // if m_controls.m_steer<=0.0f } // no key is pressed + if(user_config->m_gamepad_debug) + { + printf(" set to: %f\n", m_controls.m_steer); + } m_controls.m_steer = std::min(1.0f, std::max(-1.0f, m_controls.m_steer)); diff --git a/src/main.cpp b/src/main.cpp index 0d85b334b..af4fc277e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -142,9 +142,9 @@ int handleCmdLine(int argc, char **argv) cmdLineHelp(argv[0]); return 0; } - else if(!strcmp(argv[i], "--keyboard-debug")) + else if(!strcmp(argv[i], "--gamepad-debug")) { - user_config->m_keyboard_debug=true; + user_config->m_gamepad_debug=true; } else if(sscanf(argv[i], "--track-debug=%d",&n)==1) { diff --git a/src/sdldrv.cpp b/src/sdldrv.cpp index db6d99875..01d2052a7 100755 --- a/src/sdldrv.cpp +++ b/src/sdldrv.cpp @@ -517,6 +517,11 @@ void SDLDriver::input() break; case SDL_JOYAXISMOTION: + if(user_config->m_gamepad_debug) + { + printf("axis motion: which %d %axis d value %d\n", + ev.jaxis.which, ev.jaxis.axis, ev.jaxis.value); + } stickIndex = stickInfos[ev.jaxis.which]->m_index; // If the joystick axis exceeds the deadzone report the input. // In menu mode (mode = MENU = 0) the joystick number is reported diff --git a/src/user_config.cpp b/src/user_config.cpp index 0195e47ab..234b62a9c 100644 --- a/src/user_config.cpp +++ b/src/user_config.cpp @@ -90,7 +90,7 @@ void UserConfig::setDefaults() { setFilename(); m_warning = ""; - m_keyboard_debug = false; + m_gamepad_debug = false; m_track_debug = 0; m_bullet_debug = false; m_fullscreen = false; diff --git a/src/user_config.hpp b/src/user_config.hpp index 160973984..bcca95da2 100644 --- a/src/user_config.hpp +++ b/src/user_config.hpp @@ -158,7 +158,7 @@ public: enum UC_Mode {UC_ENABLE, UC_DISABLE, UC_TEMPORARY_DISABLE}; // Attributes that are accessed directly. - bool m_keyboard_debug; + bool m_gamepad_debug; int m_track_debug; bool m_bullet_debug; bool m_fullscreen;