Change GetDevicesAndDescriptions to fill in one vector instead of 2
Ignore changes in non-joystick devices when automapping
This commit is contained in:
@@ -117,7 +117,7 @@ public:
|
||||
/*
|
||||
* Add a device and a description for each logical device.
|
||||
*/
|
||||
virtual void GetDevicesAndDescriptions( vector<InputDevice>& dev, vector<RString>& desc ) const = 0;
|
||||
virtual void GetDevicesAndDescriptions( vector<InputDeviceInfo>& vDevices ) const = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -192,12 +192,11 @@ int JoystickDevice::AssignIDs( InputDevice startID )
|
||||
return m_vSticks.size();
|
||||
}
|
||||
|
||||
void JoystickDevice::GetDevicesAndDescriptions( vector<InputDevice>& dev, vector<RString>& desc ) const
|
||||
void JoystickDevice::GetDevicesAndDescriptions( vector<InputDeviceInfo>& vDevices ) const
|
||||
{
|
||||
FOREACH_CONST( Joystick, m_vSticks, i )
|
||||
{
|
||||
dev.push_back( i->id );
|
||||
desc.push_back( GetDescription() );
|
||||
vDevices.push_back( InputDeviceInfo(i->id,GetDescription()) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ public:
|
||||
void GetButtonPresses( vector<pair<DeviceInput, bool> >& vPresses, int cookie,
|
||||
int value, const RageTimer& now ) const;
|
||||
int AssignIDs( InputDevice startID );
|
||||
void GetDevicesAndDescriptions( vector<InputDevice>& dev, vector<RString>& desc ) const;
|
||||
void GetDevicesAndDescriptions( vector<InputDeviceInfo>& vDevices ) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -165,12 +165,11 @@ void KeyboardDevice::GetButtonPresses( vector<pair<DeviceInput, bool> >& vPresse
|
||||
|
||||
}
|
||||
|
||||
void KeyboardDevice::GetDevicesAndDescriptions( vector<InputDevice>& dev, vector<RString>& desc ) const
|
||||
void KeyboardDevice::GetDevicesAndDescriptions( vector<InputDeviceInfo>& vDevices ) const
|
||||
{
|
||||
if( dev.size() && dev[0] == DEVICE_KEYBOARD )
|
||||
if( vDevices.size() && vDevices[0] == DEVICE_KEYBOARD )
|
||||
return;
|
||||
dev.insert( dev.begin(), DEVICE_KEYBOARD );
|
||||
desc.insert( desc.begin(), "Keyboard" );
|
||||
vDevices.insert( dev.begin(), InputDeviceInfo(DEVICE_KEYBOARD,"Keyboard") );
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -17,7 +17,7 @@ protected:
|
||||
public:
|
||||
void GetButtonPresses( vector<pair<DeviceInput, bool> >& vPresses, int cookie,
|
||||
int value, const RageTimer& now ) const;
|
||||
void GetDevicesAndDescriptions( vector<InputDevice>& dev, vector<RString>& desc ) const;
|
||||
void GetDevicesAndDescriptions( vector<InputDeviceInfo>& vDevices ) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -66,10 +66,9 @@ int PumpDevice::AssignIDs( InputDevice startID )
|
||||
return 1;
|
||||
}
|
||||
|
||||
void PumpDevice::GetDevicesAndDescriptions( vector<InputDevice>& dev, vector<RString>& desc ) const
|
||||
void PumpDevice::GetDevicesAndDescriptions( vector<InputDeviceInfo>& vDevices ) const
|
||||
{
|
||||
dev.push_back( m_Id );
|
||||
desc.push_back( "Pump USB" );
|
||||
vDevices.push_back( InputDeviceInfo(m_Id,"Pump USB") );
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -19,7 +19,7 @@ public:
|
||||
void GetButtonPresses( vector<pair<DeviceInput, bool> >& vPresses, int cookie,
|
||||
int value, const RageTimer& now ) const;
|
||||
int AssignIDs( InputDevice startID );
|
||||
void GetDevicesAndDescriptions( vector<InputDevice>& dev, vector<RString>& desc ) const;
|
||||
void GetDevicesAndDescriptions( vector<InputDeviceInfo>& vDevices ) const;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user