mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-31 13:18:50 +00:00
Merge pull request #2199 from skidau/remove-controls-lock
Cleaned up the controller locking mechanism
This commit is contained in:
commit
a86f2fe2e7
8 changed files with 0 additions and 41 deletions
|
@ -55,8 +55,6 @@ void GetStatus(u8 _port, KeyboardStatus* _pKeyboardStatus)
|
|||
memset(_pKeyboardStatus, 0, sizeof(*_pKeyboardStatus));
|
||||
_pKeyboardStatus->err = PAD_ERR_NONE;
|
||||
|
||||
std::unique_lock<std::recursive_mutex> lk(s_config.controls_lock, std::try_to_lock);
|
||||
|
||||
// get input
|
||||
((GCKeyboard*)s_config.controllers[_port])->GetInput(_pKeyboardStatus);
|
||||
}
|
||||
|
|
|
@ -57,26 +57,17 @@ void GetStatus(u8 _numPAD, GCPadStatus* _pPADStatus)
|
|||
memset(_pPADStatus, 0, sizeof(*_pPADStatus));
|
||||
_pPADStatus->err = PAD_ERR_NONE;
|
||||
|
||||
std::unique_lock<std::recursive_mutex> lk(s_config.controls_lock, std::try_to_lock);
|
||||
|
||||
|
||||
// get input
|
||||
((GCPad*)s_config.controllers[_numPAD])->GetInput(_pPADStatus);
|
||||
}
|
||||
|
||||
void Rumble(u8 _numPAD, const ControlState strength)
|
||||
{
|
||||
std::unique_lock<std::recursive_mutex> lk(s_config.controls_lock, std::try_to_lock);
|
||||
|
||||
((GCPad*)s_config.controllers[ _numPAD ])->SetOutput(strength);
|
||||
}
|
||||
|
||||
bool GetMicButton(u8 pad)
|
||||
{
|
||||
|
||||
std::unique_lock<std::recursive_mutex> lk(s_config.controls_lock, std::try_to_lock);
|
||||
|
||||
|
||||
return ((GCPad*)s_config.controllers[pad])->GetMicButton();
|
||||
}
|
||||
|
||||
|
|
|
@ -118,9 +118,6 @@ void Update(int _number)
|
|||
{
|
||||
//PanicAlert( "Wiimote_Update" );
|
||||
|
||||
// TODO: change this to a try_to_lock, and make it give empty input on failure
|
||||
std::unique_lock<std::recursive_mutex> lk(s_config.controls_lock, std::try_to_lock);
|
||||
|
||||
if (WIIMOTE_SRC_EMU & g_wiimote_sources[_number])
|
||||
((WiimoteEmu::Wiimote*)s_config.controllers[_number])->Update();
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue