mirror of
https://github.com/fallout2-ce/fallout2-ce.git
synced 2026-07-27 16:47:11 -07:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
068e6dd864 | ||
|
|
1acb4a57d2 | ||
|
|
293c5b71fb |
@@ -1,384 +0,0 @@
|
||||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request: # TODO: Remove this after debugging
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
android:
|
||||
name: Android Release
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Clone
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 11
|
||||
cache: gradle
|
||||
|
||||
- name: Cache cmake build
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: os/android/app/.cxx
|
||||
key: android-cmake-v101
|
||||
|
||||
- name: Setup signing config
|
||||
if: env.KEYSTORE_FILE_BASE64 != '' && env.KEYSTORE_PROPERTIES_FILE_BASE64 != ''
|
||||
run: |
|
||||
cd os/android
|
||||
echo "$KEYSTORE_FILE_BASE64" | base64 --decode > release.keystore
|
||||
echo "$KEYSTORE_PROPERTIES_FILE_BASE64" | base64 --decode > release-keystore.properties
|
||||
env:
|
||||
KEYSTORE_FILE_BASE64: ${{ secrets.ANDROID_RELEASE_KEYSTORE_FILE_BASE64 }}
|
||||
KEYSTORE_PROPERTIES_FILE_BASE64: ${{ secrets.ANDROID_RELEASE_KEYSTORE_PROPERTIES_FILE_BASE64 }}
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cd os/android
|
||||
./gradlew assembleRelease
|
||||
|
||||
- name: Change apk file name
|
||||
run: |
|
||||
ls -laR .
|
||||
mv os/android/app/build/outputs/apk/release/app-release.apk os/android/app/build/outputs/apk/release/fallout2-ce.apk
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fallout2-ce.apk
|
||||
path: os/android/app/build/outputs/apk/release/fallout2-ce.apk
|
||||
retention-days: 7
|
||||
|
||||
ios:
|
||||
name: iOS Release
|
||||
|
||||
runs-on: macos-14
|
||||
|
||||
steps:
|
||||
- name: Clone
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Cache cmake build
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: out
|
||||
key: ios-cmake-v101
|
||||
|
||||
- name: Configure
|
||||
run: |
|
||||
cmake --preset ios
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cmake --build --preset ios-release
|
||||
|
||||
- name: Pack
|
||||
run: |
|
||||
ls -laR .
|
||||
cd out/build/ios
|
||||
# cpack -C Release # No need, we already have .ipa
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fallout2-ce.ipa
|
||||
path: out/build/ios/fallout2-ce.ipa
|
||||
retention-days: 7
|
||||
|
||||
linux:
|
||||
name: Linux ${{ matrix.arch }} Release
|
||||
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
arch:
|
||||
- x86
|
||||
- x64
|
||||
|
||||
steps:
|
||||
- name: Clone
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Dependencies (x86)
|
||||
if: matrix.arch == 'x86'
|
||||
run: |
|
||||
sudo dpkg --add-architecture i386
|
||||
sudo apt update
|
||||
sudo apt install g++-multilib libsdl2-dev:i386 zlib1g-dev:i386
|
||||
|
||||
- name: Dependencies (x64)
|
||||
if: matrix.arch == 'x64'
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install libsdl2-dev zlib1g-dev
|
||||
|
||||
- name: Cache cmake build
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: out
|
||||
key: linux-${{ matrix.arch }}-cmake-v101
|
||||
|
||||
- name: Configure
|
||||
run: |
|
||||
cmake --preset linux-${{ matrix.arch }}-release
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cmake --build --preset linux-${{ matrix.arch }}-release
|
||||
|
||||
- name: Change executable file name
|
||||
run: |
|
||||
mv out/build/linux-${{ matrix.arch }}-release/fallout2-ce out/build/linux-${{ matrix.arch }}-release/fallout2-ce-linux-${{ matrix.arch }}
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fallout2-ce-linux-${{ matrix.arch }}
|
||||
path: out/build/linux-${{ matrix.arch }}-release/fallout2-ce-linux-${{ matrix.arch }}
|
||||
retention-days: 7
|
||||
|
||||
linux-armhf:
|
||||
name: Linux armhf Release
|
||||
|
||||
runs-on: ubuntu-22.04-arm
|
||||
|
||||
steps:
|
||||
- name: Clone
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Dependencies
|
||||
run: |
|
||||
sudo dpkg --add-architecture armhf
|
||||
sudo apt update
|
||||
sudo apt install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf libsdl2-dev:armhf zlib1g-dev:armhf
|
||||
|
||||
- name: Configure
|
||||
run: |
|
||||
cmake \
|
||||
-B build \
|
||||
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-D FALLOUT_VENDORED=OFF \
|
||||
-D CMAKE_SYSTEM_PROCESSOR=arm \
|
||||
-D CMAKE_C_COMPILER=arm-linux-gnueabihf-gcc \
|
||||
-D CMAKE_CXX_COMPILER=arm-linux-gnueabihf-g++ \
|
||||
# EOL
|
||||
|
||||
- name: Build
|
||||
run: cmake --build build
|
||||
|
||||
- name: Change executable file name
|
||||
run: |
|
||||
mv build/fallout2-ce build/fallout2-ce-linux-armhf
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fallout2-ce-linux-armhf
|
||||
path: build/fallout2-ce-linux-armhf
|
||||
retention-days: 7
|
||||
|
||||
linux-arm64:
|
||||
name: Linux arm64 Release
|
||||
runs-on: ubuntu-22.04-arm
|
||||
|
||||
steps:
|
||||
- name: Clone
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install libsdl2-dev zlib1g-dev
|
||||
|
||||
- name: Configure
|
||||
run: cmake -B build -D CMAKE_BUILD_TYPE=RelWithDebInfo -D FALLOUT_VENDORED=OFF
|
||||
|
||||
- name: Build
|
||||
run: cmake --build build
|
||||
|
||||
- name: Change executable file name
|
||||
run: |
|
||||
mv build/fallout2-ce build/fallout2-ce-linux-arm64
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fallout2-ce-linux-arm64
|
||||
path: build/fallout2-ce-linux-arm64
|
||||
retention-days: 7
|
||||
|
||||
macos:
|
||||
name: macOS Release
|
||||
|
||||
runs-on: macos-14
|
||||
|
||||
steps:
|
||||
- name: Clone
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Cache cmake build
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: out
|
||||
key: macos-cmake-v101
|
||||
|
||||
- name: Configure
|
||||
run: |
|
||||
cmake --preset macos
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cmake --build --preset macos-release
|
||||
|
||||
- name: Pack
|
||||
run: |
|
||||
ls -laR .
|
||||
cd out/build/macos
|
||||
# cpack -C Release # There is already .dmg in the folder
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fallout2-ce-macos.dmg
|
||||
path: out/build/macos/Fallout II Community Edition.dmg
|
||||
retention-days: 7
|
||||
|
||||
windows:
|
||||
name: Windows ${{ matrix.arch }} Release
|
||||
|
||||
runs-on: windows-2025
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- arch: x86
|
||||
generator-platform: Win32
|
||||
- arch: x64
|
||||
generator-platform: x64
|
||||
|
||||
steps:
|
||||
- name: Clone
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Visual Studio 2019 Build Tools with v141_xp
|
||||
shell: cmd
|
||||
run: |
|
||||
choco install visualstudio2019buildtools -y --package-parameters="'--add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.v141.x86.x64 --add Microsoft.VisualStudio.Component.VC.v141.xp --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows10SDK.10240 --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.WinXP --add Microsoft.VisualStudio.Component.WinXP'"
|
||||
|
||||
# - name: Cache cmake build
|
||||
# uses: actions/cache@v4
|
||||
# with:
|
||||
# path: out
|
||||
# key: windows-${{ matrix.arch }}-cmake-v101
|
||||
|
||||
- name: Configure
|
||||
shell: cmd
|
||||
run: |
|
||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\VsDevCmd.bat" ^
|
||||
&& cmake --preset windows-${{ matrix.arch }}
|
||||
|
||||
- name: Build
|
||||
shell: cmd
|
||||
run: |
|
||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\VsDevCmd.bat" ^
|
||||
&& cmake --build --preset windows-${{ matrix.arch }}-release
|
||||
|
||||
- name: Change executable file name
|
||||
run: |
|
||||
mv out/build/windows-${{ matrix.arch }}/RelWithDebInfo/fallout2-ce.exe out/build/windows-${{ matrix.arch }}/RelWithDebInfo/fallout2-ce-${{ matrix.arch }}.exe
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fallout2-ce-windows-${{ matrix.arch }}
|
||||
path: out/build/windows-${{ matrix.arch }}/RelWithDebInfo/fallout2-ce-${{ matrix.arch }}.exe
|
||||
retention-days: 7
|
||||
|
||||
|
||||
release:
|
||||
name: Release Continuous build
|
||||
runs-on: ubuntu-latest
|
||||
needs: [android, ios, linux, linux-armhf, linux-arm64, macos, windows]
|
||||
permissions: write-all
|
||||
steps:
|
||||
- name: Fetch artifacts
|
||||
if: ${{ always() && github.ref == 'refs/heads/main' && github.event_name == 'push' }}
|
||||
uses: actions/download-artifact@v4.1.7
|
||||
with:
|
||||
path: artifacts/
|
||||
|
||||
- name: Remove old release
|
||||
if: ${{ always() && github.ref == 'refs/heads/main' && github.event_name == 'push' }}
|
||||
uses: dev-drprasad/delete-tag-and-release@v0.2.1
|
||||
with:
|
||||
delete_release: true
|
||||
tag_name: continious
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Move unpacked artifacts to root folder
|
||||
if: ${{ always() && github.ref == 'refs/heads/main' && github.event_name == 'push' }}
|
||||
run: |
|
||||
ls -Rlah .
|
||||
find .
|
||||
cd artifacts/
|
||||
for folder in *; do
|
||||
if [[ -d "$folder" && "$folder" != "." ]]; then
|
||||
echo "Processing $folder"
|
||||
mv "$folder" "$folder.dir"
|
||||
cd "$folder.dir"
|
||||
for file in *; do
|
||||
if [ -f "$file" ]; then
|
||||
if [ -f "../$file" ]; then
|
||||
echo "ERROR: Duplicate artifact file name $file"
|
||||
exit 1
|
||||
fi
|
||||
if [ -d "../$file" ]; then
|
||||
echo "ERROR: Duplicate artifact folder $file"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Moving $file"
|
||||
mv "$file" "../$file"
|
||||
fi
|
||||
done
|
||||
cd ..
|
||||
rm -rf "$folder.dir"
|
||||
fi
|
||||
done
|
||||
ls -Rlah .
|
||||
find .
|
||||
cd ../
|
||||
|
||||
- name: Allow GitHub to process removed release for few seconds
|
||||
if: ${{ always() && github.ref == 'refs/heads/main' && github.event_name == 'push' }}
|
||||
run: |
|
||||
sleep 20s
|
||||
|
||||
- name: Upload new release
|
||||
if: ${{ always() && github.ref == 'refs/heads/main' && github.event_name == 'push' }}
|
||||
uses: softprops/action-gh-release@v0.1.15
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
files: artifacts/*
|
||||
tag_name: continious
|
||||
draft: false
|
||||
prerelease: false
|
||||
name: Fallout2-CE Continuous Build
|
||||
@@ -86,10 +86,6 @@ jobs:
|
||||
SITE_BASE: ${{ steps.set-path.outputs.SITE_BASE }}
|
||||
F2_GAME_VERSION: Game=${{github.event.pull_request.head.sha || github.sha }}
|
||||
|
||||
- name: Place hash file
|
||||
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)
|
||||
run: echo "$GITHUB_SHA" > fallout2-ce-ems/dist/site_hash.txt
|
||||
|
||||
- name: Install rsync (required for the next step)
|
||||
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)
|
||||
run: |
|
||||
@@ -105,28 +101,6 @@ jobs:
|
||||
clean: false
|
||||
single-commit: true
|
||||
|
||||
|
||||
|
||||
- name: Check that site is deployed
|
||||
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)
|
||||
run: |
|
||||
URL="$SITE_ORIGIN""$SITE_BASE""site_hash.txt"
|
||||
echo "Expecting $GITHUB_SHA from $URL"
|
||||
for i in `seq 1 80`; do
|
||||
got="$(curl -fsSL --max-time 10 "$URL" | tr -d '\r\n' || true)"
|
||||
if [ "$got" = "$GITHUB_SHA" ]; then
|
||||
echo "âś… Match on attempt $i: ${got}"
|
||||
exit 0
|
||||
fi
|
||||
echo "Received $got, waiting"
|
||||
sleep 5
|
||||
done
|
||||
exit 1
|
||||
|
||||
env:
|
||||
SITE_ORIGIN: https://${{ github.repository_owner }}.github.io
|
||||
SITE_BASE: ${{ steps.set-path.outputs.SITE_BASE }}
|
||||
|
||||
- name: Update deployment status
|
||||
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
|
||||
uses: bobheadxi/deployments@v1
|
||||
|
||||
@@ -106,13 +106,13 @@ jobs:
|
||||
|
||||
- name: Change apk file name
|
||||
run: |
|
||||
mv os/android/app/build/outputs/apk/debug/app-debug.apk os/android/app/build/outputs/apk/debug/fallout2-ce-debug.apk
|
||||
mv os/android/app/build/outputs/apk/debug/app-debug.apk os/android/app/build/outputs/apk/debug/fallout2-ce.apk
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fallout2-ce-debug.apk
|
||||
path: os/android/app/build/outputs/apk/debug/fallout2-ce-debug.apk
|
||||
path: os/android/app/build/outputs/apk/debug/fallout2-ce.apk
|
||||
retention-days: 7
|
||||
|
||||
ios:
|
||||
@@ -142,13 +142,12 @@ jobs:
|
||||
run: |
|
||||
cd out/build/ios
|
||||
cpack -C Debug
|
||||
mv fallout2-ce.ipa fallout2-ce-debug.ipa
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fallout2-ce-debug.ipa
|
||||
path: out/build/ios/fallout2-ce-debug.ipa
|
||||
name: fallout2-ce.ipa
|
||||
path: out/build/ios/fallout2-ce.ipa
|
||||
retention-days: 7
|
||||
|
||||
linux:
|
||||
@@ -201,7 +200,7 @@ jobs:
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fallout2-ce-linux-${{ matrix.arch }}-debug
|
||||
name: fallout2-ce-linux-${{ matrix.arch }}
|
||||
path: out/build/linux-${{ matrix.arch }}-debug/fallout2-ce-linux-${{ matrix.arch }}
|
||||
retention-days: 7
|
||||
|
||||
@@ -236,13 +235,13 @@ jobs:
|
||||
|
||||
- name: Change executable file name
|
||||
run: |
|
||||
mv build/fallout2-ce build/fallout2-ce-linux-armhf-debug
|
||||
mv build/fallout2-ce build/fallout2-ce-linux-armhf
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fallout2-ce-linux-armhf-debug
|
||||
path: build/fallout2-ce-linux-armhf-debug
|
||||
name: fallout2-ce-linux-armhf
|
||||
path: build/fallout2-ce-linux-armhf
|
||||
retention-days: 7
|
||||
|
||||
linux-arm64:
|
||||
@@ -267,13 +266,13 @@ jobs:
|
||||
|
||||
- name: Change executable file name
|
||||
run: |
|
||||
mv build/fallout2-ce build/fallout2-ce-linux-arm64-debug
|
||||
mv build/fallout2-ce build/fallout2-ce-linux-arm64
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fallout2-ce-linux-arm64-debug
|
||||
path: build/fallout2-ce-linux-arm64-debug
|
||||
name: fallout2-ce-linux-arm64
|
||||
path: build/fallout2-ce-linux-arm64
|
||||
retention-days: 7
|
||||
|
||||
macos:
|
||||
@@ -303,13 +302,12 @@ jobs:
|
||||
run: |
|
||||
cd out/build/macos
|
||||
cpack -C Debug
|
||||
mv "Fallout II Community Edition.dmg" "Fallout II Community Edition Debug.dmg"
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fallout2-ce-macos-debug.dmg
|
||||
path: out/build/macos/Fallout II Community Edition Debug.dmg
|
||||
name: fallout2-ce-macos.dmg
|
||||
path: out/build/macos/Fallout II Community Edition.dmg
|
||||
retention-days: 7
|
||||
|
||||
windows:
|
||||
@@ -335,11 +333,11 @@ jobs:
|
||||
run: |
|
||||
choco install visualstudio2019buildtools -y --package-parameters="'--add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.v141.x86.x64 --add Microsoft.VisualStudio.Component.VC.v141.xp --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows10SDK.10240 --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.WinXP --add Microsoft.VisualStudio.Component.WinXP'"
|
||||
|
||||
# - name: Cache cmake build
|
||||
# uses: actions/cache@v4
|
||||
# with:
|
||||
# path: out
|
||||
# key: windows-${{ matrix.arch }}-cmake-v102
|
||||
- name: Cache cmake build
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: out
|
||||
key: windows-${{ matrix.arch }}-cmake-v101
|
||||
|
||||
- name: Configure
|
||||
shell: cmd
|
||||
@@ -351,22 +349,22 @@ jobs:
|
||||
shell: cmd
|
||||
run: |
|
||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\VsDevCmd.bat" ^
|
||||
&& cmake --build --preset windows-${{ matrix.arch }}-debug
|
||||
&& cmake --build --preset windows-${{ matrix.arch }}-release
|
||||
|
||||
- name: Change executable file name
|
||||
run: |
|
||||
mv out/build/windows-${{ matrix.arch }}/Debug/fallout2-ce.exe out/build/windows-${{ matrix.arch }}/Debug/fallout2-ce-${{ matrix.arch }}-debug.exe
|
||||
mv out/build/windows-${{ matrix.arch }}/RelWithDebInfo/fallout2-ce.exe out/build/windows-${{ matrix.arch }}/RelWithDebInfo/fallout2-ce-${{ matrix.arch }}.exe
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fallout2-ce-windows-${{ matrix.arch }}-debug
|
||||
path: out/build/windows-${{ matrix.arch }}/Debug/fallout2-ce-${{ matrix.arch }}-debug.exe
|
||||
name: fallout2-ce-windows-${{ matrix.arch }}
|
||||
path: out/build/windows-${{ matrix.arch }}/RelWithDebInfo/fallout2-ce-${{ matrix.arch }}.exe
|
||||
retention-days: 7
|
||||
|
||||
|
||||
release:
|
||||
name: Debug Release Continuous build
|
||||
name: Release Continuous build
|
||||
runs-on: ubuntu-latest
|
||||
needs: [android, ios, linux, linux-armhf, linux-arm64, macos, windows]
|
||||
permissions: write-all
|
||||
@@ -382,7 +380,7 @@ jobs:
|
||||
uses: dev-drprasad/delete-tag-and-release@v0.2.1
|
||||
with:
|
||||
delete_release: true
|
||||
tag_name: continious-debug
|
||||
tag_name: continious
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -431,7 +429,7 @@ jobs:
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
files: artifacts/*
|
||||
tag_name: continious-debug
|
||||
tag_name: continious
|
||||
draft: false
|
||||
prerelease: true
|
||||
name: Fallout2-CE Continuous Build
|
||||
+26
-2
@@ -1,6 +1,7 @@
|
||||
#include "mouse.h"
|
||||
|
||||
#include "color.h"
|
||||
#include "debug.h"
|
||||
#include "dinput.h"
|
||||
#include "input.h"
|
||||
#include "kb.h"
|
||||
@@ -53,6 +54,10 @@ static unsigned char* _mouse_fptr = nullptr;
|
||||
// 0x51E2A0
|
||||
static double gMouseSensitivity = 1.0;
|
||||
|
||||
static double gMouseSensitivityDpiHorizontal = 1.0;
|
||||
static double gMouseSensitivityDpiVertical = 1.0;
|
||||
double gMouseSensitivityScale2Xoption = 1.0;
|
||||
|
||||
// 0x51E2AC
|
||||
static int last_buttons = 0;
|
||||
|
||||
@@ -454,8 +459,8 @@ void _mouse_info()
|
||||
}
|
||||
|
||||
// Adjust for mouse senstivity.
|
||||
x = (int)(x * gMouseSensitivity);
|
||||
y = (int)(y * gMouseSensitivity);
|
||||
x = (int)(x * gMouseSensitivity * gMouseSensitivityDpiHorizontal * gMouseSensitivityScale2Xoption);
|
||||
y = (int)(y * gMouseSensitivity * gMouseSensitivityDpiVertical * gMouseSensitivityScale2Xoption);
|
||||
|
||||
_mouse_simulate_input(x, y, buttons);
|
||||
|
||||
@@ -676,6 +681,25 @@ void mouseSetSensitivity(double value)
|
||||
if (value >= 1.0 && value <= 2.5) {
|
||||
gMouseSensitivity = value;
|
||||
}
|
||||
|
||||
gMouseSensitivityDpiHorizontal = 1.0;
|
||||
gMouseSensitivityDpiVertical = 1.0;
|
||||
if (gSdlWindow) {
|
||||
int displayIndex = SDL_GetWindowDisplayIndex(gSdlWindow);
|
||||
float ddpi, hdpi, vdpi;
|
||||
if (SDL_GetDisplayDPI(displayIndex, &ddpi, &hdpi, &vdpi) == 0) {
|
||||
hdpi /= 96.0f; // 96 is standard DPI
|
||||
vdpi /= 96.0f; // 96 is standard DPI
|
||||
gMouseSensitivityDpiHorizontal = 1 / hdpi;
|
||||
gMouseSensitivityDpiVertical = 1 / vdpi;
|
||||
debugPrint("Mouse DPI scaling: horizontal = %.2f, vertical = %.2f", hdpi, vdpi);
|
||||
debugPrint("Mouse DPI sensitivity: horizontal = %.2f, vertical = %.2f", gMouseSensitivityDpiHorizontal, gMouseSensitivityDpiVertical);
|
||||
} else {
|
||||
debugPrint("Mouse DPI sensitivity is not available, SDL_GetDisplayDPI failed");
|
||||
}
|
||||
} else {
|
||||
debugPrint("Mouse DPI sensitivity is not available, SDL window is null");
|
||||
}
|
||||
}
|
||||
|
||||
void mouseGetPositionInWindow(int win, int* x, int* y)
|
||||
|
||||
@@ -54,6 +54,7 @@ void mouseGetWheel(int* x, int* y);
|
||||
void convertMouseWheelToArrowKey(int* keyCodePtr);
|
||||
int mouse_get_last_buttons();
|
||||
|
||||
extern double gMouseSensitivityScale2Xoption;
|
||||
} // namespace fallout
|
||||
|
||||
#endif /* FALLOUT_MOUSE_H_ */
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <SDL.h>
|
||||
|
||||
#include "config.h"
|
||||
#include "debug.h"
|
||||
#include "draw.h"
|
||||
#include "interface.h"
|
||||
#include "memory.h"
|
||||
@@ -186,6 +187,14 @@ int _GNW95_init_mode_ex(int width, int height, int bpp)
|
||||
_zero_mem = _GNW95_zero_vid_mem;
|
||||
_mouse_blit = _GNW95_ShowRect;
|
||||
|
||||
if (scale != 1) {
|
||||
gMouseSensitivityScale2Xoption = 1.0 / scale;
|
||||
debugPrint("Mouse sensitivity adjusted according to scale into %f\n", gMouseSensitivityScale2Xoption);
|
||||
} else {
|
||||
gMouseSensitivityScale2Xoption = 1.0;
|
||||
debugPrint("Mouse sensitivity not adjusted for 2X scale\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user