summaryrefslogtreecommitdiff
path: root/src/input_common/drivers/sdl_driver.cpp
diff options
context:
space:
mode:
authorGravatar Lioncash2021-12-13 09:26:44 -0500
committerGravatar Lioncash2021-12-13 09:57:39 -0500
commit755822ceecf2a261a09f486706955bebc23d3917 (patch)
tree2c108925761d939e52b3a5a2c56486b52246c8a9 /src/input_common/drivers/sdl_driver.cpp
parentinput_engine: std::move InputIdentifier in SetCallback() (diff)
downloadyuzu-755822ceecf2a261a09f486706955bebc23d3917.tar.gz
yuzu-755822ceecf2a261a09f486706955bebc23d3917.tar.xz
yuzu-755822ceecf2a261a09f486706955bebc23d3917.zip
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.cpp4
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 a9219dbf2..e33a5ff31 100644
--- a/src/input_common/drivers/sdl_driver.cpp
+++ b/src/input_common/drivers/sdl_driver.cpp
@@ -88,7 +88,7 @@ public:
88 return true; 88 return true;
89 } 89 }
90 90
91 BasicMotion GetMotion() { 91 const BasicMotion& GetMotion() const {
92 return motion; 92 return motion;
93 } 93 }
94 94
@@ -367,7 +367,7 @@ void SDLDriver::HandleGameControllerEvent(const SDL_Event& event) {
367 if (joystick->UpdateMotion(event.csensor)) { 367 if (joystick->UpdateMotion(event.csensor)) {
368 const PadIdentifier identifier = joystick->GetPadIdentifier(); 368 const PadIdentifier identifier = joystick->GetPadIdentifier();
369 SetMotion(identifier, 0, joystick->GetMotion()); 369 SetMotion(identifier, 0, joystick->GetMotion());
370 }; 370 }
371 } 371 }
372 break; 372 break;
373 } 373 }