summaryrefslogtreecommitdiff
path: root/src/input_common/sdl/sdl_impl.cpp
diff options
context:
space:
mode:
authorGravatar Lioncash2020-08-28 20:58:29 -0400
committerGravatar Lioncash2020-08-28 20:58:49 -0400
commit2680526e6ba1240363297c9ec34dbde807229d72 (patch)
treee32bb82e2cba38dbb4c29f5f85add400862a4e3d /src/input_common/sdl/sdl_impl.cpp
parentMerge pull request #4600 from lioncash/prototype (diff)
downloadyuzu-2680526e6ba1240363297c9ec34dbde807229d72.tar.gz
yuzu-2680526e6ba1240363297c9ec34dbde807229d72.tar.xz
yuzu-2680526e6ba1240363297c9ec34dbde807229d72.zip
sdl_impl: Mark FromEvent() as a const member function
This doesn't modify internal member state, so it can be marked as const.
Diffstat (limited to '')
-rw-r--r--src/input_common/sdl/sdl_impl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/input_common/sdl/sdl_impl.cpp b/src/input_common/sdl/sdl_impl.cpp
index c8d9eb2bc..43fac7650 100644
--- a/src/input_common/sdl/sdl_impl.cpp
+++ b/src/input_common/sdl/sdl_impl.cpp
@@ -784,7 +784,7 @@ public:
784 } 784 }
785 return {}; 785 return {};
786 } 786 }
787 std::optional<Common::ParamPackage> FromEvent(const SDL_Event& event) { 787 [[nodiscard]] std::optional<Common::ParamPackage> FromEvent(const SDL_Event& event) const {
788 switch (event.type) { 788 switch (event.type) {
789 case SDL_JOYAXISMOTION: 789 case SDL_JOYAXISMOTION:
790 if (std::abs(event.jaxis.value / 32767.0) < 0.5) { 790 if (std::abs(event.jaxis.value / 32767.0) < 0.5) {
@@ -795,7 +795,7 @@ public:
795 case SDL_JOYHATMOTION: 795 case SDL_JOYHATMOTION:
796 return {SDLEventToButtonParamPackage(state, event)}; 796 return {SDLEventToButtonParamPackage(state, event)};
797 } 797 }
798 return {}; 798 return std::nullopt;
799 } 799 }
800}; 800};
801 801