@@ -108,7 +108,7 @@ KeyboardMapping KeyboardProfile;
108
108
map< SDL_JoystickGUID, JoystickMapping* > JoystickProfiles;
109
109
110
110
// maps {Vircon gamepads} --> {PC devices}
111
- DeviceInfo MappedGamepads[ Constants::MaximumGamepads ];
111
+ DeviceInfo MappedGamepads[ Constants::GamepadPorts ];
112
112
113
113
114
114
// =============================================================================
@@ -462,12 +462,12 @@ void AssignInputDevices()
462
462
bool IsKeyboardUsed = false ;
463
463
464
464
// update mappings for gamepads
465
- for ( int Gamepad = 0 ; Gamepad < Constants::MaximumGamepads ; Gamepad++ )
465
+ for ( int Gamepad = 0 ; Gamepad < Constants::GamepadPorts ; Gamepad++ )
466
466
{
467
467
DeviceInfo* GamepadDevice = &MappedGamepads[ Gamepad ];
468
468
469
469
// preemptively disconnect the gamepad
470
- Vircon.GamepadController .ProcessConnectionChange ( Gamepad, false );
470
+ Vircon.GamepadController .SetGamepadConnection ( Gamepad, false );
471
471
472
472
// process non-joystick devices
473
473
if ( GamepadDevice->Type == DeviceTypes::NoDevice )
@@ -482,7 +482,7 @@ void AssignInputDevices()
482
482
else
483
483
{
484
484
IsKeyboardUsed = true ;
485
- Vircon.GamepadController .ProcessConnectionChange ( Gamepad, true );
485
+ Vircon.GamepadController .SetGamepadConnection ( Gamepad, true );
486
486
}
487
487
488
488
continue ;
@@ -506,7 +506,7 @@ void AssignInputDevices()
506
506
{
507
507
MappedInstanceIDs.insert ( JoystickInstanceID );
508
508
GamepadDevice->InstanceID = JoystickInstanceID;
509
- Vircon.GamepadController .ProcessConnectionChange ( Gamepad, true );
509
+ Vircon.GamepadController .SetGamepadConnection ( Gamepad, true );
510
510
break ;
511
511
}
512
512
}
@@ -539,13 +539,13 @@ void SetDefaultSettings()
539
539
Vircon.UnloadMemoryCard ();
540
540
541
541
// set keyboard for first gamepad
542
- Vircon.GamepadController .ProcessConnectionChange ( 0 , true );
542
+ Vircon.GamepadController .SetGamepadConnection ( 0 , true );
543
543
MappedGamepads[ 0 ].Type = DeviceTypes::Keyboard;
544
544
545
545
// set no device for the rest of gamepads
546
- for ( int i = 1 ; i < Constants::MaximumGamepads ; i++ )
546
+ for ( int i = 1 ; i < Constants::GamepadPorts ; i++ )
547
547
{
548
- Vircon.GamepadController .ProcessConnectionChange ( i, false );
548
+ Vircon.GamepadController .SetGamepadConnection ( i, false );
549
549
MappedGamepads[ i ].Type = DeviceTypes::NoDevice;
550
550
}
551
551
@@ -643,15 +643,15 @@ void LoadSettings( const string& FilePath )
643
643
Vircon.SPU .NumberOfBuffers = NumberOfBuffers;
644
644
645
645
// configure gamepads
646
- for ( int Gamepad = 0 ; Gamepad < Constants::MaximumGamepads ; Gamepad++ )
646
+ for ( int Gamepad = 0 ; Gamepad < Constants::GamepadPorts ; Gamepad++ )
647
647
{
648
648
// access the Nth gamepad element
649
649
string GamepadElementName = string (" gamepad-" ) + to_string ( Gamepad+1 );
650
650
XMLElement* GamepadRoot = GetRequiredElement ( SettingsRoot, GamepadElementName.c_str () );
651
651
652
652
// preemptively leave the gamepad unmapped and disconnected
653
653
// unless a valid profile is found for it later
654
- Vircon.GamepadController .ProcessConnectionChange ( Gamepad, false );
654
+ Vircon.GamepadController .SetGamepadConnection ( Gamepad, false );
655
655
MappedGamepads[ Gamepad ].Type = DeviceTypes::NoDevice;
656
656
657
657
// read profile name
@@ -668,7 +668,7 @@ void LoadSettings( const string& FilePath )
668
668
if ( ToLowerCase ( ProfileName ) == " keyboard" )
669
669
{
670
670
MappedGamepads[ Gamepad ].Type = DeviceTypes::Keyboard;
671
- Vircon.GamepadController .ProcessConnectionChange ( Gamepad, true );
671
+ Vircon.GamepadController .SetGamepadConnection ( Gamepad, true );
672
672
continue ;
673
673
}
674
674
@@ -680,7 +680,7 @@ void LoadSettings( const string& FilePath )
680
680
{
681
681
MappedGamepads[ Gamepad ].Type = DeviceTypes::Joystick;
682
682
MappedGamepads[ Gamepad ].GUID = Position->first ;
683
- Vircon.GamepadController .ProcessConnectionChange ( Gamepad, true );
683
+ Vircon.GamepadController .SetGamepadConnection ( Gamepad, true );
684
684
continue ;
685
685
}
686
686
}
@@ -810,7 +810,7 @@ void SaveSettings( const string& FilePath )
810
810
SettingsRoot->LinkEndChild ( AudioBuffersElement );
811
811
812
812
// save gamepad profiles
813
- for ( int Gamepad = 0 ; Gamepad < Constants::MaximumGamepads ; Gamepad++ )
813
+ for ( int Gamepad = 0 ; Gamepad < Constants::GamepadPorts ; Gamepad++ )
814
814
{
815
815
// determine profile name
816
816
DeviceInfo MappedDevice = MappedGamepads[ Gamepad ];
0 commit comments