input_engine: Take BasicMotion by const reference with SetMotion() and TriggerOnMotionChange()

Copies the BasicMotion instance once instead of twice.
This commit is contained in:
Lioncash 2021-12-13 09:26:44 -05:00
parent a92dbec962
commit 755822ceec
3 changed files with 7 additions and 6 deletions

View file

@ -88,7 +88,7 @@ public:
return true;
}
BasicMotion GetMotion() {
const BasicMotion& GetMotion() const {
return motion;
}
@ -367,7 +367,7 @@ void SDLDriver::HandleGameControllerEvent(const SDL_Event& event) {
if (joystick->UpdateMotion(event.csensor)) {
const PadIdentifier identifier = joystick->GetPadIdentifier();
SetMotion(identifier, 0, joystick->GetMotion());
};
}
}
break;
}