second commit lion review
This commit is contained in:
parent
730f078302
commit
77fa4d4bf6
28 changed files with 73 additions and 42 deletions
|
@ -209,10 +209,11 @@ int EmulatedConsole::SetCallback(ConsoleUpdateCallback update_callback) {
|
|||
|
||||
void EmulatedConsole::DeleteCallback(int key) {
|
||||
std::lock_guard lock{mutex};
|
||||
if (!callback_list.contains(key)) {
|
||||
const auto& iterator = callback_list.find(key);
|
||||
if (iterator == callback_list.end()) {
|
||||
LOG_ERROR(Input, "Tried to delete non-existent callback {}", key);
|
||||
return;
|
||||
}
|
||||
callback_list.erase(key);
|
||||
callback_list.erase(iterator);
|
||||
}
|
||||
} // namespace Core::HID
|
||||
|
|
|
@ -993,10 +993,11 @@ int EmulatedController::SetCallback(ControllerUpdateCallback update_callback) {
|
|||
|
||||
void EmulatedController::DeleteCallback(int key) {
|
||||
std::lock_guard lock{mutex};
|
||||
if (!callback_list.contains(key)) {
|
||||
const auto& iterator = callback_list.find(key);
|
||||
if (iterator == callback_list.end()) {
|
||||
LOG_ERROR(Input, "Tried to delete non-existent callback {}", key);
|
||||
return;
|
||||
}
|
||||
callback_list.erase(key);
|
||||
callback_list.erase(iterator);
|
||||
}
|
||||
} // namespace Core::HID
|
||||
|
|
|
@ -362,10 +362,11 @@ int EmulatedDevices::SetCallback(InterfaceUpdateCallback update_callback) {
|
|||
|
||||
void EmulatedDevices::DeleteCallback(int key) {
|
||||
std::lock_guard lock{mutex};
|
||||
if (!callback_list.contains(key)) {
|
||||
const auto& iterator = callback_list.find(key);
|
||||
if (iterator == callback_list.end()) {
|
||||
LOG_ERROR(Input, "Tried to delete non-existent callback {}", key);
|
||||
return;
|
||||
}
|
||||
callback_list.erase(key);
|
||||
callback_list.erase(iterator);
|
||||
}
|
||||
} // namespace Core::HID
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
// Refer to the license.txt file included.
|
||||
|
||||
#include "common/assert.h"
|
||||
#include "core/hid/emulated_console.h"
|
||||
#include "core/hid/emulated_controller.h"
|
||||
#include "core/hid/emulated_devices.h"
|
||||
#include "core/hid/hid_core.h"
|
||||
|
||||
namespace Core::HID {
|
||||
|
|
|
@ -6,9 +6,13 @@
|
|||
|
||||
#include <memory>
|
||||
|
||||
#include "core/hid/emulated_console.h"
|
||||
#include "core/hid/emulated_controller.h"
|
||||
#include "core/hid/emulated_devices.h"
|
||||
#include "core/hid/hid_types.h"
|
||||
|
||||
namespace Core::HID {
|
||||
class EmulatedConsole;
|
||||
class EmulatedController;
|
||||
class EmulatedDevices;
|
||||
} // namespace Core::HID
|
||||
|
||||
namespace Core::HID {
|
||||
|
||||
|
|
|
@ -4,9 +4,17 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
namespace Input {
|
||||
namespace Common::Input {
|
||||
struct CallbackStatus;
|
||||
};
|
||||
enum class BatteryLevel : u32;
|
||||
using BatteryStatus = BatteryLevel;
|
||||
struct AnalogStatus;
|
||||
struct ButtonStatus;
|
||||
struct MotionStatus;
|
||||
struct StickStatus;
|
||||
struct TouchStatus;
|
||||
struct TriggerStatus;
|
||||
}; // namespace Common::Input
|
||||
|
||||
namespace Core::HID {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue