Skip to content

Instantly share code, notes, and snippets.

@yalla
Created January 5, 2015 06:44
Show Gist options
  • Save yalla/cda7267b32aaa5906852 to your computer and use it in GitHub Desktop.
Save yalla/cda7267b32aaa5906852 to your computer and use it in GitHub Desktop.
STK patch for debugging Xbox 360 controller woes
diff --git a/src/input/device_manager.cpp b/src/input/device_manager.cpp
index 2f884ad..755b81f 100644
--- a/src/input/device_manager.cpp
+++ b/src/input/device_manager.cpp
@@ -184,14 +184,21 @@ void DeviceManager::setAssignMode(const PlayerAssignMode assignMode)
GamePadDevice* DeviceManager::getGamePadFromIrrID(const int id)
{
const int count = m_gamepads.size();
+
+ Log::info("DeviceManager::getGamePadFromIrrID", "id = %i", id);
+ Log::info("DeviceManager::getGamePadFromIrrID", "m_gamepads.size = %i", count);
+
for (int i = 0; i < count; i++)
{
+ Log::info("DeviceManager::getGamePadFromIrrID", "in loop: iteration i = %i", i);
+ Log::info("DeviceManager::getGamePadFromIrrID", "in loop: m_gamepads[i].getIrrIndex() = %i", m_gamepads[i].getIrrIndex());
if (m_gamepads[i].getIrrIndex()== id)
{
-
+ Log::info("DeviceManager::getGamePadFromIrrID", "m_gamepads[i].getIrrIndex() = %i - MATCH", id);
return m_gamepads.get(i);
}
}
+ Log::info("DeviceManager::getGamePadFromIrrID", "returning NULL!");
return NULL;
} // getGamePadFromIrrID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment