kraken: Fix errors from rebase and format files
This commit is contained in:
parent
06a5ef5874
commit
e0da5c1bbc
20 changed files with 83 additions and 53 deletions
|
@ -322,7 +322,8 @@ bool GCAdapter::GetGCEndpoint(libusb_device* device) {
|
|||
return true;
|
||||
}
|
||||
|
||||
Input::VibrationError GCAdapter::SetRumble(const PadIdentifier& identifier, const Input::VibrationStatus vibration) {
|
||||
Input::VibrationError GCAdapter::SetRumble(const PadIdentifier& identifier,
|
||||
const Input::VibrationStatus vibration) {
|
||||
const auto mean_amplitude = (vibration.low_amplitude + vibration.high_amplitude) * 0.5f;
|
||||
const auto processed_amplitude =
|
||||
static_cast<u8>((mean_amplitude + std::pow(mean_amplitude, 0.3f)) * 0.5f * 0x8);
|
||||
|
|
|
@ -25,7 +25,7 @@ public:
|
|||
~GCAdapter();
|
||||
|
||||
Input::VibrationError SetRumble(const PadIdentifier& identifier,
|
||||
const Input::VibrationStatus vibration) override;
|
||||
const Input::VibrationStatus vibration) override;
|
||||
|
||||
/// Used for automapping features
|
||||
std::vector<Common::ParamPackage> GetInputDevices() const override;
|
||||
|
|
|
@ -59,7 +59,7 @@ public:
|
|||
u8 GetHatButtonId(const std::string direction_name) const override;
|
||||
|
||||
Input::VibrationError SetRumble(const PadIdentifier& identifier,
|
||||
const Input::VibrationStatus vibration) override;
|
||||
const Input::VibrationStatus vibration) override;
|
||||
|
||||
private:
|
||||
void InitJoystick(int joystick_index);
|
||||
|
|
|
@ -251,8 +251,7 @@ private:
|
|||
std::chrono::time_point<std::chrono::steady_clock> last_update;
|
||||
};
|
||||
|
||||
std::unique_ptr<Input::InputDevice> StickFromButton::Create(
|
||||
const Common::ParamPackage& params) {
|
||||
std::unique_ptr<Input::InputDevice> StickFromButton::Create(const Common::ParamPackage& params) {
|
||||
const std::string null_engine = Common::ParamPackage{{"engine", "null"}}.Serialize();
|
||||
auto up = Input::CreateDeviceFromString<Input::InputDevice>(params.Get("up", null_engine));
|
||||
auto down = Input::CreateDeviceFromString<Input::InputDevice>(params.Get("down", null_engine));
|
||||
|
|
|
@ -25,8 +25,7 @@ public:
|
|||
* - "modifier": a serialized ParamPackage for creating a button device as the modifier
|
||||
* - "modifier_scale": a float for the multiplier the modifier gives to the position
|
||||
*/
|
||||
std::unique_ptr<Input::InputDevice> Create(
|
||||
const Common::ParamPackage& params) override;
|
||||
std::unique_ptr<Input::InputDevice> Create(const Common::ParamPackage& params) override;
|
||||
};
|
||||
|
||||
} // namespace InputCommon
|
||||
|
|
|
@ -57,9 +57,7 @@ private:
|
|||
const Input::AnalogProperties properties{0.0f, 1.0f, 0.5f, 0.0f, false};
|
||||
};
|
||||
|
||||
|
||||
std::unique_ptr<Input::InputDevice> TouchFromButton::Create(
|
||||
const Common::ParamPackage& params) {
|
||||
std::unique_ptr<Input::InputDevice> TouchFromButton::Create(const Common::ParamPackage& params) {
|
||||
const std::string null_engine = Common::ParamPackage{{"engine", "null"}}.Serialize();
|
||||
auto button =
|
||||
Input::CreateDeviceFromString<Input::InputDevice>(params.Get("button", null_engine));
|
||||
|
|
|
@ -121,14 +121,16 @@ public:
|
|||
}
|
||||
|
||||
// Sets rumble to a controller
|
||||
virtual Input::VibrationError SetRumble([[maybe_unused]] const PadIdentifier& identifier,
|
||||
[[maybe_unused]] const Input::VibrationStatus vibration) {
|
||||
virtual Input::VibrationError SetRumble(
|
||||
[[maybe_unused]] const PadIdentifier& identifier,
|
||||
[[maybe_unused]] const Input::VibrationStatus vibration) {
|
||||
return Input::VibrationError::NotSupported;
|
||||
}
|
||||
|
||||
// Sets polling mode to a controller
|
||||
virtual Input::PollingError SetPollingMode([[maybe_unused]] const PadIdentifier& identifier,
|
||||
[[maybe_unused]] const Input::PollingMode vibration) {
|
||||
virtual Input::PollingError SetPollingMode(
|
||||
[[maybe_unused]] const PadIdentifier& identifier,
|
||||
[[maybe_unused]] const Input::PollingMode vibration) {
|
||||
return Input::PollingError::NotSupported;
|
||||
}
|
||||
|
||||
|
|
|
@ -597,7 +597,7 @@ public:
|
|||
explicit OutputFromIdentifier(PadIdentifier identifier_, InputEngine* input_engine_)
|
||||
: identifier(identifier_), input_engine(input_engine_) {}
|
||||
|
||||
virtual void SetLED( Input::LedStatus led_status) {
|
||||
virtual void SetLED(Input::LedStatus led_status) {
|
||||
input_engine->SetLeds(identifier, led_status);
|
||||
}
|
||||
|
||||
|
@ -847,8 +847,7 @@ std::unique_ptr<Input::InputDevice> InputFactory::CreateMotionDevice(Common::Par
|
|||
InputFactory::InputFactory(std::shared_ptr<InputEngine> input_engine_)
|
||||
: input_engine(std::move(input_engine_)) {}
|
||||
|
||||
std::unique_ptr<Input::InputDevice> InputFactory::Create(
|
||||
const Common::ParamPackage& params) {
|
||||
std::unique_ptr<Input::InputDevice> InputFactory::Create(const Common::ParamPackage& params) {
|
||||
if (params.Has("button") && params.Has("axis")) {
|
||||
return CreateTriggerDevice(params);
|
||||
}
|
||||
|
@ -883,8 +882,7 @@ std::unique_ptr<Input::InputDevice> InputFactory::Create(
|
|||
OutputFactory::OutputFactory(std::shared_ptr<InputEngine> input_engine_)
|
||||
: input_engine(std::move(input_engine_)) {}
|
||||
|
||||
std::unique_ptr<Input::OutputDevice> OutputFactory::Create(
|
||||
const Common::ParamPackage& params) {
|
||||
std::unique_ptr<Input::OutputDevice> OutputFactory::Create(const Common::ParamPackage& params) {
|
||||
const PadIdentifier identifier = {
|
||||
.guid = Common::UUID{params.Get("guid", "")},
|
||||
.port = static_cast<std::size_t>(params.Get("port", 0)),
|
||||
|
|
|
@ -29,8 +29,7 @@ public:
|
|||
* @param - "pad": slot of the connected controller
|
||||
* @return an unique ouput device with the parameters specified
|
||||
*/
|
||||
std::unique_ptr<Input::OutputDevice> Create(
|
||||
const Common::ParamPackage& params) override;
|
||||
std::unique_ptr<Input::OutputDevice> Create(const Common::ParamPackage& params) override;
|
||||
|
||||
private:
|
||||
std::shared_ptr<InputEngine> input_engine;
|
||||
|
@ -41,8 +40,8 @@ public:
|
|||
explicit InputFactory(std::shared_ptr<InputEngine> input_engine_);
|
||||
|
||||
/**
|
||||
* Creates an input device from the parameters given. Identifies the type of input to be returned
|
||||
* if it contains the following parameters:
|
||||
* Creates an input device from the parameters given. Identifies the type of input to be
|
||||
* returned if it contains the following parameters:
|
||||
* - button: Contains "button" or "code"
|
||||
* - hat_button: Contains "hat"
|
||||
* - analog: Contains "axis"
|
||||
|
@ -65,8 +64,7 @@ public:
|
|||
* @param - "battery": Only used as a placeholder to set the input type
|
||||
* @return an unique input device with the parameters specified
|
||||
*/
|
||||
std::unique_ptr<Input::InputDevice> Create(
|
||||
const Common::ParamPackage& params) override;
|
||||
std::unique_ptr<Input::InputDevice> Create(const Common::ParamPackage& params) override;
|
||||
|
||||
private:
|
||||
/**
|
||||
|
|
|
@ -48,8 +48,10 @@ struct InputSubsystem::Impl {
|
|||
gcadapter->SetMappingCallback(mapping_callback);
|
||||
gcadapter_input_factory = std::make_shared<InputFactory>(gcadapter);
|
||||
gcadapter_output_factory = std::make_shared<OutputFactory>(gcadapter);
|
||||
Input::RegisterFactory<Input::InputDevice>(gcadapter->GetEngineName(), gcadapter_input_factory);
|
||||
Input::RegisterFactory<Input::OutputDevice>(gcadapter->GetEngineName(), gcadapter_output_factory);
|
||||
Input::RegisterFactory<Input::InputDevice>(gcadapter->GetEngineName(),
|
||||
gcadapter_input_factory);
|
||||
Input::RegisterFactory<Input::OutputDevice>(gcadapter->GetEngineName(),
|
||||
gcadapter_output_factory);
|
||||
|
||||
udp_client = std::make_shared<CemuhookUDP::UDPClient>("cemuhookudp");
|
||||
udp_client->SetMappingCallback(mapping_callback);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue