diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 0000000000..8e45a81202 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,2 @@ +27d409a89cb1607321404e0ebfe8bc0a63c337a3 +c80a961e5f0239a38b788ce86853bb79ed4e8651 diff --git a/.github/scripts/add-eol.sh b/.github/scripts/add-eol.sh new file mode 100755 index 0000000000..ce39143242 --- /dev/null +++ b/.github/scripts/add-eol.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +sed -e '$a\' "$@" diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index 8ff45b6f72..f73a6d273f 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -35,10 +35,42 @@ jobs: - name: Run clang-format run: | - .github/scripts/run-clang-format.py -r Source Data/Base.rte/Shaders \ + .github/scripts/run-clang-format.py \ + -i \ + -r Source Data/Base.rte/Shaders \ --exclude Source/System/Base64 \ --exclude Source/System/BitMask \ --exclude Source/System/glad \ --exclude Source/System/MicroPather \ --exclude Source/System/Semver200 \ --exclude Source/System/StackWalker + - name: Add missing newlines + run: | + .github/scripts/run-clang-format.py \ + -i --clang-format-executable .github/scripts/add-eol.sh \ + -r Source Data/Base.rte/Shaders \ + --exclude Source/System/Base64 \ + --exclude Source/System/BitMask \ + --exclude Source/System/glad \ + --exclude Source/System/MicroPather \ + --exclude Source/System/Semver200 \ + --exclude Source/System/StackWalker + - name: Report changes + run: | + # Store the changes in a patch file first + git diff > clang-format-changes.patch + # if any changes were made, fail the build + if ! git diff --quiet ; then + echo "::error::Code misformatted. Run clang-format or apply the patch (printed below and attached to job summary) to fix." + # Print the changes to the console + cat clang-format-changes.patch + exit 1 + fi + - name: Upload artifacts + uses: actions/upload-artifact@v4 + # Only upload the patch file if the build failed, meaning that the code was not properly formatted + if: failure() + with: + name: clang-format-changes.patch + path: | + clang-format-changes.patch diff --git a/Source/Managers/NetworkClient.cpp b/Source/Managers/NetworkClient.cpp index 23a5c2378f..2c9c84607a 100644 --- a/Source/Managers/NetworkClient.cpp +++ b/Source/Managers/NetworkClient.cpp @@ -842,7 +842,7 @@ namespace RTE { set_clip_rect(targetBitmap, targetBox.GetCorner().m_X, targetBox.GetCorner().m_Y, targetBox.GetCorner().m_X + targetBox.GetWidth() - 1, targetBox.GetCorner().m_Y + targetBox.GetHeight() - 1); // Choose the correct blitting function based on transparency setting - void (*pfBlit)(BITMAP* source, BITMAP* dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height) = m_BackgroundLayers[frame][i].DrawTrans ? &masked_blit : &blit; + void (*pfBlit)(BITMAP * source, BITMAP * dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height) = m_BackgroundLayers[frame][i].DrawTrans ? &masked_blit : &blit; // See if this SceneLayer is wider AND higher than the target bitmap; then use simple wrapping logic - otherwise need to tile if (m_BackgroundBitmaps[i]->w >= targetBitmap->w && m_BackgroundBitmaps[i]->h >= targetBitmap->h) {