configuration: Migrate controller settings to emulated controller
This commit is contained in:
parent
c3ff0a8ac0
commit
af55dd1935
1 changed files with 141 additions and 127 deletions
|
|
@ -111,6 +111,27 @@ NpadStyleTag HIDCore::GetSupportedStyleTag() const {
|
|||
return supported_style_tag;
|
||||
}
|
||||
|
||||
s8 HIDCore::GetPlayerCount() const {
|
||||
s8 active_players = 0;
|
||||
for (std::size_t player_index = 0; player_index < 8; player_index++) {
|
||||
const auto* controller = GetEmulatedControllerByIndex(player_index);
|
||||
if (controller->IsConnected()) {
|
||||
active_players++;
|
||||
}
|
||||
}
|
||||
return active_players;
|
||||
}
|
||||
|
||||
NpadIdType HIDCore::GetFirstNpadId() const {
|
||||
for (std::size_t player_index = 0; player_index < 10; player_index++) {
|
||||
const auto* controller = GetEmulatedControllerByIndex(player_index);
|
||||
if (controller->IsConnected()) {
|
||||
return controller->GetNpadIdType();
|
||||
}
|
||||
}
|
||||
return NpadIdType::Player1;
|
||||
}
|
||||
|
||||
void HIDCore::ReloadInputDevices() {
|
||||
player_1->ReloadFromSettings();
|
||||
player_2->ReloadFromSettings();
|
||||
|
|
|
|||
Loading…
Reference in a new issue