Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into upstream-merge
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlaux committed Sep 5, 2024
2 parents 1c05906 + a5796a3 commit 34654d7
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ jobs:
with:
version: 18
step-summary: true
files-changed-only: false
files-changed-only: true
style: '' # disable clang-format checks.
tidy-checks: >-
-*
Expand Down
45 changes: 26 additions & 19 deletions .github/workflows/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,29 @@ jobs:
triplet: x64-linux-dynamic-release
artifact-name: Nugget-Doom-AppImage
artifact-path: build/*.appimage
extra-options: -DCMAKE_INSTALL_PREFIX=/usr

- name: MSVC x64
os: windows-latest
arch: x64
triplet: x64-windows-static-release
artifact-name: Nugget-Doom-Win64
artifact-path: build/*.zip
extra-options: >-
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
-DCMAKE_IGNORE_PATH="C:/Strawberry/perl/bin;C:/Strawberry/c/lib"
- name: MSVC x86
os: windows-latest
arch: x86
triplet: x86-windows-static-release
artifact-name: Nugget-Doom-Win32
artifact-path: build/*.zip
extra-options: >-
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
-DCMAKE_IGNORE_PATH="C:/Strawberry/perl/bin;C:/Strawberry/c/lib"
steps:
- uses: actions/checkout@v4
Expand All @@ -65,27 +74,24 @@ jobs:
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Configure (Linux)
- name: Update vcpkg (Linux)
if: runner.os == 'Linux'
shell: bash
run: |
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release \
-DENABLE_WERROR=ON -DENABLE_HARDENING=ON -DENABLE_LTO=ON \
-DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" \
-DVCPKG_OVERLAY_TRIPLETS="cmake/triplets" \
-DVCPKG_TARGET_TRIPLET=${{ matrix.config.triplet }} \
-DCMAKE_INSTALL_PREFIX=/usr
- name: Configure (Windows)
if: runner.os == 'Windows'
run: |
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release `
-DENABLE_WERROR=ON -DENABLE_LTO=ON `
-DCMAKE_TOOLCHAIN_FILE="${env:VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" `
-DVCPKG_OVERLAY_TRIPLETS="cmake/triplets" `
-DVCPKG_TARGET_TRIPLET=${{ matrix.config.triplet }} `
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded `
-DCMAKE_IGNORE_PATH="C:/Strawberry/perl/bin;C:/Strawberry/c/lib"
cd "$VCPKG_INSTALLATION_ROOT"
git stash
git pull
./bootstrap-vcpkg.sh
- name: Configure
shell: bash
run: >-
cmake -B build -G Ninja
-DCMAKE_BUILD_TYPE=Release
-DENABLE_WERROR=ON -DENABLE_HARDENING=ON -DENABLE_LTO=ON
-DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake"
-DVCPKG_OVERLAY_TRIPLETS="cmake/triplets"
-DVCPKG_TARGET_TRIPLET=${{ matrix.config.triplet }}
${{ matrix.config.extra-options }}
- name: Build
run: cmake --build build --config "Release"
Expand Down Expand Up @@ -117,5 +123,6 @@ jobs:
path: ${{ matrix.config.artifact-path }}

- name: Extract Version Number
if: ${{ contains(github.ref, 'tags') }}
shell: bash
run: echo "VERSION=${GITHUB_REF##*_}" >> $GITHUB_ENV
7 changes: 4 additions & 3 deletions src/i_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,11 @@ boolean I_GyroSupported(void)

static joy_platform_t GetSwitchSubPlatform(void)
{
#if SDL_VERSION_ATLEAST(2, 24, 0)
if (gamepad != NULL)
{
switch (SDL_GameControllerGetType(gamepad))
{
case SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO:
return PLATFORM_SWITCH_PRO;

case SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_LEFT:
return PLATFORM_SWITCH_JOYCON_LEFT;

Expand All @@ -261,6 +259,7 @@ static joy_platform_t GetSwitchSubPlatform(void)
break;
}
}
#endif

return PLATFORM_SWITCH_PRO;
}
Expand Down Expand Up @@ -292,9 +291,11 @@ static void UpdatePlatform(void)
break;

case SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO:
#if SDL_VERSION_ATLEAST(2, 24, 0)
case SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_PAIR:
case SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_LEFT:
case SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT:
#endif
platform = GetSwitchSubPlatform();
break;
}
Expand Down

0 comments on commit 34654d7

Please sign in to comment.