|
@@ -36,11 +36,12 @@ struct BasicMotion {
|
|
|
// Types of input that are stored in the engine
|
|
// Types of input that are stored in the engine
|
|
|
enum class EngineInputType {
|
|
enum class EngineInputType {
|
|
|
None,
|
|
None,
|
|
|
|
|
+ Analog,
|
|
|
|
|
+ Battery,
|
|
|
Button,
|
|
Button,
|
|
|
|
|
+ Camera,
|
|
|
HatButton,
|
|
HatButton,
|
|
|
- Analog,
|
|
|
|
|
Motion,
|
|
Motion,
|
|
|
- Battery,
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
namespace std {
|
|
namespace std {
|
|
@@ -115,10 +116,17 @@ public:
|
|
|
// Sets polling mode to a controller
|
|
// Sets polling mode to a controller
|
|
|
virtual Common::Input::PollingError SetPollingMode(
|
|
virtual Common::Input::PollingError SetPollingMode(
|
|
|
[[maybe_unused]] const PadIdentifier& identifier,
|
|
[[maybe_unused]] const PadIdentifier& identifier,
|
|
|
- [[maybe_unused]] const Common::Input::PollingMode vibration) {
|
|
|
|
|
|
|
+ [[maybe_unused]] const Common::Input::PollingMode polling_mode) {
|
|
|
return Common::Input::PollingError::NotSupported;
|
|
return Common::Input::PollingError::NotSupported;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // Sets camera format to a controller
|
|
|
|
|
+ virtual Common::Input::CameraError SetCameraFormat(
|
|
|
|
|
+ [[maybe_unused]] const PadIdentifier& identifier,
|
|
|
|
|
+ [[maybe_unused]] Common::Input::CameraFormat camera_format) {
|
|
|
|
|
+ return Common::Input::CameraError::NotSupported;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// Returns the engine name
|
|
// Returns the engine name
|
|
|
[[nodiscard]] const std::string& GetEngineName() const;
|
|
[[nodiscard]] const std::string& GetEngineName() const;
|
|
|
|
|
|
|
@@ -174,6 +182,7 @@ public:
|
|
|
f32 GetAxis(const PadIdentifier& identifier, int axis) const;
|
|
f32 GetAxis(const PadIdentifier& identifier, int axis) const;
|
|
|
Common::Input::BatteryLevel GetBattery(const PadIdentifier& identifier) const;
|
|
Common::Input::BatteryLevel GetBattery(const PadIdentifier& identifier) const;
|
|
|
BasicMotion GetMotion(const PadIdentifier& identifier, int motion) const;
|
|
BasicMotion GetMotion(const PadIdentifier& identifier, int motion) const;
|
|
|
|
|
+ Common::Input::CameraStatus GetCamera(const PadIdentifier& identifier) const;
|
|
|
|
|
|
|
|
int SetCallback(InputIdentifier input_identifier);
|
|
int SetCallback(InputIdentifier input_identifier);
|
|
|
void SetMappingCallback(MappingCallback callback);
|
|
void SetMappingCallback(MappingCallback callback);
|
|
@@ -185,6 +194,7 @@ protected:
|
|
|
void SetAxis(const PadIdentifier& identifier, int axis, f32 value);
|
|
void SetAxis(const PadIdentifier& identifier, int axis, f32 value);
|
|
|
void SetBattery(const PadIdentifier& identifier, Common::Input::BatteryLevel value);
|
|
void SetBattery(const PadIdentifier& identifier, Common::Input::BatteryLevel value);
|
|
|
void SetMotion(const PadIdentifier& identifier, int motion, const BasicMotion& value);
|
|
void SetMotion(const PadIdentifier& identifier, int motion, const BasicMotion& value);
|
|
|
|
|
+ void SetCamera(const PadIdentifier& identifier, const Common::Input::CameraStatus& value);
|
|
|
|
|
|
|
|
virtual std::string GetHatButtonName([[maybe_unused]] u8 direction_value) const {
|
|
virtual std::string GetHatButtonName([[maybe_unused]] u8 direction_value) const {
|
|
|
return "Unknown";
|
|
return "Unknown";
|
|
@@ -197,6 +207,7 @@ private:
|
|
|
std::unordered_map<int, float> axes;
|
|
std::unordered_map<int, float> axes;
|
|
|
std::unordered_map<int, BasicMotion> motions;
|
|
std::unordered_map<int, BasicMotion> motions;
|
|
|
Common::Input::BatteryLevel battery{};
|
|
Common::Input::BatteryLevel battery{};
|
|
|
|
|
+ Common::Input::CameraStatus camera{};
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
void TriggerOnButtonChange(const PadIdentifier& identifier, int button, bool value);
|
|
void TriggerOnButtonChange(const PadIdentifier& identifier, int button, bool value);
|
|
@@ -205,6 +216,8 @@ private:
|
|
|
void TriggerOnBatteryChange(const PadIdentifier& identifier, Common::Input::BatteryLevel value);
|
|
void TriggerOnBatteryChange(const PadIdentifier& identifier, Common::Input::BatteryLevel value);
|
|
|
void TriggerOnMotionChange(const PadIdentifier& identifier, int motion,
|
|
void TriggerOnMotionChange(const PadIdentifier& identifier, int motion,
|
|
|
const BasicMotion& value);
|
|
const BasicMotion& value);
|
|
|
|
|
+ void TriggerOnCameraChange(const PadIdentifier& identifier,
|
|
|
|
|
+ const Common::Input::CameraStatus& value);
|
|
|
|
|
|
|
|
bool IsInputIdentifierEqual(const InputIdentifier& input_identifier,
|
|
bool IsInputIdentifierEqual(const InputIdentifier& input_identifier,
|
|
|
const PadIdentifier& identifier, EngineInputType type,
|
|
const PadIdentifier& identifier, EngineInputType type,
|