core/hid: Rework battery mappings
This commit is contained in:
parent
c6c32daf40
commit
064ddacf49
|
@ -87,11 +87,23 @@ void EmulatedController::ReloadFromSettings() {
|
||||||
|
|
||||||
ReloadInput();
|
ReloadInput();
|
||||||
}
|
}
|
||||||
|
void EmulatedController::LoadDevices() {
|
||||||
|
const auto left_joycon = button_params[Settings::NativeButton::ZL];
|
||||||
|
const auto right_joycon = button_params[Settings::NativeButton::ZR];
|
||||||
|
|
||||||
void EmulatedController::ReloadInput() {
|
// Triggers for GC controllers
|
||||||
// If you load any device here add the equivalent to the UnloadInput() function
|
trigger_params[LeftIndex] = button_params[Settings::NativeButton::ZL];
|
||||||
const auto left_side = button_params[Settings::NativeButton::ZL];
|
trigger_params[RightIndex] = button_params[Settings::NativeButton::ZR];
|
||||||
const auto right_side = button_params[Settings::NativeButton::ZR];
|
|
||||||
|
battery_params[LeftIndex] = left_joycon;
|
||||||
|
battery_params[RightIndex] = right_joycon;
|
||||||
|
battery_params[LeftIndex].Set("battery", true);
|
||||||
|
battery_params[RightIndex].Set("battery", true);
|
||||||
|
|
||||||
|
output_params[LeftIndex] = left_joycon;
|
||||||
|
output_params[RightIndex] = right_joycon;
|
||||||
|
output_params[LeftIndex].Set("output", true);
|
||||||
|
output_params[RightIndex].Set("output", true);
|
||||||
|
|
||||||
std::transform(button_params.begin() + Settings::NativeButton::BUTTON_HID_BEGIN,
|
std::transform(button_params.begin() + Settings::NativeButton::BUTTON_HID_BEGIN,
|
||||||
button_params.begin() + Settings::NativeButton::BUTTON_NS_END,
|
button_params.begin() + Settings::NativeButton::BUTTON_NS_END,
|
||||||
|
@ -102,19 +114,17 @@ void EmulatedController::ReloadInput() {
|
||||||
std::transform(motion_params.begin() + Settings::NativeMotion::MOTION_HID_BEGIN,
|
std::transform(motion_params.begin() + Settings::NativeMotion::MOTION_HID_BEGIN,
|
||||||
motion_params.begin() + Settings::NativeMotion::MOTION_HID_END,
|
motion_params.begin() + Settings::NativeMotion::MOTION_HID_END,
|
||||||
motion_devices.begin(), Input::CreateDevice<Input::InputDevice>);
|
motion_devices.begin(), Input::CreateDevice<Input::InputDevice>);
|
||||||
|
std::transform(trigger_params.begin(), trigger_params.end(), trigger_devices.begin(),
|
||||||
|
Input::CreateDevice<Input::InputDevice>);
|
||||||
|
std::transform(battery_params.begin(), battery_params.begin(), battery_devices.end(),
|
||||||
|
Input::CreateDevice<Input::InputDevice>);
|
||||||
|
std::transform(output_params.begin(), output_params.end(), output_devices.begin(),
|
||||||
|
Input::CreateDevice<Input::OutputDevice>);
|
||||||
|
}
|
||||||
|
|
||||||
trigger_devices[0] =
|
void EmulatedController::ReloadInput() {
|
||||||
Input::CreateDevice<Input::InputDevice>(button_params[Settings::NativeButton::ZL]);
|
// If you load any device here add the equivalent to the UnloadInput() function
|
||||||
trigger_devices[1] =
|
LoadDevices();
|
||||||
Input::CreateDevice<Input::InputDevice>(button_params[Settings::NativeButton::ZR]);
|
|
||||||
|
|
||||||
battery_devices[0] = Input::CreateDevice<Input::InputDevice>(left_side);
|
|
||||||
battery_devices[1] = Input::CreateDevice<Input::InputDevice>(right_side);
|
|
||||||
|
|
||||||
button_params[Settings::NativeButton::ZL].Set("output", true);
|
|
||||||
output_devices[0] =
|
|
||||||
Input::CreateDevice<Input::OutputDevice>(button_params[Settings::NativeButton::ZL]);
|
|
||||||
|
|
||||||
for (std::size_t index = 0; index < button_devices.size(); ++index) {
|
for (std::size_t index = 0; index < button_devices.size(); ++index) {
|
||||||
if (!button_devices[index]) {
|
if (!button_devices[index]) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -241,7 +251,7 @@ void EmulatedController::RestoreConfig() {
|
||||||
ReloadFromSettings();
|
ReloadFromSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<Common::ParamPackage> EmulatedController::GetMappedDevices() const {
|
std::vector<Common::ParamPackage> EmulatedController::GetMappedDevices(DeviceIndex device_index) const {
|
||||||
std::vector<Common::ParamPackage> devices;
|
std::vector<Common::ParamPackage> devices;
|
||||||
for (const auto& param : button_params) {
|
for (const auto& param : button_params) {
|
||||||
if (!param.Has("engine")) {
|
if (!param.Has("engine")) {
|
||||||
|
@ -612,21 +622,21 @@ void EmulatedController::SetBattery(Input::CallbackStatus callback, std::size_t
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (index) {
|
switch (index) {
|
||||||
case 0:
|
case LeftIndex:
|
||||||
controller.battery_state.left = {
|
controller.battery_state.left = {
|
||||||
.is_powered = is_powered,
|
.is_powered = is_powered,
|
||||||
.is_charging = is_charging,
|
.is_charging = is_charging,
|
||||||
.battery_level = battery_level,
|
.battery_level = battery_level,
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case 1:
|
case RightIndex:
|
||||||
controller.battery_state.right = {
|
controller.battery_state.right = {
|
||||||
.is_powered = is_powered,
|
.is_powered = is_powered,
|
||||||
.is_charging = is_charging,
|
.is_charging = is_charging,
|
||||||
.battery_level = battery_level,
|
.battery_level = battery_level,
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case 2:
|
case DualIndex:
|
||||||
controller.battery_state.dual = {
|
controller.battery_state.dual = {
|
||||||
.is_powered = is_powered,
|
.is_powered = is_powered,
|
||||||
.is_charging = is_charging,
|
.is_charging = is_charging,
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
#include "core/hid/motion_input.h"
|
#include "core/hid/motion_input.h"
|
||||||
|
|
||||||
namespace Core::HID {
|
namespace Core::HID {
|
||||||
|
const std::size_t max_emulated_controllers = 2;
|
||||||
struct ControllerMotionInfo {
|
struct ControllerMotionInfo {
|
||||||
Input::MotionStatus raw_status{};
|
Input::MotionStatus raw_status{};
|
||||||
MotionInput emulated{};
|
MotionInput emulated{};
|
||||||
|
@ -32,23 +32,23 @@ using ControllerMotionDevices =
|
||||||
std::array<std::unique_ptr<Input::InputDevice>, Settings::NativeMotion::NumMotions>;
|
std::array<std::unique_ptr<Input::InputDevice>, Settings::NativeMotion::NumMotions>;
|
||||||
using TriggerDevices =
|
using TriggerDevices =
|
||||||
std::array<std::unique_ptr<Input::InputDevice>, Settings::NativeTrigger::NumTriggers>;
|
std::array<std::unique_ptr<Input::InputDevice>, Settings::NativeTrigger::NumTriggers>;
|
||||||
using BatteryDevices = std::array<std::unique_ptr<Input::InputDevice>, 2>;
|
using BatteryDevices = std::array<std::unique_ptr<Input::InputDevice>, max_emulated_controllers>;
|
||||||
using OutputDevices = std::array<std::unique_ptr<Input::OutputDevice>, 2>;
|
using OutputDevices = std::array<std::unique_ptr<Input::OutputDevice>, max_emulated_controllers>;
|
||||||
|
|
||||||
using ButtonParams = std::array<Common::ParamPackage, Settings::NativeButton::NumButtons>;
|
using ButtonParams = std::array<Common::ParamPackage, Settings::NativeButton::NumButtons>;
|
||||||
using StickParams = std::array<Common::ParamPackage, Settings::NativeAnalog::NumAnalogs>;
|
using StickParams = std::array<Common::ParamPackage, Settings::NativeAnalog::NumAnalogs>;
|
||||||
using ControllerMotionParams = std::array<Common::ParamPackage, Settings::NativeMotion::NumMotions>;
|
using ControllerMotionParams = std::array<Common::ParamPackage, Settings::NativeMotion::NumMotions>;
|
||||||
using TriggerParams = std::array<Common::ParamPackage, Settings::NativeTrigger::NumTriggers>;
|
using TriggerParams = std::array<Common::ParamPackage, Settings::NativeTrigger::NumTriggers>;
|
||||||
using BatteryParams = std::array<Common::ParamPackage, 2>;
|
using BatteryParams = std::array<Common::ParamPackage, max_emulated_controllers>;
|
||||||
using OutputParams = std::array<Common::ParamPackage, 2>;
|
using OutputParams = std::array<Common::ParamPackage, max_emulated_controllers>;
|
||||||
|
|
||||||
using ButtonValues = std::array<Input::ButtonStatus, Settings::NativeButton::NumButtons>;
|
using ButtonValues = std::array<Input::ButtonStatus, Settings::NativeButton::NumButtons>;
|
||||||
using SticksValues = std::array<Input::StickStatus, Settings::NativeAnalog::NumAnalogs>;
|
using SticksValues = std::array<Input::StickStatus, Settings::NativeAnalog::NumAnalogs>;
|
||||||
using TriggerValues = std::array<Input::TriggerStatus, Settings::NativeTrigger::NumTriggers>;
|
using TriggerValues = std::array<Input::TriggerStatus, Settings::NativeTrigger::NumTriggers>;
|
||||||
using ControllerMotionValues = std::array<ControllerMotionInfo, Settings::NativeMotion::NumMotions>;
|
using ControllerMotionValues = std::array<ControllerMotionInfo, Settings::NativeMotion::NumMotions>;
|
||||||
using ColorValues = std::array<Input::BodyColorStatus, 3>;
|
using ColorValues = std::array<Input::BodyColorStatus, max_emulated_controllers>;
|
||||||
using BatteryValues = std::array<Input::BatteryStatus, 3>;
|
using BatteryValues = std::array<Input::BatteryStatus, max_emulated_controllers>;
|
||||||
using VibrationValues = std::array<Input::VibrationStatus, 2>;
|
using VibrationValues = std::array<Input::VibrationStatus, max_emulated_controllers>;
|
||||||
|
|
||||||
struct AnalogSticks {
|
struct AnalogSticks {
|
||||||
AnalogStickState left{};
|
AnalogStickState left{};
|
||||||
|
@ -75,6 +75,13 @@ struct ControllerMotion {
|
||||||
bool is_at_rest{};
|
bool is_at_rest{};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum DeviceIndex : u8 {
|
||||||
|
LeftIndex,
|
||||||
|
RightIndex,
|
||||||
|
DualIndex,
|
||||||
|
AllDevices,
|
||||||
|
};
|
||||||
|
|
||||||
using MotionState = std::array<ControllerMotion, 2>;
|
using MotionState = std::array<ControllerMotion, 2>;
|
||||||
|
|
||||||
struct ControllerStatus {
|
struct ControllerStatus {
|
||||||
|
@ -189,7 +196,7 @@ public:
|
||||||
void RestoreConfig();
|
void RestoreConfig();
|
||||||
|
|
||||||
/// Returns a vector of mapped devices from the mapped button and stick parameters
|
/// Returns a vector of mapped devices from the mapped button and stick parameters
|
||||||
std::vector<Common::ParamPackage> GetMappedDevices() const;
|
std::vector<Common::ParamPackage> GetMappedDevices(DeviceIndex device_index) const;
|
||||||
|
|
||||||
// Returns the current mapped button device
|
// Returns the current mapped button device
|
||||||
Common::ParamPackage GetButtonParam(std::size_t index) const;
|
Common::ParamPackage GetButtonParam(std::size_t index) const;
|
||||||
|
@ -289,6 +296,9 @@ public:
|
||||||
void DeleteCallback(int key);
|
void DeleteCallback(int key);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// creates input devices from params
|
||||||
|
void LoadDevices();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the button status of the controller
|
* Updates the button status of the controller
|
||||||
* @param callback: A CallbackStatus containing the button status
|
* @param callback: A CallbackStatus containing the button status
|
||||||
|
|
|
@ -174,7 +174,7 @@ void EmulatedDevices::UpdateKey(std::size_t key_index, bool status) {
|
||||||
if (status) {
|
if (status) {
|
||||||
entry = entry | mask;
|
entry = entry | mask;
|
||||||
} else {
|
} else {
|
||||||
entry = entry & ~mask;
|
entry = static_cast<u8>(entry & ~mask);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,10 @@ Input::BatteryStatus TransformToBattery(const Input::CallbackStatus& callback) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case Input::InputType::Button:
|
||||||
|
battery = callback.button_status.value ? Input::BatteryLevel::Charging
|
||||||
|
: Input::BatteryLevel::Critical;
|
||||||
|
break;
|
||||||
case Input::InputType::Battery:
|
case Input::InputType::Battery:
|
||||||
battery = callback.battery_status;
|
battery = callback.battery_status;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -101,8 +101,9 @@ Controller_NPad::Controller_NPad(Core::System& system_,
|
||||||
for (std::size_t i = 0; i < controller_data.size(); ++i) {
|
for (std::size_t i = 0; i < controller_data.size(); ++i) {
|
||||||
auto& controller = controller_data[i];
|
auto& controller = controller_data[i];
|
||||||
controller.device = system.HIDCore().GetEmulatedControllerByIndex(i);
|
controller.device = system.HIDCore().GetEmulatedControllerByIndex(i);
|
||||||
controller.vibration[0].latest_vibration_value = DEFAULT_VIBRATION_VALUE;
|
controller.vibration[Core::HID::DeviceIndex::LeftIndex].latest_vibration_value = DEFAULT_VIBRATION_VALUE;
|
||||||
controller.vibration[1].latest_vibration_value = DEFAULT_VIBRATION_VALUE;
|
controller.vibration[Core::HID::DeviceIndex::RightIndex].latest_vibration_value =
|
||||||
|
DEFAULT_VIBRATION_VALUE;
|
||||||
Core::HID::ControllerUpdateCallback engine_callback{
|
Core::HID::ControllerUpdateCallback engine_callback{
|
||||||
.on_change = [this,
|
.on_change = [this,
|
||||||
i](Core::HID::ControllerTriggerType type) { ControllerUpdate(type, i); },
|
i](Core::HID::ControllerTriggerType type) { ControllerUpdate(type, i); },
|
||||||
|
@ -285,9 +286,12 @@ void Controller_NPad::OnInit() {
|
||||||
auto& npad = controller.shared_memory_entry;
|
auto& npad = controller.shared_memory_entry;
|
||||||
npad.fullkey_color = {
|
npad.fullkey_color = {
|
||||||
.attribute = ColorAttribute::NoController,
|
.attribute = ColorAttribute::NoController,
|
||||||
|
.fullkey = {},
|
||||||
};
|
};
|
||||||
npad.joycon_color = {
|
npad.joycon_color = {
|
||||||
.attribute = ColorAttribute::NoController,
|
.attribute = ColorAttribute::NoController,
|
||||||
|
.left = {},
|
||||||
|
.right = {},
|
||||||
};
|
};
|
||||||
// HW seems to initialize the first 19 entries
|
// HW seems to initialize the first 19 entries
|
||||||
for (std::size_t i = 0; i < 19; ++i) {
|
for (std::size_t i = 0; i < 19; ++i) {
|
||||||
|
@ -907,9 +911,12 @@ void Controller_NPad::DisconnectNpadAtIndex(std::size_t npad_index) {
|
||||||
shared_memory_entry.battery_level_right = 0;
|
shared_memory_entry.battery_level_right = 0;
|
||||||
shared_memory_entry.fullkey_color = {
|
shared_memory_entry.fullkey_color = {
|
||||||
.attribute = ColorAttribute::NoController,
|
.attribute = ColorAttribute::NoController,
|
||||||
|
.fullkey = {},
|
||||||
};
|
};
|
||||||
shared_memory_entry.joycon_color = {
|
shared_memory_entry.joycon_color = {
|
||||||
.attribute = ColorAttribute::NoController,
|
.attribute = ColorAttribute::NoController,
|
||||||
|
.left = {},
|
||||||
|
.right = {},
|
||||||
};
|
};
|
||||||
shared_memory_entry.assignment_mode = NpadJoyAssignmentMode::Dual;
|
shared_memory_entry.assignment_mode = NpadJoyAssignmentMode::Dual;
|
||||||
shared_memory_entry.footer_type = AppletFooterUiType::None;
|
shared_memory_entry.footer_type = AppletFooterUiType::None;
|
||||||
|
|
|
@ -200,7 +200,7 @@ public:
|
||||||
TriggerOnChange(status);
|
TriggerOnChange(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ForceUpdate() override{
|
void ForceUpdate() override {
|
||||||
up->ForceUpdate();
|
up->ForceUpdate();
|
||||||
down->ForceUpdate();
|
down->ForceUpdate();
|
||||||
left->ForceUpdate();
|
left->ForceUpdate();
|
||||||
|
|
|
@ -183,6 +183,17 @@ public:
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ForceUpdate() {
|
||||||
|
const Input::CallbackStatus status{
|
||||||
|
.type = Input::InputType::Stick,
|
||||||
|
.stick_status = GetStatus(),
|
||||||
|
};
|
||||||
|
|
||||||
|
last_axis_x_value = status.stick_status.x.raw_value;
|
||||||
|
last_axis_y_value = status.stick_status.y.raw_value;
|
||||||
|
TriggerOnChange(status);
|
||||||
|
}
|
||||||
|
|
||||||
void OnChange() {
|
void OnChange() {
|
||||||
const Input::CallbackStatus status{
|
const Input::CallbackStatus status{
|
||||||
.type = Input::InputType::Stick,
|
.type = Input::InputType::Stick,
|
||||||
|
@ -448,6 +459,16 @@ public:
|
||||||
return static_cast<Input::BatteryLevel>(input_engine->GetBattery(identifier));
|
return static_cast<Input::BatteryLevel>(input_engine->GetBattery(identifier));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ForceUpdate() {
|
||||||
|
const Input::CallbackStatus status{
|
||||||
|
.type = Input::InputType::Battery,
|
||||||
|
.battery_status = GetStatus(),
|
||||||
|
};
|
||||||
|
|
||||||
|
last_battery_value = status.battery_status;
|
||||||
|
TriggerOnChange(status);
|
||||||
|
}
|
||||||
|
|
||||||
void OnChange() {
|
void OnChange() {
|
||||||
const Input::CallbackStatus status{
|
const Input::CallbackStatus status{
|
||||||
.type = Input::InputType::Battery,
|
.type = Input::InputType::Battery,
|
||||||
|
@ -579,6 +600,18 @@ public:
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ForceUpdate() {
|
||||||
|
const Input::CallbackStatus status{
|
||||||
|
.type = Input::InputType::Motion,
|
||||||
|
.motion_status = GetStatus(),
|
||||||
|
};
|
||||||
|
|
||||||
|
last_axis_x_value = status.motion_status.gyro.x.raw_value;
|
||||||
|
last_axis_y_value = status.motion_status.gyro.y.raw_value;
|
||||||
|
last_axis_z_value = status.motion_status.gyro.z.raw_value;
|
||||||
|
TriggerOnChange(status);
|
||||||
|
}
|
||||||
|
|
||||||
void OnChange() {
|
void OnChange() {
|
||||||
const Input::CallbackStatus status{
|
const Input::CallbackStatus status{
|
||||||
.type = Input::InputType::Motion,
|
.type = Input::InputType::Motion,
|
||||||
|
@ -868,6 +901,9 @@ InputFactory::InputFactory(std::shared_ptr<InputEngine> input_engine_)
|
||||||
: input_engine(std::move(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("battery")) {
|
||||||
|
return CreateBatteryDevice(params);
|
||||||
|
}
|
||||||
if (params.Has("button") && params.Has("axis")) {
|
if (params.Has("button") && params.Has("axis")) {
|
||||||
return CreateTriggerDevice(params);
|
return CreateTriggerDevice(params);
|
||||||
}
|
}
|
||||||
|
@ -892,9 +928,6 @@ std::unique_ptr<Input::InputDevice> InputFactory::Create(const Common::ParamPack
|
||||||
if (params.Has("axis")) {
|
if (params.Has("axis")) {
|
||||||
return CreateAnalogDevice(params);
|
return CreateAnalogDevice(params);
|
||||||
}
|
}
|
||||||
if (params.Has("battery")) {
|
|
||||||
return CreateBatteryDevice(params);
|
|
||||||
}
|
|
||||||
LOG_ERROR(Input, "Invalid parameters given");
|
LOG_ERROR(Input, "Invalid parameters given");
|
||||||
return std::make_unique<DummyInput>();
|
return std::make_unique<DummyInput>();
|
||||||
}
|
}
|
||||||
|
|
|
@ -630,7 +630,7 @@ void ConfigureInputPlayer::UpdateInputDeviceCombobox() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto devices = emulated_controller->GetMappedDevices();
|
const auto devices = emulated_controller->GetMappedDevices(Core::HID::DeviceIndex::AllDevices);
|
||||||
UpdateInputDevices();
|
UpdateInputDevices();
|
||||||
|
|
||||||
if (devices.empty()) {
|
if (devices.empty()) {
|
||||||
|
|
|
@ -356,7 +356,7 @@ void PlayerControlPreview::DrawLeftController(QPainter& p, const QPointF center)
|
||||||
DrawCircle(p, center + QPoint(26, 71), 5);
|
DrawCircle(p, center + QPoint(26, 71), 5);
|
||||||
|
|
||||||
// Draw battery
|
// Draw battery
|
||||||
DrawBattery(p, center + QPoint(-170, -140), battery_values[0]);
|
DrawBattery(p, center + QPoint(-170, -140), battery_values[Core::HID::DeviceIndex::LeftIndex]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayerControlPreview::DrawRightController(QPainter& p, const QPointF center) {
|
void PlayerControlPreview::DrawRightController(QPainter& p, const QPointF center) {
|
||||||
|
@ -482,7 +482,7 @@ void PlayerControlPreview::DrawRightController(QPainter& p, const QPointF center
|
||||||
DrawSymbol(p, center + QPoint(-26, 66), Symbol::House, 5);
|
DrawSymbol(p, center + QPoint(-26, 66), Symbol::House, 5);
|
||||||
|
|
||||||
// Draw battery
|
// Draw battery
|
||||||
DrawBattery(p, center + QPoint(110, -140), battery_values[1]);
|
DrawBattery(p, center + QPoint(110, -140), battery_values[Core::HID::DeviceIndex::RightIndex]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayerControlPreview::DrawDualController(QPainter& p, const QPointF center) {
|
void PlayerControlPreview::DrawDualController(QPainter& p, const QPointF center) {
|
||||||
|
@ -618,8 +618,8 @@ void PlayerControlPreview::DrawDualController(QPainter& p, const QPointF center)
|
||||||
DrawSymbol(p, center + QPoint(50, 60), Symbol::House, 4.2f);
|
DrawSymbol(p, center + QPoint(50, 60), Symbol::House, 4.2f);
|
||||||
|
|
||||||
// Draw battery
|
// Draw battery
|
||||||
DrawBattery(p, center + QPoint(-100, -160), battery_values[0]);
|
DrawBattery(p, center + QPoint(-100, -160), battery_values[Core::HID::DeviceIndex::LeftIndex]);
|
||||||
DrawBattery(p, center + QPoint(40, -160), battery_values[1]);
|
DrawBattery(p, center + QPoint(40, -160), battery_values[Core::HID::DeviceIndex::RightIndex]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayerControlPreview::DrawHandheldController(QPainter& p, const QPointF center) {
|
void PlayerControlPreview::DrawHandheldController(QPainter& p, const QPointF center) {
|
||||||
|
@ -720,9 +720,8 @@ void PlayerControlPreview::DrawHandheldController(QPainter& p, const QPointF cen
|
||||||
DrawSymbol(p, center + QPoint(161, 37), Symbol::House, 2.75f);
|
DrawSymbol(p, center + QPoint(161, 37), Symbol::House, 2.75f);
|
||||||
|
|
||||||
// Draw battery
|
// Draw battery
|
||||||
DrawBattery(p, center + QPoint(-200, 110), battery_values[0]);
|
DrawBattery(p, center + QPoint(-200, 110), battery_values[Core::HID::DeviceIndex::LeftIndex]);
|
||||||
DrawBattery(p, center + QPoint(-30, 110), battery_values[1]);
|
DrawBattery(p, center + QPoint(130, 110), battery_values[Core::HID::DeviceIndex::RightIndex]);
|
||||||
DrawBattery(p, center + QPoint(130, 110), battery_values[2]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayerControlPreview::DrawProController(QPainter& p, const QPointF center) {
|
void PlayerControlPreview::DrawProController(QPainter& p, const QPointF center) {
|
||||||
|
@ -812,7 +811,7 @@ void PlayerControlPreview::DrawProController(QPainter& p, const QPointF center)
|
||||||
DrawSymbol(p, center + QPoint(29, -56), Symbol::House, 3.9f);
|
DrawSymbol(p, center + QPoint(29, -56), Symbol::House, 3.9f);
|
||||||
|
|
||||||
// Draw battery
|
// Draw battery
|
||||||
DrawBattery(p, center + QPoint(-30, -160), battery_values[0]);
|
DrawBattery(p, center + QPoint(-30, -160), battery_values[Core::HID::DeviceIndex::LeftIndex]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayerControlPreview::DrawGCController(QPainter& p, const QPointF center) {
|
void PlayerControlPreview::DrawGCController(QPainter& p, const QPointF center) {
|
||||||
|
@ -868,7 +867,7 @@ void PlayerControlPreview::DrawGCController(QPainter& p, const QPointF center) {
|
||||||
DrawCircleButton(p, center + QPoint(0, -44), button_values[Plus], 8);
|
DrawCircleButton(p, center + QPoint(0, -44), button_values[Plus], 8);
|
||||||
|
|
||||||
// Draw battery
|
// Draw battery
|
||||||
DrawBattery(p, center + QPoint(-30, -165), battery_values[0]);
|
DrawBattery(p, center + QPoint(-30, -165), battery_values[Core::HID::DeviceIndex::LeftIndex]);
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr std::array<float, 13 * 2> symbol_a = {
|
constexpr std::array<float, 13 * 2> symbol_a = {
|
||||||
|
|
Loading…
Reference in New Issue