From 0e63b3ee0be23bd4ceddfff0197204247a7edbe4 Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Tue, 23 Nov 2021 21:56:56 +0000 Subject: [PATCH] Update clang-format-check GitHub Workflow Taking this opportunity as we've just done a global reformat and it's quite small. --- .github/workflows/clang-format-check.yml | 8 ++++---- Source/DiabloUI/settingsmenu.cpp | 2 +- Source/player.cpp | 20 ++++++++++---------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/clang-format-check.yml b/.github/workflows/clang-format-check.yml index f875f98a1..8727404e9 100644 --- a/.github/workflows/clang-format-check.yml +++ b/.github/workflows/clang-format-check.yml @@ -17,15 +17,15 @@ jobs: fetch-depth: 0 - name: Formatting Check (Source) - uses: jidicula/clang-format-action@v3.4.0 + uses: jidicula/clang-format-action@v4.3.1 with: - clang-format-version: '11' + clang-format-version: '13' check-path: 'Source' fallback-style: 'webkit' - name: Formatting Check (test) - uses: jidicula/clang-format-action@v3.4.0 + uses: jidicula/clang-format-action@v4.3.1 with: - clang-format-version: '11' + clang-format-version: '13' check-path: 'test' fallback-style: 'webkit' diff --git a/Source/DiabloUI/settingsmenu.cpp b/Source/DiabloUI/settingsmenu.cpp index 06fdf9733..9a09cbfe1 100644 --- a/Source/DiabloUI/settingsmenu.cpp +++ b/Source/DiabloUI/settingsmenu.cpp @@ -1,8 +1,8 @@ #include "selstart.h" -#include "control.h" #include "DiabloUI/diabloui.h" #include "DiabloUI/scrollbar.h" +#include "control.h" #include "hwcursor.hpp" #include "options.h" #include "utils/language.h" diff --git a/Source/player.cpp b/Source/player.cpp index 8090e1019..aa5ac3d7e 100644 --- a/Source/player.cpp +++ b/Source/player.cpp @@ -348,7 +348,7 @@ void HandleWalkMode(int pnum, Displacement vel, Direction dir) } player.position.offset = dirModeParams.offset; // Offset player sprite to align with their previous tile position - //The player's tile position after finishing this movement action + // The player's tile position after finishing this movement action player.position.future = player.position.tile + dirModeParams.tileAdd; if (pnum == MyPlayerId) { @@ -703,7 +703,7 @@ bool DoWalk(int pnum, int variant) } auto &player = Players[pnum]; - //Play walking sound effect on certain animation frames + // Play walking sound effect on certain animation frames if (*sgOptions.Audio.walkingSound && (currlevel != 0 || sgGameInitInfo.bRunInTown == 0)) { if (player.AnimInfo.CurrentFrame == 1 || player.AnimInfo.CurrentFrame == 5) { @@ -711,10 +711,10 @@ bool DoWalk(int pnum, int variant) } } - //Check if we reached new tile + // Check if we reached new tile if (player.AnimInfo.CurrentFrame >= player._pWFrames) { - //Update the player's tile position + // Update the player's tile position switch (variant) { case PM_WALK: dPlayer[player.position.tile.x][player.position.tile.y] = 0; @@ -732,13 +732,13 @@ bool DoWalk(int pnum, int variant) break; } - //Update the coordinates for lighting and vision entries for the player + // Update the coordinates for lighting and vision entries for the player if (leveltype != DTYPE_TOWN) { ChangeLightXY(player._plid, player.position.tile); ChangeVisionXY(player._pvid, player.position.tile); } - //Update the "camera" tile position + // Update the "camera" tile position if (pnum == MyPlayerId && ScrollInfo._sdir != ScrollDirection::None) { ViewPosition = Point { 0, 0 } + (player.position.tile - ScrollInfo.tile); } @@ -751,14 +751,14 @@ bool DoWalk(int pnum, int variant) ClearStateVariables(player); - //Reset the "sub-tile" position of the player's light entry to 0 + // Reset the "sub-tile" position of the player's light entry to 0 if (leveltype != DTYPE_TOWN) { ChangeLightOffset(player._plid, { 0, 0 }); } AutoGoldPickup(pnum); return true; - } //We didn't reach new tile so update player's "sub-tile" position + } // We didn't reach new tile so update player's "sub-tile" position ChangeOffset(pnum); return false; } @@ -1977,7 +1977,7 @@ void Player::RemoveInvItem(int iv, bool calcScrolls) { iv++; - //Iterate through invGrid and remove every reference to item + // Iterate through invGrid and remove every reference to item for (int8_t &itemId : InvGrid) { if (itemId == iv || itemId == -iv) { itemId = 0; @@ -1987,7 +1987,7 @@ void Player::RemoveInvItem(int iv, bool calcScrolls) iv--; _pNumInv--; - //If the item at the end of inventory array isn't the one we removed, we need to swap its position in the array with the removed item + // If the item at the end of inventory array isn't the one we removed, we need to swap its position in the array with the removed item if (_pNumInv > 0 && _pNumInv != iv) { InvList[iv] = InvList[_pNumInv];