mirror of
https://github.com/yuzu-emu/yuzu-android
synced 2024-12-27 04:31:22 -08:00
Added missing start/end touch attributes to touchscreen
This commit is contained in:
parent
f66c6fe554
commit
0c3e7b7086
@ -41,7 +41,11 @@ void Controller_Touchscreen::OnUpdate(u8* data, std::size_t size) {
|
|||||||
|
|
||||||
const auto [x, y, pressed] = touch_device->GetStatus();
|
const auto [x, y, pressed] = touch_device->GetStatus();
|
||||||
auto& touch_entry = cur_entry.states[0];
|
auto& touch_entry = cur_entry.states[0];
|
||||||
|
touch_entry.attribute.raw = 0;
|
||||||
if (pressed) {
|
if (pressed) {
|
||||||
|
if (cur_entry.entry_count == 0) {
|
||||||
|
touch_entry.attribute.start_touch.Assign(1);
|
||||||
|
}
|
||||||
touch_entry.x = static_cast<u16>(x * Layout::ScreenUndocked::Width);
|
touch_entry.x = static_cast<u16>(x * Layout::ScreenUndocked::Width);
|
||||||
touch_entry.y = static_cast<u16>(y * Layout::ScreenUndocked::Height);
|
touch_entry.y = static_cast<u16>(y * Layout::ScreenUndocked::Height);
|
||||||
touch_entry.diameter_x = 15;
|
touch_entry.diameter_x = 15;
|
||||||
@ -53,6 +57,9 @@ void Controller_Touchscreen::OnUpdate(u8* data, std::size_t size) {
|
|||||||
touch_entry.finger = 0;
|
touch_entry.finger = 0;
|
||||||
cur_entry.entry_count = 1;
|
cur_entry.entry_count = 1;
|
||||||
} else {
|
} else {
|
||||||
|
if (cur_entry.entry_count == 1) {
|
||||||
|
touch_entry.attribute.end_touch.Assign(1);
|
||||||
|
}
|
||||||
cur_entry.entry_count = 0;
|
cur_entry.entry_count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "common/bit_field.h"
|
||||||
#include "common/common_funcs.h"
|
#include "common/common_funcs.h"
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "common/swap.h"
|
#include "common/swap.h"
|
||||||
@ -29,9 +30,18 @@ public:
|
|||||||
void OnLoadInputDevices() override;
|
void OnLoadInputDevices() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
struct Attributes {
|
||||||
|
union {
|
||||||
|
u32 raw{};
|
||||||
|
BitField<0, 1, u32_le> start_touch;
|
||||||
|
BitField<1, 1, u32_le> end_touch;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
static_assert(sizeof(Attributes) == 0x4, "Attributes is an invalid size");
|
||||||
|
|
||||||
struct TouchState {
|
struct TouchState {
|
||||||
u64_le delta_time;
|
u64_le delta_time;
|
||||||
u32_le attribute;
|
Attributes attribute;
|
||||||
u32_le finger;
|
u32_le finger;
|
||||||
u32_le x;
|
u32_le x;
|
||||||
u32_le y;
|
u32_le y;
|
||||||
|
Loading…
Reference in New Issue
Block a user