Input: fix build

This commit is contained in:
Megamouse 2021-02-12 02:44:26 +01:00
parent f0b7afd7cc
commit 1479468730
5 changed files with 18 additions and 17 deletions

View File

@ -222,6 +222,7 @@ void ds3_pad_handler::check_add_device(hid_device* hidDevice, std::string_view p
hid_close(hidDevice);
return;
}
device->report_id = buf[0];
#endif
{
@ -236,7 +237,6 @@ void ds3_pad_handler::check_add_device(hid_device* hidDevice, std::string_view p
return;
}
device->report_id = buf[0];
device->path = path;
device->hidDevice = hidDevice;

View File

@ -84,9 +84,9 @@ public:
void init_config(pad_config* cfg, const std::string& name) override;
private:
ds3_pad_handler::DataStatus get_data(ds3_device* ds3dev);
int send_output_report(ds3_device* ds3dev);
void check_add_device(hid_device* hidDevice, std::string_view path, std::wstring_view serial);
ds3_pad_handler::DataStatus get_data(ds3_device* ds3dev) override;
int send_output_report(ds3_device* ds3dev) override;
void check_add_device(hid_device* hidDevice, std::string_view path, std::wstring_view serial) override;
bool get_is_left_trigger(u64 keyCode) override;
bool get_is_right_trigger(u64 keyCode) override;

View File

@ -67,13 +67,13 @@ public:
private:
u32 get_battery_color(u8 battery_level, int brightness);
// Copies data into padData if status is NewData, otherwise buffer is untouched
DataStatus get_data(DS4Device* ds4Device);
// This function gets us usuable buffer from the rawbuffer of padData
bool GetCalibrationData(DS4Device* ds4Device);
int send_output_report(DS4Device* device);
void check_add_device(hid_device* hidDevice, std::string_view path, std::wstring_view serial);
// Copies data into padData if status is NewData, otherwise buffer is untouched
DataStatus get_data(DS4Device* ds4Device) override;
int send_output_report(DS4Device* device) override;
void check_add_device(hid_device* hidDevice, std::string_view path, std::wstring_view serial) override;
bool get_is_left_trigger(u64 keyCode) override;
bool get_is_right_trigger(u64 keyCode) override;

View File

@ -69,11 +69,12 @@ public:
void init_config(pad_config* cfg, const std::string& name) override;
private:
DataStatus get_data(DualSenseDevice* dualsenseDevice);
bool get_calibration_data(DualSenseDevice* dualsense_device);
void check_add_device(hid_device* hidDevice, std::string_view path, std::wstring_view wide_serial);
int send_output_report(DualSenseDevice* device);
DataStatus get_data(DualSenseDevice* dualsenseDevice) override;
void check_add_device(hid_device* hidDevice, std::string_view path, std::wstring_view wide_serial) override;
int send_output_report(DualSenseDevice* device) override;
bool get_is_left_trigger(u64 keyCode) override;
bool get_is_right_trigger(u64 keyCode) override;
bool get_is_left_stick(u64 keyCode) override;

View File

@ -28,7 +28,7 @@ hid_pad_handler<Device>::~hid_pad_handler()
if (hid_exit() != 0)
{
hid_log.error("hid_exit failed!");
hid_log.error("%s hid_exit failed!", m_type);
}
}
@ -40,7 +40,7 @@ bool hid_pad_handler<Device>::Init()
const int res = hid_init();
if (res != 0)
fmt::throw_exception("hidapi-init error.threadproc");
fmt::throw_exception("%s hidapi-init error.threadproc", m_type);
for (size_t i = 1; i <= MAX_GAMEPADS; i++) // Controllers 1-n in GUI
{
@ -146,7 +146,7 @@ void hid_pad_handler<Device>::enumerate_devices()
}
else
{
hid_log.error("hid_open_path failed! Reason: %s", hid_error(dev));
hid_log.error("%s hid_open_path failed! Reason: %s", m_type, hid_error(dev));
warn_about_drivers = true;
}
}
@ -154,7 +154,7 @@ void hid_pad_handler<Device>::enumerate_devices()
if (warn_about_drivers)
{
hid_log.error("One or more pads were detected but couldn't be interacted with directly");
hid_log.error("One or more %s pads were detected but couldn't be interacted with directly", m_type);
#if defined(_WIN32) || defined(__linux__)
hid_log.error("Check https://wiki.rpcs3.net/index.php?title=Help:Controller_Configuration for intructions on how to solve this issue");
#endif
@ -164,11 +164,11 @@ void hid_pad_handler<Device>::enumerate_devices()
const size_t count = std::count_if(m_controllers.cbegin(), m_controllers.cend(), [](const auto& c) { return c.second && c.second->hidDevice; });
if (count > 0)
{
hid_log.success("Controllers found: %d", count);
hid_log.success("%s Controllers found: %d", m_type, count);
}
else
{
hid_log.warning("No controllers found!");
hid_log.warning("No %s controllers found!", m_type);
}
}
}