mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-26 16:52:46 +01:00
controllers/npad: Make press_state atomic
This commit is contained in:
parent
5836786246
commit
54ea3c47c8
2 changed files with 3 additions and 2 deletions
|
@ -1058,7 +1058,7 @@ void Controller_NPad::ClearAllControllers() {
|
|||
}
|
||||
|
||||
u32 Controller_NPad::GetAndResetPressState() {
|
||||
return std::exchange(press_state, 0);
|
||||
return press_state.exchange(0);
|
||||
}
|
||||
|
||||
bool Controller_NPad::IsControllerSupported(NPadControllerType controller) const {
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <atomic>
|
||||
#include "common/bit_field.h"
|
||||
#include "common/common_types.h"
|
||||
#include "core/frontend/input.h"
|
||||
|
@ -415,7 +416,7 @@ private:
|
|||
bool IsControllerSupported(NPadControllerType controller) const;
|
||||
void RequestPadStateUpdate(u32 npad_id);
|
||||
|
||||
u32 press_state{};
|
||||
std::atomic<u32> press_state{};
|
||||
|
||||
NpadStyleSet style{};
|
||||
std::array<NPadEntry, 10> shared_memory_entries{};
|
||||
|
|
Loading…
Reference in a new issue