mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Change ControlState typedef to double, and change all related floats/doubles to use it.
Fixes an off by 1 issue related to double->float->double conversion, and eliminates numerous warnings.
This commit is contained in:
@ -266,7 +266,7 @@ std::string Joystick::Hat::GetName() const
|
||||
|
||||
ControlState Joystick::Axis::GetState() const
|
||||
{
|
||||
return std::max(0.0f, ControlState(m_axis - m_base) / m_range);
|
||||
return std::max(0.0, ControlState(m_axis - m_base) / m_range);
|
||||
}
|
||||
|
||||
ControlState Joystick::Button::GetState() const
|
||||
|
@ -298,12 +298,12 @@ ControlState KeyboardMouse::Button::GetState() const
|
||||
|
||||
ControlState KeyboardMouse::Axis::GetState() const
|
||||
{
|
||||
return std::max(0.0f, ControlState(m_axis) / m_range);
|
||||
return std::max(0.0, ControlState(m_axis) / m_range);
|
||||
}
|
||||
|
||||
ControlState KeyboardMouse::Cursor::GetState() const
|
||||
{
|
||||
return std::max(0.0f, ControlState(m_axis) / (m_positive ? 1.0f : -1.0f));
|
||||
return std::max(0.0, ControlState(m_axis) / (m_positive ? 1.0 : -1.0));
|
||||
}
|
||||
|
||||
void KeyboardMouse::Light::SetState(const ControlState state)
|
||||
|
Reference in New Issue
Block a user