Merge pull request #1111 from Tilka/fix_gcpad_setmotor

Fix GCPad::SetMotor()
This commit is contained in:
skidau 2014-09-19 13:26:05 +10:00
commit bd740ae9c7

View file

@ -122,11 +122,8 @@ void GCPad::GetInput(GCPadStatus* const pad)
void GCPad::SetMotor(const u8 on)
{
ControlState state = static_cast<ControlState>(on) / 255;
ControlState force = abs(state - 0.5) * 2;
if (state < 0.5)
force = -force;
// map 0..255 to -1.0..1.0
ControlState force = on / 127.5 - 1;
m_rumble->controls[0]->control_ref->State(force);
}