summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bunnei2020-11-16 21:40:16 -0800
committerGravatar GitHub2020-11-16 21:40:16 -0800
commit8ace3959a57a54bedea290e0b1370ae965f74a7d (patch)
treece02144d20896c3ae0ffe75643714467b5901e50
parentMerge pull request #4914 from lat9nq/gl-warnings (diff)
parentmotion_input: Mark constructor as explicit (diff)
downloadyuzu-8ace3959a57a54bedea290e0b1370ae965f74a7d.tar.gz
yuzu-8ace3959a57a54bedea290e0b1370ae965f74a7d.tar.xz
yuzu-8ace3959a57a54bedea290e0b1370ae965f74a7d.zip
Merge pull request #4929 from lioncash/nodiscard-input
motion_input: Mark member functions as [[nodiscard]] where applicable
Diffstat (limited to '')
-rw-r--r--src/input_common/motion_input.h23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/input_common/motion_input.h b/src/input_common/motion_input.h
index abb957f04..efe74cf19 100644
--- a/src/input_common/motion_input.h
+++ b/src/input_common/motion_input.h
@@ -13,7 +13,7 @@ namespace InputCommon {
13 13
14class MotionInput { 14class MotionInput {
15public: 15public:
16 MotionInput(f32 new_kp, f32 new_ki, f32 new_kd); 16 explicit MotionInput(f32 new_kp, f32 new_ki, f32 new_kd);
17 17
18 MotionInput(const MotionInput&) = default; 18 MotionInput(const MotionInput&) = default;
19 MotionInput& operator=(const MotionInput&) = default; 19 MotionInput& operator=(const MotionInput&) = default;
@@ -33,16 +33,17 @@ public:
33 void UpdateRotation(u64 elapsed_time); 33 void UpdateRotation(u64 elapsed_time);
34 void UpdateOrientation(u64 elapsed_time); 34 void UpdateOrientation(u64 elapsed_time);
35 35
36 std::array<Common::Vec3f, 3> GetOrientation() const; 36 [[nodiscard]] std::array<Common::Vec3f, 3> GetOrientation() const;
37 Common::Vec3f GetAcceleration() const; 37 [[nodiscard]] Common::Vec3f GetAcceleration() const;
38 Common::Vec3f GetGyroscope() const; 38 [[nodiscard]] Common::Vec3f GetGyroscope() const;
39 Common::Vec3f GetRotations() const; 39 [[nodiscard]] Common::Vec3f GetRotations() const;
40 Common::Quaternion<f32> GetQuaternion() const; 40 [[nodiscard]] Common::Quaternion<f32> GetQuaternion() const;
41 Input::MotionStatus GetMotion() const; 41 [[nodiscard]] Input::MotionStatus GetMotion() const;
42 Input::MotionStatus GetRandomMotion(int accel_magnitude, int gyro_magnitude) const; 42 [[nodiscard]] Input::MotionStatus GetRandomMotion(int accel_magnitude,
43 43 int gyro_magnitude) const;
44 bool IsMoving(f32 sensitivity) const; 44
45 bool IsCalibrated(f32 sensitivity) const; 45 [[nodiscard]] bool IsMoving(f32 sensitivity) const;
46 [[nodiscard]] bool IsCalibrated(f32 sensitivity) const;
46 47
47private: 48private:
48 void ResetOrientation(); 49 void ResetOrientation();