summaryrefslogtreecommitdiffstats
path: root/src/input_common/gcadapter/gc_adapter.cpp
diff options
context:
space:
mode:
authorAmeer <aj662@drexel.edu>2020-06-22 03:15:58 +0200
committerAmeer <aj662@drexel.edu>2020-06-22 03:17:46 +0200
commit968d631aa59a0a4e51e219eaa143d2b95593c3e7 (patch)
tree3429728a2848581b869a038a2da6499a2ca36952 /src/input_common/gcadapter/gc_adapter.cpp
parentfix include thread (diff)
downloadyuzu-968d631aa59a0a4e51e219eaa143d2b95593c3e7.tar
yuzu-968d631aa59a0a4e51e219eaa143d2b95593c3e7.tar.gz
yuzu-968d631aa59a0a4e51e219eaa143d2b95593c3e7.tar.bz2
yuzu-968d631aa59a0a4e51e219eaa143d2b95593c3e7.tar.lz
yuzu-968d631aa59a0a4e51e219eaa143d2b95593c3e7.tar.xz
yuzu-968d631aa59a0a4e51e219eaa143d2b95593c3e7.tar.zst
yuzu-968d631aa59a0a4e51e219eaa143d2b95593c3e7.zip
Diffstat (limited to '')
-rw-r--r--src/input_common/gcadapter/gc_adapter.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/input_common/gcadapter/gc_adapter.cpp b/src/input_common/gcadapter/gc_adapter.cpp
index 0696a96c7..498bd0d6e 100644
--- a/src/input_common/gcadapter/gc_adapter.cpp
+++ b/src/input_common/gcadapter/gc_adapter.cpp
@@ -134,7 +134,7 @@ void Adapter::Read() {
payload_size = payload_size_in;
}
- GCPadStatus pad[4];
+ std::array<GCPadStatus, 4> pad;
if (payload_size != sizeof(controller_payload_copy) ||
controller_payload_copy[0] != LIBUSB_DT_HID) {
LOG_ERROR(Input, "error reading payload (size: %d, type: %02x)", payload_size,
@@ -224,9 +224,7 @@ void Adapter::Setup() {
current_status = NO_ADAPTER_DETECTED;
}
- for (int i = 0; i < 4; i++) {
- adapter_controllers_status[i] = ControllerTypes::None;
- }
+ adapter_controllers_status.fill(ControllerTypes::None);
libusb_device** devs; // pointer to list of connected usb devices
@@ -332,9 +330,7 @@ void Adapter::Reset() {
adapter_input_thread.join();
}
- for (int i = 0; i < 4; i++) {
- adapter_controllers_status[i] = ControllerTypes::None;
- }
+ adapter_controllers_status.fill(ControllerTypes::None);
current_status = NO_ADAPTER_DETECTED;
@@ -354,10 +350,16 @@ void Adapter::ResetDeviceType(int port) {
}
void Adapter::BeginConfiguration() {
+ for (auto& pq : pad_queue) {
+ pq.Clear();
+ }
configuring = true;
}
void Adapter::EndConfiguration() {
+ for (auto& pq : pad_queue) {
+ pq.Clear();
+ }
configuring = false;
}