mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-04 16:32:39 +00:00
Clang
This commit is contained in:
parent
448e68155b
commit
178ee45e89
@ -213,7 +213,8 @@ InputBinding GetBindingFromString(std::string& line) {
|
|||||||
ControllerOutput* GetOutputPointer(const ControllerOutput& parsed) {
|
ControllerOutput* GetOutputPointer(const ControllerOutput& parsed) {
|
||||||
// i wonder how long until someone notices this or I get rid of it
|
// i wonder how long until someone notices this or I get rid of it
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (; i[output_array] != ControllerOutput(OrbisPadButtonDataOffset::None, Axis::AxisMax); i++) {
|
for (; i[output_array] != ControllerOutput(OrbisPadButtonDataOffset::None, Axis::AxisMax);
|
||||||
|
i++) {
|
||||||
if (i[output_array] == parsed) {
|
if (i[output_array] == parsed) {
|
||||||
return &output_array[i];
|
return &output_array[i];
|
||||||
}
|
}
|
||||||
@ -284,7 +285,8 @@ void ParseInputConfig(const std::string game_id = "") {
|
|||||||
line);
|
line);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ControllerOutput* toggle_out = GetOutputPointer(ControllerOutput((OrbisPadButtonDataOffset)KEY_TOGGLE));
|
ControllerOutput* toggle_out =
|
||||||
|
GetOutputPointer(ControllerOutput((OrbisPadButtonDataOffset)KEY_TOGGLE));
|
||||||
BindingConnection toggle_connection =
|
BindingConnection toggle_connection =
|
||||||
BindingConnection(InputBinding(toggle_keys.key2), toggle_out, toggle_keys.key3);
|
BindingConnection(InputBinding(toggle_keys.key2), toggle_out, toggle_keys.key3);
|
||||||
connections.insert(connections.end(), toggle_connection);
|
connections.insert(connections.end(), toggle_connection);
|
||||||
@ -328,8 +330,11 @@ void ParseInputConfig(const std::string game_id = "") {
|
|||||||
axis_it->second.axis == Axis::TriggerRight)
|
axis_it->second.axis == Axis::TriggerRight)
|
||||||
? 127
|
? 127
|
||||||
: axis_it->second.value;
|
: axis_it->second.value;
|
||||||
connection = BindingConnection(
|
connection =
|
||||||
binding, GetOutputPointer(ControllerOutput(OrbisPadButtonDataOffset::None, axis_it->second.axis)), value_to_set);
|
BindingConnection(binding,
|
||||||
|
GetOutputPointer(ControllerOutput(OrbisPadButtonDataOffset::None,
|
||||||
|
axis_it->second.axis)),
|
||||||
|
value_to_set);
|
||||||
connections.insert(connections.end(), connection);
|
connections.insert(connections.end(), connection);
|
||||||
} else {
|
} else {
|
||||||
LOG_WARNING(Input, "Invalid format at line: {}, data: \"{}\", skipping line.",
|
LOG_WARNING(Input, "Invalid format at line: {}, data: \"{}\", skipping line.",
|
||||||
@ -484,9 +489,8 @@ void ControllerOutput::FinalizeUpdate() {
|
|||||||
controller->Axis(0, axis, GetAxis(0x0, 0x80, new_param));
|
controller->Axis(0, axis, GetAxis(0x0, 0x80, new_param));
|
||||||
// Also handle button counterpart for TriggerLeft and TriggerRight
|
// Also handle button counterpart for TriggerLeft and TriggerRight
|
||||||
controller->CheckButton(0,
|
controller->CheckButton(0,
|
||||||
axis == Axis::TriggerLeft
|
axis == Axis::TriggerLeft ? OrbisPadButtonDataOffset::L2
|
||||||
? OrbisPadButtonDataOffset::L2
|
: OrbisPadButtonDataOffset::R2,
|
||||||
: OrbisPadButtonDataOffset::R2,
|
|
||||||
new_param > 0x20);
|
new_param > 0x20);
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user