input_engine: Take BasicMotion by const reference with SetMotion() and TriggerOnMotionChange()
Copies the BasicMotion instance once instead of twice.
This commit is contained in:
parent
a92dbec962
commit
755822ceec
3 changed files with 7 additions and 6 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue