early-access version 2649
This commit is contained in:
@@ -1207,4 +1207,12 @@ void EmulatedController::DeleteCallback(int key) {
|
||||
}
|
||||
callback_list.erase(iterator);
|
||||
}
|
||||
|
||||
void EmulatedController::RemoveServiceCallbacks() {
|
||||
std::lock_guard lock{mutex};
|
||||
const auto count = std::erase_if(
|
||||
callback_list, [](const auto& callback) { return callback.second.is_npad_service; });
|
||||
LOG_DEBUG(Input, "Elements deleted {}", count);
|
||||
}
|
||||
|
||||
} // namespace Core::HID
|
||||
|
@@ -335,6 +335,9 @@ public:
|
||||
*/
|
||||
void DeleteCallback(int key);
|
||||
|
||||
/// Removes all callbacks created from npad services
|
||||
void RemoveServiceCallbacks();
|
||||
|
||||
private:
|
||||
/// creates input devices from params
|
||||
void LoadDevices();
|
||||
|
@@ -211,4 +211,17 @@ void HIDCore::UnloadInputDevices() {
|
||||
devices->UnloadInput();
|
||||
}
|
||||
|
||||
void HIDCore::RemoveServiceCallbacks() {
|
||||
player_1->RemoveServiceCallbacks();
|
||||
player_2->RemoveServiceCallbacks();
|
||||
player_3->RemoveServiceCallbacks();
|
||||
player_4->RemoveServiceCallbacks();
|
||||
player_5->RemoveServiceCallbacks();
|
||||
player_6->RemoveServiceCallbacks();
|
||||
player_7->RemoveServiceCallbacks();
|
||||
player_8->RemoveServiceCallbacks();
|
||||
other->RemoveServiceCallbacks();
|
||||
handheld->RemoveServiceCallbacks();
|
||||
}
|
||||
|
||||
} // namespace Core::HID
|
||||
|
@@ -61,6 +61,9 @@ public:
|
||||
/// Removes all callbacks from input common
|
||||
void UnloadInputDevices();
|
||||
|
||||
/// Removes all callbacks from npad services
|
||||
void RemoveServiceCallbacks();
|
||||
|
||||
/// Number of emulated controllers
|
||||
static constexpr std::size_t available_controllers{10};
|
||||
|
||||
|
Reference in New Issue
Block a user