cleanup
This commit is contained in:
@@ -468,7 +468,7 @@ void InputMapper::ReadMappingsFromDisk()
|
|||||||
for( unsigned i=0; i<sDeviceInputStrings.size() && i<unsigned(NUM_GAME_TO_DEVICE_SLOTS); i++ )
|
for( unsigned i=0; i<sDeviceInputStrings.size() && i<unsigned(NUM_GAME_TO_DEVICE_SLOTS); i++ )
|
||||||
{
|
{
|
||||||
DeviceInput DeviceI;
|
DeviceInput DeviceI;
|
||||||
DeviceI.fromString( sDeviceInputStrings[i] );
|
DeviceI.FromString( sDeviceInputStrings[i] );
|
||||||
if( DeviceI.IsValid() )
|
if( DeviceI.IsValid() )
|
||||||
SetInputMap( DeviceI, GameI, i );
|
SetInputMap( DeviceI, GameI, i );
|
||||||
}
|
}
|
||||||
@@ -499,7 +499,7 @@ void InputMapper::SaveMappingsToDisk()
|
|||||||
|
|
||||||
vector<CString> asValues;
|
vector<CString> asValues;
|
||||||
for( int slot = 0; slot < NUM_GAME_TO_DEVICE_SLOTS; ++slot )
|
for( int slot = 0; slot < NUM_GAME_TO_DEVICE_SLOTS; ++slot )
|
||||||
asValues.push_back( m_GItoDI[i][j][slot].toString() );
|
asValues.push_back( m_GItoDI[i][j][slot].ToString() );
|
||||||
|
|
||||||
while( asValues.size() && asValues.back() == "" )
|
while( asValues.size() && asValues.back() == "" )
|
||||||
asValues.erase( asValues.begin()+asValues.size()-1 );
|
asValues.erase( asValues.begin()+asValues.size()-1 );
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ CString RageInput::GetDeviceSpecificInputString( const DeviceInput &di )
|
|||||||
return (*i)->GetDeviceSpecificInputString(di);
|
return (*i)->GetDeviceSpecificInputString(di);
|
||||||
}
|
}
|
||||||
|
|
||||||
return di.toString();
|
return di.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
InputDeviceState RageInput::GetInputDeviceState( InputDevice id )
|
InputDeviceState RageInput::GetInputDeviceState( InputDevice id )
|
||||||
|
|||||||
@@ -315,7 +315,7 @@ int GetNumDeviceButtons( InputDevice device )
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
CString DeviceInput::toString() const
|
CString DeviceInput::ToString() const
|
||||||
{
|
{
|
||||||
if( device == DEVICE_NONE )
|
if( device == DEVICE_NONE )
|
||||||
return CString();
|
return CString();
|
||||||
@@ -324,7 +324,7 @@ CString DeviceInput::toString() const
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DeviceInput::fromString( const CString &s )
|
bool DeviceInput::FromString( const CString &s )
|
||||||
{
|
{
|
||||||
char szDevice[32] = "";
|
char szDevice[32] = "";
|
||||||
char szButton[32] = "";
|
char szButton[32] = "";
|
||||||
|
|||||||
@@ -329,8 +329,8 @@ public:
|
|||||||
return ! operator==( other );
|
return ! operator==( other );
|
||||||
}
|
}
|
||||||
|
|
||||||
CString toString() const;
|
CString ToString() const;
|
||||||
bool fromString( const CString &s );
|
bool FromString( const CString &s );
|
||||||
|
|
||||||
bool IsValid() const { return device != DEVICE_NONE; };
|
bool IsValid() const { return device != DEVICE_NONE; };
|
||||||
void MakeInvalid() { device = DEVICE_NONE; };
|
void MakeInvalid() { device = DEVICE_NONE; };
|
||||||
|
|||||||
@@ -344,7 +344,7 @@ void ScreenMapControllers::Refresh()
|
|||||||
GameInput cur_gi( p, pKey->m_GameButton );
|
GameInput cur_gi( p, pKey->m_GameButton );
|
||||||
DeviceInput di;
|
DeviceInput di;
|
||||||
if( INPUTMAPPER->GameToDevice( cur_gi, s, di ) )
|
if( INPUTMAPPER->GameToDevice( cur_gi, s, di ) )
|
||||||
pText->SetText( di.toString() );
|
pText->SetText( di.ToString() );
|
||||||
else
|
else
|
||||||
pText->SetText( "-----------" );
|
pText->SetText( "-----------" );
|
||||||
|
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ void ScreenTestInput::Update( float fDeltaTime )
|
|||||||
|
|
||||||
void ScreenTestInput::Input( const InputEventPlus &input )
|
void ScreenTestInput::Input( const InputEventPlus &input )
|
||||||
{
|
{
|
||||||
CString sMessage = input.DeviceI.toString();
|
CString sMessage = input.DeviceI.ToString();
|
||||||
switch( input.type )
|
switch( input.type )
|
||||||
{
|
{
|
||||||
case IET_FIRST_PRESS:
|
case IET_FIRST_PRESS:
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public:
|
|||||||
virtual void GetDevicesAndDescriptions( vector<InputDevice>& vDevicesOut, vector<CString>& vDescriptionsOut ) = 0;
|
virtual void GetDevicesAndDescriptions( vector<InputDevice>& vDevicesOut, vector<CString>& vDescriptionsOut ) = 0;
|
||||||
|
|
||||||
// Override to return a pretty string that's specific to the controller type.
|
// Override to return a pretty string that's specific to the controller type.
|
||||||
virtual CString GetDeviceSpecificInputString( const DeviceInput &di ) { return di.toString(); }
|
virtual CString GetDeviceSpecificInputString( const DeviceInput &di ) { return di.ToString(); }
|
||||||
|
|
||||||
// Override to find out whether the controller is currently plugged in.
|
// Override to find out whether the controller is currently plugged in.
|
||||||
// Not all InputHandlers will support this. Not applicable to all InputHandlers.
|
// Not all InputHandlers will support this. Not applicable to all InputHandlers.
|
||||||
|
|||||||
Reference in New Issue
Block a user