Skip to content

Commit

Permalink
Change the controls of the native and Lua versions
Browse files Browse the repository at this point in the history
- Remove Q as an alternative key to quit the game
- Remove the possibility to suspend the game
- Use the MSYS2 installation on the Windows image of the GitHub runner
- Don't specify a path environment variable for MSYS2 on the GitHub runner
- Update Ubuntu to version 20.04 for the GitHub runner environments
- Update macOS to version 11 for the GitHub runner environment
- Use Java 11 when running Gradle for Android on the GitHub runner
  • Loading branch information
encelo committed Sep 5, 2022
1 parent 368ff3d commit ae1a2b3
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 30 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
ARCH: [armeabi-v7a, arm64-v8a, x86_64]
BuildType: [Debug, Release]

runs-on: 'ubuntu-18.04'
runs-on: 'ubuntu-20.04'

steps:
- name: 'Checkout Code'
Expand Down Expand Up @@ -73,6 +73,7 @@ jobs:
- name: 'Gradle Assemble'
run: |
export JAVA_HOME=$JAVA_HOME_11_X64
export PROJECT_NAME=${GITHUB_REPOSITORY##*/}
cd ../$PROJECT_NAME-build-${{ matrix.BuildType }}/android
gradle assemble${{ matrix.BuildType }}
Expand All @@ -98,7 +99,7 @@ jobs:
git reset
git clean -f
git rm * || true
mv -f ../$PROJECT_NAME-build-${{ matrix.BuildType }}/android/build/outputs/apk/*/*.apk .
mv -f ../$PROJECT_NAME-build-${{ matrix.BuildType }}/android/app/build/outputs/apk/*/*.apk .
git add *.apk
git commit --amend -m "$DEPLOY_MESSAGE" || git commit -m "$DEPLOY_MESSAGE"
git push --force || git push --set-upstream origin $DEPLOY_BRANCH
10 changes: 5 additions & 5 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ on: [push, workflow_dispatch]

jobs:
analyze:
name: Analyze
runs-on: ubuntu-18.04
name: 'Analyze'
runs-on: 'ubuntu-20.04'

strategy:
fail-fast: false
matrix:
language: [ 'cpp' ]

steps:
- name: Checkout Repository
- name: 'Checkout Repository'
uses: actions/checkout@v2

- name: Initialize CodeQL
- name: 'Initialize CodeQL'
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
Expand Down Expand Up @@ -73,5 +73,5 @@ jobs:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/../nCine-external/lib
make -j2 -C ../$PROJECT_NAME-build-$BuildType
- name: Perform CodeQL Analysis
- name: 'Perform CodeQL Analysis'
uses: github/codeql-action/analyze@v1
2 changes: 1 addition & 1 deletion .github/workflows/emscripten.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
matrix:
BuildType: [Debug, Release, BinDist]

runs-on: 'ubuntu-18.04'
runs-on: 'ubuntu-20.04'

steps:
- name: 'Checkout Code'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
CC: clang
CXX: clang++

runs-on: 'ubuntu-18.04'
runs-on: 'ubuntu-20.04'

steps:
- name: 'Checkout Code'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
matrix:
BuildType: [Debug, Release, BinDist]

runs-on: 'macOS-10.15'
runs-on: 'macOS-11'

steps:
- name: 'Checkout Code'
Expand Down
21 changes: 11 additions & 10 deletions .github/workflows/mingw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,23 @@ jobs:
- name: 'Checkout Code'
uses: actions/checkout@v2

- name: 'Install and Update MSYS2'
- name: 'Update MSYS2'
run: |
choco install --no-progress msys2 --params="/InstallDir:C:\msys64 /NoUpdate /NoPath"
C:\msys64\usr\bin\pacman --noconfirm -Syy
$env:MSYSTEM = "MINGW64"
C:\msys64\usr\bin\bash -lc 'pacman --noconfirm -Syyuu'
C:\msys64\usr\bin\bash -lc 'pacman --noconfirm -Syyuu'
- name: 'Install Build Dependencies'
run: |
C:\msys64\usr\bin\pacman --noconfirm -S mingw-w64-x86_64-glew mingw-w64-x86_64-glfw mingw-w64-x86_64-SDL2 mingw-w64-x86_64-openal mingw-w64-x86_64-libvorbis mingw-w64-x86_64-libwebp mingw-w64-x86_64-lua cmake
$env:MSYSTEM = "MINGW64"
C:\msys64\usr\bin\bash -lc 'pacman --needed --noconfirm -S mingw-w64-x86_64-glew mingw-w64-x86_64-glfw mingw-w64-x86_64-SDL2 mingw-w64-x86_64-openal mingw-w64-x86_64-libvorbis mingw-w64-x86_64-libwebp mingw-w64-x86_64-lua cmake'
if ("${{ matrix.CC }}" -eq "gcc") { C:\msys64\usr\bin\pacman --noconfirm -S mingw-w64-x86_64-gcc }
else { C:\msys64\usr\bin\pacman --noconfirm -S mingw-w64-x86_64-clang }
if ("${{ matrix.CC }}" -eq "gcc") { C:\msys64\usr\bin\bash -lc 'pacman --needed --noconfirm -S mingw-w64-x86_64-gcc' }
else { C:\msys64\usr\bin\bash -lc 'pacman --needed --noconfirm -S mingw-w64-x86_64-clang' }
C:\msys64\usr\bin\pacman --noconfirm -Scc
C:\msys64\usr\bin\bash -lc 'pacman --noconfirm -Scc'
- name: 'Unshallow Git Repository for Versioning'
if: matrix.BuildType == 'BinDist'
Expand Down Expand Up @@ -108,7 +112,6 @@ jobs:
$env:CXX = "${{ matrix.CXX }}"
$env:PROJECT_NAME = Split-Path -Path "$env:GITHUB_REPOSITORY" -leaf
$env:PATH = "C:\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem"
$env:MSYSTEM = "MINGW64"
if ("${{ matrix.BuildType }}" -eq "BinDist")
Expand All @@ -121,7 +124,6 @@ jobs:
CHERE_INVOKING: on
run: |
$env:PROJECT_NAME = Split-Path -Path "$env:GITHUB_REPOSITORY" -leaf
$env:PATH = "C:\msys64\x86_64\bin;C:\msys64\usr\bin;$env:PATH"
$env:MSYSTEM = "MINGW64"
C:\msys64\usr\bin\bash.exe -lc 'make -j2 -C ../$PROJECT_NAME-build-${{ matrix.BuildType }}'
Expand All @@ -132,7 +134,6 @@ jobs:
CHERE_INVOKING: on
run: |
$env:PROJECT_NAME = Split-Path -Path "$env:GITHUB_REPOSITORY" -leaf
$env:PATH = "C:\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem"
$env:MSYSTEM = "MINGW64"
C:\msys64\usr\bin\bash.exe -lc 'make package -C ../$PROJECT_NAME-build-${{ matrix.BuildType }}'
Expand Down
5 changes: 1 addition & 4 deletions ncpong.lua
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,8 @@ end
red_score_ = 0
blue_score_ = 0
reset()
elseif event.sym == nc.keysym.Q or event.sym == nc.keysym.ESCAPE then
elseif event.sym == nc.keysym.ESCAPE then
nc.application.quit()
elseif event.sym == nc.keysym.SPACE then
local is_suspended = nc.application.is_suspended()
nc.application.set_suspended(not is_suspended)
end
end

Expand Down
7 changes: 1 addition & 6 deletions pong.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,13 +278,8 @@ void MyEventHandler::onKeyReleased(const nc::KeyboardEvent &event)
blueScore_ = 0;
reset();
}
else if (event.sym == nc::KeySym::ESCAPE || event.sym == nc::KeySym::Q)
else if (event.sym == nc::KeySym::ESCAPE)
nc::theApplication().quit();
else if (event.sym == nc::KeySym::SPACE)
{
const bool isSuspended = nc::theApplication().isSuspended();
nc::theApplication().setSuspended(!isSuspended);
}
}

void MyEventHandler::onMouseButtonPressed(const nc::MouseEvent &event)
Expand Down

0 comments on commit ae1a2b3

Please sign in to comment.