diff options
| author | 2022-09-24 19:46:49 -0500 | |
|---|---|---|
| committer | 2022-10-02 12:32:26 -0500 | |
| commit | e8d71712e7054748e7e18de9362de1f5a394b46b (patch) | |
| tree | 263779f72b874d81513f1292bb413a2cf170f32d /src/input_common/input_engine.h | |
| parent | Merge pull request #8934 from german77/palma_release (diff) | |
| download | yuzu-e8d71712e7054748e7e18de9362de1f5a394b46b.tar.gz yuzu-e8d71712e7054748e7e18de9362de1f5a394b46b.tar.xz yuzu-e8d71712e7054748e7e18de9362de1f5a394b46b.zip | |
input_common: Create virtual amiibo driver
Diffstat (limited to '')
| -rw-r--r-- | src/input_common/input_engine.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/input_common/input_engine.h b/src/input_common/input_engine.h index f6b3c4610..9b8470c6f 100644 --- a/src/input_common/input_engine.h +++ b/src/input_common/input_engine.h | |||
| @@ -42,6 +42,7 @@ enum class EngineInputType { | |||
| 42 | Camera, | 42 | Camera, |
| 43 | HatButton, | 43 | HatButton, |
| 44 | Motion, | 44 | Motion, |
| 45 | Nfc, | ||
| 45 | }; | 46 | }; |
| 46 | 47 | ||
| 47 | namespace std { | 48 | namespace std { |
| @@ -127,6 +128,17 @@ public: | |||
| 127 | return Common::Input::CameraError::NotSupported; | 128 | return Common::Input::CameraError::NotSupported; |
| 128 | } | 129 | } |
| 129 | 130 | ||
| 131 | // Request nfc data from a controller | ||
| 132 | virtual Common::Input::NfcState SupportsNfc([[maybe_unused]] const PadIdentifier& identifier) { | ||
| 133 | return Common::Input::NfcState::NotSupported; | ||
| 134 | } | ||
| 135 | |||
| 136 | // Writes data to an nfc tag | ||
| 137 | virtual Common::Input::NfcState WriteNfcData([[maybe_unused]] const PadIdentifier& identifier, | ||
| 138 | [[maybe_unused]] const std::vector<u8>& data) { | ||
| 139 | return Common::Input::NfcState::NotSupported; | ||
| 140 | } | ||
| 141 | |||
| 130 | // Returns the engine name | 142 | // Returns the engine name |
| 131 | [[nodiscard]] const std::string& GetEngineName() const; | 143 | [[nodiscard]] const std::string& GetEngineName() const; |
| 132 | 144 | ||
| @@ -183,6 +195,7 @@ public: | |||
| 183 | Common::Input::BatteryLevel GetBattery(const PadIdentifier& identifier) const; | 195 | Common::Input::BatteryLevel GetBattery(const PadIdentifier& identifier) const; |
| 184 | BasicMotion GetMotion(const PadIdentifier& identifier, int motion) const; | 196 | BasicMotion GetMotion(const PadIdentifier& identifier, int motion) const; |
| 185 | Common::Input::CameraStatus GetCamera(const PadIdentifier& identifier) const; | 197 | Common::Input::CameraStatus GetCamera(const PadIdentifier& identifier) const; |
| 198 | Common::Input::NfcStatus GetNfc(const PadIdentifier& identifier) const; | ||
| 186 | 199 | ||
| 187 | int SetCallback(InputIdentifier input_identifier); | 200 | int SetCallback(InputIdentifier input_identifier); |
| 188 | void SetMappingCallback(MappingCallback callback); | 201 | void SetMappingCallback(MappingCallback callback); |
| @@ -195,6 +208,7 @@ protected: | |||
| 195 | void SetBattery(const PadIdentifier& identifier, Common::Input::BatteryLevel value); | 208 | void SetBattery(const PadIdentifier& identifier, Common::Input::BatteryLevel value); |
| 196 | void SetMotion(const PadIdentifier& identifier, int motion, const BasicMotion& value); | 209 | void SetMotion(const PadIdentifier& identifier, int motion, const BasicMotion& value); |
| 197 | void SetCamera(const PadIdentifier& identifier, const Common::Input::CameraStatus& value); | 210 | void SetCamera(const PadIdentifier& identifier, const Common::Input::CameraStatus& value); |
| 211 | void SetNfc(const PadIdentifier& identifier, const Common::Input::NfcStatus& value); | ||
| 198 | 212 | ||
| 199 | virtual std::string GetHatButtonName([[maybe_unused]] u8 direction_value) const { | 213 | virtual std::string GetHatButtonName([[maybe_unused]] u8 direction_value) const { |
| 200 | return "Unknown"; | 214 | return "Unknown"; |
| @@ -208,6 +222,7 @@ private: | |||
| 208 | std::unordered_map<int, BasicMotion> motions; | 222 | std::unordered_map<int, BasicMotion> motions; |
| 209 | Common::Input::BatteryLevel battery{}; | 223 | Common::Input::BatteryLevel battery{}; |
| 210 | Common::Input::CameraStatus camera{}; | 224 | Common::Input::CameraStatus camera{}; |
| 225 | Common::Input::NfcStatus nfc{}; | ||
| 211 | }; | 226 | }; |
| 212 | 227 | ||
| 213 | void TriggerOnButtonChange(const PadIdentifier& identifier, int button, bool value); | 228 | void TriggerOnButtonChange(const PadIdentifier& identifier, int button, bool value); |
| @@ -218,6 +233,7 @@ private: | |||
| 218 | const BasicMotion& value); | 233 | const BasicMotion& value); |
| 219 | void TriggerOnCameraChange(const PadIdentifier& identifier, | 234 | void TriggerOnCameraChange(const PadIdentifier& identifier, |
| 220 | const Common::Input::CameraStatus& value); | 235 | const Common::Input::CameraStatus& value); |
| 236 | void TriggerOnNfcChange(const PadIdentifier& identifier, const Common::Input::NfcStatus& value); | ||
| 221 | 237 | ||
| 222 | bool IsInputIdentifierEqual(const InputIdentifier& input_identifier, | 238 | bool IsInputIdentifierEqual(const InputIdentifier& input_identifier, |
| 223 | const PadIdentifier& identifier, EngineInputType type, | 239 | const PadIdentifier& identifier, EngineInputType type, |