Skip to content

Commit d14fdb7

Browse files
committed
clang format
1 parent 7d7a2cb commit d14fdb7

File tree

5 files changed

+26
-14
lines changed

5 files changed

+26
-14
lines changed

src/controller/controldevice/controller/mapping/factories/RumbleMappingFactory.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ RumbleMappingFactory::CreateDefaultSDLRumbleMappings(PhysicalDeviceType physical
5252
// ->GetDeviceIndexMappingManager()
5353
// ->GetDeviceIndexMappingFromShipDeviceIndex(physicalDeviceType));
5454
// if (sdlIndexMapping == nullptr) {
55-
return std::vector<std::shared_ptr<ControllerRumbleMapping>>();
55+
return std::vector<std::shared_ptr<ControllerRumbleMapping>>();
5656
// }
5757

5858
// std::vector<std::shared_ptr<ControllerRumbleMapping>> mappings = { std::make_shared<SDLRumbleMapping>(

src/controller/controldevice/controller/mapping/sdl/SDLAxisDirectionToButtonMapping.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,15 @@ void SDLAxisDirectionToButtonMapping::UpdatePad(CONTROLLERBUTTONS_T& padButtons)
2020

2121
int32_t axisThresholdPercentage = 25;
2222
if (AxisIsStick()) {
23-
axisThresholdPercentage = Ship::Context::GetInstance()->GetControlDeck()->GetGlobalSDLDeviceSettings()->GetStickAxisThresholdPercentage();
23+
axisThresholdPercentage = Ship::Context::GetInstance()
24+
->GetControlDeck()
25+
->GetGlobalSDLDeviceSettings()
26+
->GetStickAxisThresholdPercentage();
2427
} else if (AxisIsTrigger()) {
25-
axisThresholdPercentage = Ship::Context::GetInstance()->GetControlDeck()->GetGlobalSDLDeviceSettings()->GetTriggerAxisThresholdPercentage();
28+
axisThresholdPercentage = Ship::Context::GetInstance()
29+
->GetControlDeck()
30+
->GetGlobalSDLDeviceSettings()
31+
->GetTriggerAxisThresholdPercentage();
2632
}
2733

2834
for (const auto& [instanceId, gamepad] :

src/controller/controldevice/controller/mapping/sdl/SDLLEDMapping.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ void SDLLEDMapping::SetLEDColor(Color_RGB8 color) {
1717
if (mColorSource == LED_COLOR_SOURCE_SET) {
1818
color = mSavedColor;
1919
}
20-
20+
2121
for (const auto& [instanceId, gamepad] :
22-
Context::GetInstance()->GetControlDeck()->GetConnectedPhysicalDeviceManager()->GetConnectedSDLGamepadsForPort(mPortIndex))
23-
{
22+
Context::GetInstance()->GetControlDeck()->GetConnectedPhysicalDeviceManager()->GetConnectedSDLGamepadsForPort(
23+
mPortIndex)) {
2424
if (!SDL_GameControllerHasLED(gamepad)) {
2525
continue;
2626
}

src/controller/physicaldevice/GlobalSDLDeviceSettings.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@ namespace Ship {
88
GlobalSDLDeviceSettings::GlobalSDLDeviceSettings() {
99
const std::string mappingCvarKey = CVAR_PREFIX_CONTROLLERS ".GlobalSDLDeviceSettings";
1010
const int32_t defaultAxisThresholdPercentage = 25;
11-
mStickAxisThresholdPercentage = CVarGetInteger(StringHelper::Sprintf("%s.StickAxisThresholdPercentage", mappingCvarKey.c_str()).c_str(), defaultAxisThresholdPercentage);
12-
mTriggerAxisThresholdPercentage = CVarGetInteger(StringHelper::Sprintf("%s.TriggerAxisThresholdPercentage", mappingCvarKey.c_str()).c_str(), defaultAxisThresholdPercentage);
11+
mStickAxisThresholdPercentage =
12+
CVarGetInteger(StringHelper::Sprintf("%s.StickAxisThresholdPercentage", mappingCvarKey.c_str()).c_str(),
13+
defaultAxisThresholdPercentage);
14+
mTriggerAxisThresholdPercentage =
15+
CVarGetInteger(StringHelper::Sprintf("%s.TriggerAxisThresholdPercentage", mappingCvarKey.c_str()).c_str(),
16+
defaultAxisThresholdPercentage);
1317
}
1418

1519
GlobalSDLDeviceSettings::~GlobalSDLDeviceSettings() {

src/window/gui/InputEditorWindow.cpp

+8-6
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,8 @@ void InputEditorWindow::DrawButtonLineEditMappingButton(uint8_t port, CONTROLLER
334334
ImGui::SetNextItemWidth(SCALE_IMGUI_SIZE(160.0f));
335335
if (ImGui::SliderInt(StringHelper::Sprintf("##Stick Axis Threshold%s", id.c_str()).c_str(),
336336
&stickAxisThreshold, 0, 100, "%d%%", ImGuiSliderFlags_AlwaysClamp)) {
337-
globalSettings->SetStickAxisThresholdPercentage(stickAxisThreshold);
338-
globalSettings->SaveToConfig();
337+
globalSettings->SetStickAxisThresholdPercentage(stickAxisThreshold);
338+
globalSettings->SaveToConfig();
339339
}
340340
ImGui::SameLine(0.0f, 0.0f);
341341
if (stickAxisThreshold == 100) {
@@ -372,8 +372,8 @@ void InputEditorWindow::DrawButtonLineEditMappingButton(uint8_t port, CONTROLLER
372372
ImGui::SetNextItemWidth(SCALE_IMGUI_SIZE(160.0f));
373373
if (ImGui::SliderInt(StringHelper::Sprintf("##Trigger Axis Threshold%s", id.c_str()).c_str(),
374374
&triggerAxisThreshold, 0, 100, "%d%%", ImGuiSliderFlags_AlwaysClamp)) {
375-
globalSettings->SetTriggerAxisThresholdPercentage(triggerAxisThreshold);
376-
globalSettings->SaveToConfig();
375+
globalSettings->SetTriggerAxisThresholdPercentage(triggerAxisThreshold);
376+
globalSettings->SaveToConfig();
377377
}
378378
ImGui::SameLine(0.0f, 0.0f);
379379
if (triggerAxisThreshold == 100) {
@@ -1186,7 +1186,8 @@ void InputEditorWindow::DrawDeviceNameButtons() {
11861186
ImGui::PopStyleColor();
11871187
ImGui::PopStyleColor();
11881188

1189-
for (const auto& name : Context::GetInstance()->GetControlDeck()->GetConnectedPhysicalDeviceManager()->GetConnectedSDLGamepadNames()) {
1189+
for (const auto& name :
1190+
Context::GetInstance()->GetControlDeck()->GetConnectedPhysicalDeviceManager()->GetConnectedSDLGamepadNames()) {
11901191
auto buttonColor = ImGui::GetStyleColorVec4(ImGuiCol_Button);
11911192
auto buttonHoveredColor = ImGui::GetStyleColorVec4(ImGuiCol_ButtonHovered);
11921193
GetButtonColorsForPhysicalDeviceType(PhysicalDeviceType::SDLGamepad, buttonColor, buttonHoveredColor);
@@ -1348,7 +1349,8 @@ void InputEditorWindow::DrawSetDefaultsButton(uint8_t portIndex) {
13481349
ImGui::PopStyleColor();
13491350
ImGui::PopStyleColor();
13501351
if (ImGui::BeginPopupModal("Set Defaults for Gamepad (SDL)", NULL, ImGuiWindowFlags_AlwaysAutoResize)) {
1351-
ImGui::Text("This will clear all existing mappings for\nGamepad (SDL) on port %d.\n\nContinue?", portIndex + 1);
1352+
ImGui::Text("This will clear all existing mappings for\nGamepad (SDL) on port %d.\n\nContinue?",
1353+
portIndex + 1);
13521354
if (ImGui::Button("Cancel")) {
13531355
shouldClose = true;
13541356
ImGui::CloseCurrentPopup();

0 commit comments

Comments
 (0)