Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: cxong/cdogs-sdl
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.5.1
Choose a base ref
...
head repository: cxong/cdogs-sdl
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing 4,766 changed files with 278,831 additions and 26,514 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
11 changes: 0 additions & 11 deletions .astylerc

This file was deleted.

8 changes: 8 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
BasedOnStyle: Microsoft
AlignAfterOpenBracket: AlwaysBreak
ColumnLimit: '79'
TabWidth: '4'
UseTab: Always

...
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/.gitattributes export-ignore
/.github export-ignore
/.gitignore export-ignore
/appveyor.yml export-ignore
/appveyor.yml.cmake export-ignore
/wiki* export-ignore
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ko_fi: congusbongus
168 changes: 168 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
name: Build

on:
push:
branches: [ master ]
tags:
- '*'
pull_request:
branches: [ master ]

env:
VERSION: 2.2.0
CTEST_EXT_COLOR_OUTPUT: TRUE
CTEST_OUTPUT_ON_FAILURE: 1
CTEST_BUILD_FLAGS: -j4
BUILD_TYPE: Release
SDL_AUDIODRIVER: dummy
SDL_VIDEODRIVER: dummy

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
cc: gcc
cc_version: latest
- os: ubuntu-latest
cc: clang
cc_version: latest
- os: macos-latest
- os: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
version: "23.x"
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Check stuff
run: |
protoc --version
echo "${{ github.workspace }}"
- name: Set up Homebrew (Linux)
id: set-up-homebrew
if: matrix.os == 'ubuntu-latest'
uses: Homebrew/actions/setup-homebrew@master

- name: Install packages (Linux)
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt install python3-pip libgl1-mesa-dev
sudo apt install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev
python3 -m pip install protobuf --break-system-packages
pip3 install --upgrade protobuf --break-system-packages
- name: Set up GCC (Linux)
if: startsWith(matrix.os, 'ubuntu') && matrix.cc == 'gcc'
uses: egor-tensin/setup-gcc@v1
with:
version: ${{ matrix.cc_version }}

- name: Set up Clang (Linux)
if: startsWith(matrix.os, 'ubuntu') && matrix.cc == 'clang'
uses: egor-tensin/setup-clang@v1
with:
version: ${{ matrix.cc_version }}

- name: Install packages (macOS)
if: matrix.os == 'macos-latest'
run: |
python3 -m pip install protobuf --break-system-packages
pip3 install --upgrade protobuf --break-system-packages
build/macosx/install-sdl2.sh
- name: Install dependencies (Windows)
if: matrix.os == 'windows-latest'
run: C:\vcpkg\vcpkg.exe install --triplet x64-windows sdl2 sdl2-image sdl2-mixer[core,mpg123] protobuf --recurse

- name: Configure CMake
env:
CC: ${{ matrix.cc }}
if: matrix.os != 'windows-latest'
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B . -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=. -DDATA_INSTALL_DIR=. -Wno-dev

- name: Configure CMake (Windows)
if: matrix.os == 'windows-latest'
run: cmake -B . -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows

- name: Build
# Build your program with the given configuration
run: cmake --build . --config ${{env.BUILD_TYPE}}

- name: Test
working-directory: ${{github.workspace}}
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{env.BUILD_TYPE}} -VV

- name: Download DLLs on tags (Windows)
if: startsWith(github.ref, 'refs/tags/') && matrix.os == 'windows-latest'
run: |
build/windows/get-sdl2-dlls.bat dll 64
- name: Make package on tags
if: startsWith(github.ref, 'refs/tags/')
run: |
cpack -B . -C ${{env.BUILD_TYPE}}
echo "${{ github.workspace }}"
ls "${{ github.workspace }}"
ls ${{ github.workspace }}/C-Dogs*SDL-*-*.*
- name: Upload a Build Artifact
uses: softprops/action-gh-release@v1
if: >
startsWith(github.ref, 'refs/tags/') &&
(!startsWith(matrix.os, 'ubuntu') || (matrix.cc == 'gcc' && matrix.cc_version == 'latest'))
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: C-Dogs*SDL-*-*.*
fail_on_unmatched_files: true

- name: Publish to itch.io (Linux)
if: >
startsWith(github.ref, 'refs/tags/') &&
startsWith(matrix.os, 'ubuntu') &&
matrix.cc == 'gcc' &&
matrix.cc_version == 'latest'
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
run: |
curl -L -o butler.zip https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default
unzip butler.zip
chmod +x butler
./butler -V
./butler push C-Dogs*SDL-*-Linux.tar.gz congusbongus/cdogs-sdl:linux --userversion $VERSION
- name: Publish to itch.io (macOS)
if: >
startsWith(github.ref, 'refs/tags/') &&
matrix.os == 'macos-latest'
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
run: |
curl -L -o butler.zip https://broth.itch.ovh/butler/darwin-amd64/LATEST/archive/default
unzip butler.zip
chmod +x butler
./butler -V
./butler push C-Dogs*SDL-*-OSX.dmg congusbongus/cdogs-sdl:mac --userversion $VERSION
- name: Publish to itch.io (Windows)
if: >
startsWith(github.ref, 'refs/tags/') &&
matrix.os == 'windows-latest'
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
run: |
.\build\windows\butler.bat
168 changes: 168 additions & 0 deletions .github/workflows/cmake.yml.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
name: Build

on:
push:
branches: [ master ]
tags:
- '*'
pull_request:
branches: [ master ]

env:
VERSION: @VERSION@
CTEST_EXT_COLOR_OUTPUT: TRUE
CTEST_OUTPUT_ON_FAILURE: 1
CTEST_BUILD_FLAGS: -j4
BUILD_TYPE: Release
SDL_AUDIODRIVER: dummy
SDL_VIDEODRIVER: dummy

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
cc: gcc
cc_version: latest
- os: ubuntu-latest
cc: clang
cc_version: latest
- os: macos-latest
- os: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
version: "23.x"
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Check stuff
run: |
protoc --version
echo "${{ github.workspace }}"

- name: Set up Homebrew (Linux)
id: set-up-homebrew
if: matrix.os == 'ubuntu-latest'
uses: Homebrew/actions/setup-homebrew@master

- name: Install packages (Linux)
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt install python3-pip libgl1-mesa-dev
sudo apt install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev
python3 -m pip install protobuf --break-system-packages
pip3 install --upgrade protobuf --break-system-packages

- name: Set up GCC (Linux)
if: startsWith(matrix.os, 'ubuntu') && matrix.cc == 'gcc'
uses: egor-tensin/setup-gcc@v1
with:
version: ${{ matrix.cc_version }}

- name: Set up Clang (Linux)
if: startsWith(matrix.os, 'ubuntu') && matrix.cc == 'clang'
uses: egor-tensin/setup-clang@v1
with:
version: ${{ matrix.cc_version }}

- name: Install packages (macOS)
if: matrix.os == 'macos-latest'
run: |
python3 -m pip install protobuf --break-system-packages
pip3 install --upgrade protobuf --break-system-packages
build/macosx/install-sdl2.sh

- name: Install dependencies (Windows)
if: matrix.os == 'windows-latest'
run: C:\vcpkg\vcpkg.exe install --triplet x64-windows sdl2 sdl2-image sdl2-mixer[core,mpg123] protobuf --recurse

- name: Configure CMake
env:
CC: ${{ matrix.cc }}
if: matrix.os != 'windows-latest'
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B . -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=. -DDATA_INSTALL_DIR=. -Wno-dev

- name: Configure CMake (Windows)
if: matrix.os == 'windows-latest'
run: cmake -B . -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows

- name: Build
# Build your program with the given configuration
run: cmake --build . --config ${{env.BUILD_TYPE}}

- name: Test
working-directory: ${{github.workspace}}
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{env.BUILD_TYPE}} -VV

- name: Download DLLs on tags (Windows)
if: startsWith(github.ref, 'refs/tags/') && matrix.os == 'windows-latest'
run: |
build/windows/get-sdl2-dlls.bat dll 64

- name: Make package on tags
if: startsWith(github.ref, 'refs/tags/')
run: |
cpack -B . -C ${{env.BUILD_TYPE}}
echo "${{ github.workspace }}"
ls "${{ github.workspace }}"
ls ${{ github.workspace }}/C-Dogs*SDL-*-*.*

- name: Upload a Build Artifact
uses: softprops/action-gh-release@v1
if: >
startsWith(github.ref, 'refs/tags/') &&
(!startsWith(matrix.os, 'ubuntu') || (matrix.cc == 'gcc' && matrix.cc_version == 'latest'))
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: C-Dogs*SDL-*-*.*
fail_on_unmatched_files: true

- name: Publish to itch.io (Linux)
if: >
startsWith(github.ref, 'refs/tags/') &&
startsWith(matrix.os, 'ubuntu') &&
matrix.cc == 'gcc' &&
matrix.cc_version == 'latest'
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
run: |
curl -L -o butler.zip https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default
unzip butler.zip
chmod +x butler
./butler -V
./butler push C-Dogs*SDL-*-Linux.tar.gz congusbongus/cdogs-sdl:linux --userversion $VERSION

- name: Publish to itch.io (macOS)
if: >
startsWith(github.ref, 'refs/tags/') &&
matrix.os == 'macos-latest'
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
run: |
curl -L -o butler.zip https://broth.itch.ovh/butler/darwin-amd64/LATEST/archive/default
unzip butler.zip
chmod +x butler
./butler -V
./butler push C-Dogs*SDL-*-OSX.dmg congusbongus/cdogs-sdl:mac --userversion $VERSION

- name: Publish to itch.io (Windows)
if: >
startsWith(github.ref, 'refs/tags/') &&
matrix.os == 'windows-latest'
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
run: |
.\build\windows\butler.bat
Loading