mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-12-23 06:57:08 +00:00
Merge pull request #13963 from jordan-woyak/point-passthru-needs-bound-inputs
WiimoteEmu: Require IRPassthrough has any bound inputs to operate.
This commit is contained in:
commit
efa9245565
@ -497,7 +497,7 @@ void Wiimote::BuildDesiredWiimoteState(DesiredWiimoteState* target_state,
|
|||||||
ConvertAccelData(GetTotalAcceleration(), ACCEL_ZERO_G << 2, ACCEL_ONE_G << 2);
|
ConvertAccelData(GetTotalAcceleration(), ACCEL_ZERO_G << 2, ACCEL_ONE_G << 2);
|
||||||
|
|
||||||
// Calculate IR camera state.
|
// Calculate IR camera state.
|
||||||
if (m_ir_passthrough->enabled.GetValue())
|
if (m_ir_passthrough->enabled.GetValue() && m_ir_passthrough->AreInputsBound())
|
||||||
{
|
{
|
||||||
target_state->camera_points = GetPassthroughCameraPoints(m_ir_passthrough);
|
target_state->camera_points = GetPassthroughCameraPoints(m_ir_passthrough);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,15 +3,12 @@
|
|||||||
|
|
||||||
#include "InputCommon/ControllerEmu/ControlGroup/IRPassthrough.h"
|
#include "InputCommon/ControllerEmu/ControlGroup/IRPassthrough.h"
|
||||||
|
|
||||||
#include <memory>
|
#include <algorithm>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "Common/Common.h"
|
#include "Common/Common.h"
|
||||||
#include "Common/MathUtil.h"
|
|
||||||
|
|
||||||
#include "InputCommon/ControlReference/ControlReference.h"
|
|
||||||
#include "InputCommon/ControllerEmu/Control/Control.h"
|
#include "InputCommon/ControllerEmu/Control/Control.h"
|
||||||
#include "InputCommon/ControllerEmu/Control/Input.h"
|
|
||||||
|
|
||||||
namespace ControllerEmu
|
namespace ControllerEmu
|
||||||
{
|
{
|
||||||
@ -48,4 +45,10 @@ ControlState IRPassthrough::GetObjectSize(size_t object_index) const
|
|||||||
return controls[object_index * 3 + 2]->GetState();
|
return controls[object_index * 3 + 2]->GetState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IRPassthrough::AreInputsBound() const
|
||||||
|
{
|
||||||
|
return std::ranges::any_of(
|
||||||
|
controls, [](const auto& control) { return control->control_ref->BoundCount() > 0; });
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace ControllerEmu
|
} // namespace ControllerEmu
|
||||||
|
|||||||
@ -6,7 +6,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "InputCommon/ControllerEmu/ControlGroup/ControlGroup.h"
|
#include "InputCommon/ControllerEmu/ControlGroup/ControlGroup.h"
|
||||||
#include "InputCommon/ControllerEmu/Setting/NumericSetting.h"
|
|
||||||
#include "InputCommon/ControllerInterface/CoreDevice.h"
|
#include "InputCommon/ControllerInterface/CoreDevice.h"
|
||||||
|
|
||||||
namespace ControllerEmu
|
namespace ControllerEmu
|
||||||
@ -19,5 +18,7 @@ public:
|
|||||||
ControlState GetObjectPositionX(size_t object_index) const;
|
ControlState GetObjectPositionX(size_t object_index) const;
|
||||||
ControlState GetObjectPositionY(size_t object_index) const;
|
ControlState GetObjectPositionY(size_t object_index) const;
|
||||||
ControlState GetObjectSize(size_t object_index) const;
|
ControlState GetObjectSize(size_t object_index) const;
|
||||||
|
|
||||||
|
bool AreInputsBound() const;
|
||||||
};
|
};
|
||||||
} // namespace ControllerEmu
|
} // namespace ControllerEmu
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user