diff options
| author | german <german@thesoftwareartisans.com> | 2021-01-01 12:32:29 -0600 |
|---|---|---|
| committer | german <german@thesoftwareartisans.com> | 2021-01-15 09:05:17 -0600 |
| commit | d8df9a16bd4f4517b024c17446a94915493d7f3d (patch) | |
| tree | aed2de583aa94dd11259bece37e55f4263f07336 /src/input_common/udp/protocol.h | |
| parent | 390ee10eefea4249aff94eb5351a908e3cafe228 (diff) | |
Allow to return up to 16 touch inputs per engine
Diffstat (limited to 'src/input_common/udp/protocol.h')
| -rw-r--r-- | src/input_common/udp/protocol.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/input_common/udp/protocol.h b/src/input_common/udp/protocol.h index fc1aea4b9..a3d276697 100644 --- a/src/input_common/udp/protocol.h +++ b/src/input_common/udp/protocol.h @@ -140,6 +140,14 @@ static_assert(sizeof(PortInfo) == 12, "UDP Response PortInfo struct has wrong si static_assert(std::is_trivially_copyable_v<PortInfo>, "UDP Response PortInfo is not trivially copyable"); +struct TouchPad { + u8 is_active{}; + u8 id{}; + u16_le x{}; + u16_le y{}; +}; +static_assert(sizeof(TouchPad) == 6, "UDP Response TouchPad struct has wrong size "); + #pragma pack(push, 1) struct PadData { PortInfo info{}; @@ -190,12 +198,7 @@ struct PadData { u8 button_13{}; } analog_button; - struct TouchPad { - u8 is_active{}; - u8 id{}; - u16_le x{}; - u16_le y{}; - } touch_1, touch_2; + std::array<TouchPad, 2> touch; u64_le motion_timestamp; @@ -222,7 +225,6 @@ static_assert(sizeof(Message<PadData>) == MAX_PACKET_SIZE, static_assert(sizeof(PadData::AnalogButton) == 12, "UDP Response AnalogButton struct has wrong size "); -static_assert(sizeof(PadData::TouchPad) == 6, "UDP Response TouchPad struct has wrong size "); static_assert(sizeof(PadData::Accelerometer) == 12, "UDP Response Accelerometer struct has wrong size "); static_assert(sizeof(PadData::Gyroscope) == 12, "UDP Response Gyroscope struct has wrong size "); |
