diff options
| author | Lioncash <mathew1800@gmail.com> | 2021-12-13 09:26:44 -0500 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2021-12-13 09:57:39 -0500 |
| commit | 190cfc5997b1d857a9a858dc74eeeddba783413f (patch) | |
| tree | 2c108925761d939e52b3a5a2c56486b52246c8a9 /src/input_common/drivers/sdl_driver.cpp | |
| parent | e0e9f98fc673c65cf22ef0bdb333b1128b9f2b81 (diff) | |
input_engine: Take BasicMotion by const reference with SetMotion() and TriggerOnMotionChange()
Copies the BasicMotion instance once instead of twice.
Diffstat (limited to 'src/input_common/drivers/sdl_driver.cpp')
| -rw-r--r-- | src/input_common/drivers/sdl_driver.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/input_common/drivers/sdl_driver.cpp b/src/input_common/drivers/sdl_driver.cpp index a9219dbf2a..e33a5ff31f 100644 --- a/src/input_common/drivers/sdl_driver.cpp +++ b/src/input_common/drivers/sdl_driver.cpp @@ -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; } |
