You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-14 13:41:12 +00:00
Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
This commit is contained in:
@@ -35,7 +35,6 @@ using namespace Windows::Gaming::Input;
|
||||
using namespace Windows::Foundation;
|
||||
|
||||
void JoypadUWP::register_events() {
|
||||
|
||||
Gamepad::GamepadAdded +=
|
||||
ref new EventHandler<Gamepad ^>(this, &JoypadUWP::OnGamepadAdded);
|
||||
Gamepad::GamepadRemoved +=
|
||||
@@ -43,23 +42,18 @@ void JoypadUWP::register_events() {
|
||||
}
|
||||
|
||||
void JoypadUWP::process_controllers() {
|
||||
|
||||
for (int i = 0; i < MAX_CONTROLLERS; i++) {
|
||||
|
||||
ControllerDevice &joy = controllers[i];
|
||||
|
||||
if (!joy.connected)
|
||||
break;
|
||||
|
||||
switch (joy.type) {
|
||||
|
||||
case ControllerType::GAMEPAD_CONTROLLER: {
|
||||
|
||||
GamepadReading reading = ((Gamepad ^) joy.controller_reference)->GetCurrentReading();
|
||||
|
||||
int button_mask = (int)GamepadButtons::Menu;
|
||||
for (int j = 0; j < 14; j++) {
|
||||
|
||||
input->joy_button(joy.id, j, (int)reading.Buttons & button_mask);
|
||||
button_mask *= 2;
|
||||
}
|
||||
@@ -93,24 +87,20 @@ void JoypadUWP::process_controllers() {
|
||||
}
|
||||
|
||||
JoypadUWP::JoypadUWP() {
|
||||
|
||||
for (int i = 0; i < MAX_CONTROLLERS; i++)
|
||||
controllers[i].id = i;
|
||||
}
|
||||
|
||||
JoypadUWP::JoypadUWP(InputDefault *p_input) {
|
||||
|
||||
input = p_input;
|
||||
|
||||
JoypadUWP();
|
||||
}
|
||||
|
||||
void JoypadUWP::OnGamepadAdded(Platform::Object ^ sender, Windows::Gaming::Input::Gamepad ^ value) {
|
||||
|
||||
short idx = -1;
|
||||
|
||||
for (int i = 0; i < MAX_CONTROLLERS; i++) {
|
||||
|
||||
if (!controllers[i].connected) {
|
||||
idx = i;
|
||||
break;
|
||||
@@ -128,11 +118,9 @@ void JoypadUWP::OnGamepadAdded(Platform::Object ^ sender, Windows::Gaming::Input
|
||||
}
|
||||
|
||||
void JoypadUWP::OnGamepadRemoved(Platform::Object ^ sender, Windows::Gaming::Input::Gamepad ^ value) {
|
||||
|
||||
short idx = -1;
|
||||
|
||||
for (int i = 0; i < MAX_CONTROLLERS; i++) {
|
||||
|
||||
if (controllers[i].controller_reference == value) {
|
||||
idx = i;
|
||||
break;
|
||||
@@ -147,7 +135,6 @@ void JoypadUWP::OnGamepadRemoved(Platform::Object ^ sender, Windows::Gaming::Inp
|
||||
}
|
||||
|
||||
InputDefault::JoyAxis JoypadUWP::axis_correct(double p_val, bool p_negate, bool p_trigger) const {
|
||||
|
||||
InputDefault::JoyAxis jx;
|
||||
|
||||
jx.min = p_trigger ? 0 : -1;
|
||||
|
||||
Reference in New Issue
Block a user