diff --git a/stepmania/src/archutils/Darwin/JoystickDevice.cpp b/stepmania/src/archutils/Darwin/JoystickDevice.cpp index 8b9556971b..279c923680 100644 --- a/stepmania/src/archutils/Darwin/JoystickDevice.cpp +++ b/stepmania/src/archutils/Darwin/JoystickDevice.cpp @@ -165,11 +165,8 @@ void JoystickDevice::GetButtonPresses( vector >& vPresse int JoystickDevice::AssignIDs( InputDevice startID ) { - if( startID < DEVICE_JOY1 ) - { - m_vSticks.clear(); - return 0; - } + if( startID < DEVICE_JOY1 || startID > DEVICE_JOY16 ) + return -1; FOREACH( Joystick, m_vSticks, i ) { if( startID > DEVICE_JOY16 ) diff --git a/stepmania/src/archutils/Darwin/PumpDevice.cpp b/stepmania/src/archutils/Darwin/PumpDevice.cpp index ec414a2f7f..c4075c31f2 100644 --- a/stepmania/src/archutils/Darwin/PumpDevice.cpp +++ b/stepmania/src/archutils/Darwin/PumpDevice.cpp @@ -48,33 +48,32 @@ void PumpDevice::GetButtonPresses( vector >& vPresses, i } if( db1 != DeviceButton_Invalid ) { - DeviceInput di( id, db1, pressed1 ? 1.0f : 0.0f , now ); + DeviceInput di( m_Id, db1, pressed1 ? 1.0f : 0.0f , now ); vPresses.push_back( pair(di, pressed1) ); } if( db2 != DeviceButton_Invalid ) { - DeviceInput di( id, db2, pressed2 ? 1.0f : 0.0f , now ); + DeviceInput di( m_Id, db2, pressed2 ? 1.0f : 0.0f , now ); vPresses.push_back( pair(di, pressed2) ); } } int PumpDevice::AssignIDs( InputDevice startID ) { - id = DEVICE_NONE; if( startID < DEVICE_PUMP1 || startID > DEVICE_PUMP2 ) - return 0; - id = startID; + return -1; + m_Id = startID; return 1; } void PumpDevice::GetDevicesAndDescriptions( vector& dev, vector& desc ) const { - dev.push_back( id ); + dev.push_back( m_Id ); desc.push_back( "Pump USB" ); } /* - * (c) 2005-2006 Steve Checkoway + * (c) 2006 Steve Checkoway * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/stepmania/src/archutils/Darwin/PumpDevice.h b/stepmania/src/archutils/Darwin/PumpDevice.h index 9520306703..c7c0e690c2 100644 --- a/stepmania/src/archutils/Darwin/PumpDevice.h +++ b/stepmania/src/archutils/Darwin/PumpDevice.h @@ -6,14 +6,15 @@ class PumpDevice : public HIDDevice { private: - InputDevice id; + InputDevice m_Id; + protected: bool AddLogicalDevice( int usagePage, int usage ) { return true; } void AddElement( int usagePage, int usage, int cookie, const CFDictionaryRef properties ) { } void Open(); bool SupportsVidPid( int vid, int pid ) { return vid == 0x0d2f && pid == 0x0001; } - + public: void GetButtonPresses( vector >& vPresses, int cookie, int value, const RageTimer& now ) const;