mirror of
https://github.com/AxioDL/boo.git
synced 2025-12-08 21:17:50 +00:00
Add True and False tests for bitwise enums
This commit is contained in:
@@ -68,7 +68,7 @@ void DolphinSmashAdapter::transferCycle() {
|
||||
DolphinControllerState state;
|
||||
bool rumble = false;
|
||||
EDolphinControllerType type = parseState(&state, controller, rumble);
|
||||
if (type != EDolphinControllerType::None && !(m_knownControllers & 1 << i)) {
|
||||
if (True(type) && !(m_knownControllers & 1 << i)) {
|
||||
m_leftStickCal[0] = state.m_leftStick[0];
|
||||
m_leftStickCal[1] = state.m_leftStick[1];
|
||||
m_rightStickCal[0] = state.m_rightStick[0];
|
||||
@@ -77,7 +77,7 @@ void DolphinSmashAdapter::transferCycle() {
|
||||
m_triggersCal[1] = state.m_analogTriggers[1];
|
||||
m_knownControllers |= 1 << i;
|
||||
m_callback->controllerConnected(i, type);
|
||||
} else if (type == EDolphinControllerType::None && (m_knownControllers & 1 << i)) {
|
||||
} else if (False(type) && (m_knownControllers & 1 << i)) {
|
||||
m_knownControllers &= ~(1 << i);
|
||||
m_callback->controllerDisconnected(i);
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ void DualshockPad::receivedHIDReport(const uint8_t* data, size_t length, HIDRepo
|
||||
}
|
||||
|
||||
if (m_rumbleRequest != m_rumbleState) {
|
||||
if ((m_rumbleRequest & EDualshockMotor::Left) != EDualshockMotor::None) {
|
||||
if (True(m_rumbleRequest & EDualshockMotor::Left)) {
|
||||
m_report.rumble.leftDuration = m_rumbleDuration[0];
|
||||
m_report.rumble.leftForce = m_rumbleIntensity[0];
|
||||
} else {
|
||||
@@ -97,7 +97,7 @@ void DualshockPad::receivedHIDReport(const uint8_t* data, size_t length, HIDRepo
|
||||
m_report.rumble.leftForce = 0;
|
||||
}
|
||||
|
||||
if ((m_rumbleRequest & EDualshockMotor::Right) != EDualshockMotor::None) {
|
||||
if (True(m_rumbleRequest & EDualshockMotor::Right)) {
|
||||
m_report.rumble.rightDuration = m_rumbleDuration[1];
|
||||
m_report.rumble.rightOn = m_rumbleIntensity[1] > 0;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user