================================================================================

Temporary fix for multicontroller problems.  This fix will support multiple 
controllers with the same name, but there will be one entry in the config file
for each controller.  No longer creates multiple entries for each controller.
Need to correct a few other problems before this can truly be completed.



git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@3805 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
rforder 2009-08-04 20:18:43 +00:00
parent 2acfc48e3e
commit 9f38ccb15b
2 changed files with 3 additions and 1 deletions

View File

@ -92,7 +92,8 @@ bool DeviceManager::checkForGamePad(const int irr_id)
std::cout << " (checking...) I remember that gamepad #" << n << " is named " << m_gamepads[n].m_name.c_str() << std::endl;
// FIXME - don't check only name, but also number of axes and buttons?
if((m_gamepads[n].m_name == name) && (m_gamepads[n].m_index == irr_id))
// Only assign device IDs to gamepads which have not yet been assigned a device ID
if((m_gamepads[n].m_name == name) && (m_gamepads[n].m_index == -1))
{
std::cout << "--> that's the one currently connected\n";
m_gamepads[n].open(irr_id, m_gamepads[n].m_name, m_irrlicht_gamepads[irr_id].Axes, m_irrlicht_gamepads[irr_id].Buttons);

View File

@ -183,6 +183,7 @@ GamePadDevice::GamePadDevice(irr::io::IrrXMLReader* xml)
std::cerr << "Warning, joystick without name in config file, making it undetectable\n";
}
else m_name = name_string;
m_index = -1; // Set to -1 so we can establish when a device ID has been associated
for(int n=0; n<SEvent::SJoystickEvent::NUMBER_OF_BUTTONS; n++)
m_buttonPressed[n] = false;