From a82bed289cc72e999d83398de143a2245163801a Mon Sep 17 00:00:00 2001 From: wkdgmr Date: Sat, 23 Aug 2025 18:59:35 -0400 Subject: [PATCH] clang --- Source/controls/controller_motion.cpp | 7 +++---- Source/controls/controller_motion.h | 1 - Source/controls/plrctrls.cpp | 9 +++++---- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Source/controls/controller_motion.cpp b/Source/controls/controller_motion.cpp index 5811828e0..291cf2a2e 100644 --- a/Source/controls/controller_motion.cpp +++ b/Source/controls/controller_motion.cpp @@ -103,7 +103,6 @@ bool IsPressedForMovement(ControllerButton button) && !(SpellSelectFlag && TriggersQuickSpellAction(button)); } - void SetGamepadAimActive(bool value) { if (GamepadAimActive == value) @@ -295,9 +294,9 @@ void SimulateRightStickWithPadmapper(ControllerButtonEvent ctrlEvent) const bool downTriggered = actionName == "MouseDown"; const bool leftTriggered = actionName == "MouseLeft"; const bool rightTriggered = actionName == "MouseRight"; - if (!upTriggered && !downTriggered && !leftTriggered && !rightTriggered) { - return; - } + if (!upTriggered && !downTriggered && !leftTriggered && !rightTriggered) { + return; + } const bool upActive = (upTriggered && !ctrlEvent.up) || (!upTriggered && PadmapperIsActionActive("MouseUp")); const bool downActive = (downTriggered && !ctrlEvent.up) || (!downTriggered && PadmapperIsActionActive("MouseDown")); diff --git a/Source/controls/controller_motion.h b/Source/controls/controller_motion.h index f640f0ca2..befe2e4fb 100644 --- a/Source/controls/controller_motion.h +++ b/Source/controls/controller_motion.h @@ -11,7 +11,6 @@ namespace devilution { // Returns true if gamepad aiming is currently active (right stick or padmapped mouse). bool IsGamepadAimActive(); - // Raw axis values. extern float leftStickXUnscaled, leftStickYUnscaled, rightStickXUnscaled, rightStickYUnscaled; diff --git a/Source/controls/plrctrls.cpp b/Source/controls/plrctrls.cpp index 66ef37b60..70aed34a6 100644 --- a/Source/controls/plrctrls.cpp +++ b/Source/controls/plrctrls.cpp @@ -128,7 +128,8 @@ int GetDistance(Point destination, int maxDistance) int8_t walkpath[MaxPathLengthPlayer]; Player &myPlayer = *MyPlayer; - const int steps = FindPath(CanStep, [&myPlayer](Point position) { return PosOkPlayer(myPlayer, position); }, myPlayer.position.future, destination, walkpath, std::min(maxDistance, MaxPathLengthPlayer)); + const int steps = FindPath( + CanStep, [&myPlayer](Point position) { return PosOkPlayer(myPlayer, position); }, myPlayer.position.future, destination, walkpath, std::min(maxDistance, MaxPathLengthPlayer)); if (steps > maxDistance) return 0; @@ -1752,7 +1753,7 @@ void DetectInputMethod(const SDL_Event &event, const ControllerButtonEvent &game if (newControlDevice != ControlDevice) { ControlDevice = newControlDevice; - #ifndef USE_SDL1 +#ifndef USE_SDL1 // Prevent cursor hiding and device/mode swap while gamepad aiming is active if (!IsGamepadAimActive()) { if (ControlDevice != ControlTypes::KeyboardAndMouse) { @@ -1769,7 +1770,7 @@ void DetectInputMethod(const SDL_Event &event, const ControllerButtonEvent &game GamepadType = newGamepadLayout; } } - #endif +#endif } if (newControlMode != ControlMode) { @@ -2277,7 +2278,7 @@ void QuickCast(size_t slot) const SpellType spellType = myPlayer._pSplTHotKey[slot]; if (!IsGamepadAimActive) { - UpdateSpellTarget(spell); + UpdateSpellTarget(spell); } CheckPlrSpell(false, spell, spellType);