From: <au...@us...> - 2009-04-26 00:13:05
|
Revision: 3431 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=3431&view=rev Author: auria Date: 2009-04-26 00:12:55 +0000 (Sun, 26 Apr 2009) Log Message: ----------- added more debug checks for jpenguin Modified Paths: -------------- main/branches/irrlicht/src/input/input_device.cpp main/branches/irrlicht/src/input/input_device.hpp Modified: main/branches/irrlicht/src/input/input_device.cpp =================================================================== --- main/branches/irrlicht/src/input/input_device.cpp 2009-04-26 00:03:46 UTC (rev 3430) +++ main/branches/irrlicht/src/input/input_device.cpp 2009-04-26 00:12:55 UTC (rev 3431) @@ -196,7 +196,8 @@ { m_type = DT_GAMEPAD; m_deadzone = DEADZONE_JOYSTICK; - + m_prevAxisDirections = NULL; + open(irrIndex, name, axis_count); m_name = name; @@ -204,7 +205,8 @@ } // GamePadDevice // ----------------------------------------------------------------------------- void GamePadDevice::open(const int irrIndex, const std::string name, const int axis_count) -{ +{ + m_axis_count = axis_count; m_prevAxisDirections = new Input::AxisDirection[axis_count]; std::cout << "(i) This gamepad has " << axis_count << " axes\n"; @@ -283,6 +285,8 @@ { if(type == Input::IT_STICKMOTION) { + std::cout << "For jpenguin (a)\n"; + // going to negative from positive if (value < 0 && m_prevAxisDirections[id] == Input::AD_POSITIVE) { @@ -297,9 +301,13 @@ resetAxisDirection(id, Input::AD_NEGATIVE, player); } + std::cout << "For jpenguin (b)\n"; + if(value > 0) m_prevAxisDirections[id] = Input::AD_POSITIVE; else if(value < 0) m_prevAxisDirections[id] = Input::AD_NEGATIVE; + std::cout << "For jpenguin (c)\n"; + // check if within deadzone if(value > -m_deadzone && value < m_deadzone) { @@ -326,6 +334,8 @@ return false; } + std::cout << "For jpenguin (d)\n"; + // find corresponding action and return it for(int n=0; n<PA_COUNT; n++) { @@ -343,6 +353,7 @@ } } }// next device + } else if(type == Input::IT_STICKBUTTON) { Modified: main/branches/irrlicht/src/input/input_device.hpp =================================================================== --- main/branches/irrlicht/src/input/input_device.hpp 2009-04-26 00:03:46 UTC (rev 3430) +++ main/branches/irrlicht/src/input/input_device.hpp 2009-04-26 00:12:55 UTC (rev 3431) @@ -62,6 +62,7 @@ // SDL_Joystick *m_sdlJoystick; int m_deadzone; int m_index; + int m_axis_count; Input::AxisDirection *m_prevAxisDirections; /** checks if this key belongs to this belongs. if yes, sets action and returns true; otherwise returns false. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |