diff options
| author | 2015-03-08 21:32:13 -0400 | |
|---|---|---|
| committer | 2015-03-10 18:05:19 -0400 | |
| commit | a1a1a5c6c537fa35f914e3bb5deaae48ada95c99 (patch) | |
| tree | b08d32b34e80620d4634ce9c1f99c200ac917e88 /src/core | |
| parent | HID: Changed TouchDataEntry `valid` to a BitField and added some doc strings. (diff) | |
| download | yuzu-a1a1a5c6c537fa35f914e3bb5deaae48ada95c99.tar.gz yuzu-a1a1a5c6c537fa35f914e3bb5deaae48ada95c99.tar.xz yuzu-a1a1a5c6c537fa35f914e3bb5deaae48ada95c99.zip | |
HID: Cleanup how `next_touch_index` is calculated for Pad and touch.
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/hle/service/hid/hid.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index 72e2d63e3..703a765b5 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp | |||
| @@ -88,7 +88,7 @@ void PadUpdateComplete() { | |||
| 88 | 88 | ||
| 89 | shared_mem->pad.current_state.hex = next_state.hex; | 89 | shared_mem->pad.current_state.hex = next_state.hex; |
| 90 | shared_mem->pad.index = next_pad_index; | 90 | shared_mem->pad.index = next_pad_index; |
| 91 | next_pad_index = (next_pad_index + 1) % shared_mem->pad.entries.size(); | 91 | ++next_touch_index %= shared_mem->pad.entries.size(); |
| 92 | 92 | ||
| 93 | // Get the previous Pad state | 93 | // Get the previous Pad state |
| 94 | u32 last_entry_index = (shared_mem->pad.index - 1) % shared_mem->pad.entries.size(); | 94 | u32 last_entry_index = (shared_mem->pad.index - 1) % shared_mem->pad.entries.size(); |
| @@ -146,7 +146,7 @@ void TouchUpdateComplete() { | |||
| 146 | return; | 146 | return; |
| 147 | 147 | ||
| 148 | shared_mem->touch.index = next_touch_index; | 148 | shared_mem->touch.index = next_touch_index; |
| 149 | next_touch_index = (next_touch_index + 1) % shared_mem->touch.entries.size(); | 149 | ++next_touch_index %= shared_mem->touch.entries.size(); |
| 150 | 150 | ||
| 151 | // Get the current touch entry | 151 | // Get the current touch entry |
| 152 | TouchDataEntry* current_touch_entry = &shared_mem->touch.entries[shared_mem->touch.index]; | 152 | TouchDataEntry* current_touch_entry = &shared_mem->touch.entries[shared_mem->touch.index]; |