mirror of
https://github.com/fallout2-ce/fallout2-ce.git
synced 2026-07-27 16:47:11 -07:00
Compare commits
187
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0ee6c264c2 | ||
|
|
462063ca85 | ||
|
|
f17c61efa6 | ||
|
|
e996107403 | ||
|
|
933e5bf822 | ||
|
|
e084300713 | ||
|
|
325c86ddfc | ||
|
|
324957526f | ||
|
|
acd5d979c9 | ||
|
|
c2cd174516 | ||
|
|
4cb451de51 | ||
|
|
33c2cf268d | ||
|
|
b47af8de8d | ||
|
|
efd4f9e434 | ||
|
|
2d0a2047ba | ||
|
|
87e1d1f11b | ||
|
|
5d17e0ef89 | ||
|
|
2bf08228c5 | ||
|
|
571b43410d | ||
|
|
f0e6002df9 | ||
|
|
d593c481f2 | ||
|
|
76f3d82679 | ||
|
|
0e1270a606 | ||
|
|
55a32a00ab | ||
|
|
7b9b545baa | ||
|
|
a96edd9f0c | ||
|
|
55c528f346 | ||
|
|
5c28dc798f | ||
|
|
7ef6943588 | ||
|
|
40bbd6c02a | ||
|
|
45c491c11f | ||
|
|
18c05d438e | ||
|
|
c3a501a644 | ||
|
|
2767a399c5 | ||
|
|
1237d8561d | ||
|
|
89b6812711 | ||
|
|
339146c5b3 | ||
|
|
3949c5d7c1 | ||
|
|
84a64035e8 | ||
|
|
164be5105a | ||
|
|
d532e4c398 | ||
|
|
950c12dbf7 | ||
|
|
2be9b7db65 | ||
|
|
138ce8be9b | ||
|
|
96b9323a97 | ||
|
|
7c6d339e3d | ||
|
|
2ec8240820 | ||
|
|
ca72573c14 | ||
|
|
9974a23c1e | ||
|
|
cd6cce3f34 | ||
|
|
361b9a0b30 | ||
|
|
7c7cb87f65 | ||
|
|
20bcb2360c | ||
|
|
75dbc98321 | ||
|
|
d792cfa32e | ||
|
|
e81a07dcaf | ||
|
|
0d78119680 | ||
|
|
79d0fcfcaa | ||
|
|
2d5e69d740 | ||
|
|
b5cf3ee148 | ||
|
|
a571a985c6 | ||
|
|
6ccba74836 | ||
|
|
30c3af01f5 | ||
|
|
fd25944a9e | ||
|
|
41c5d77f89 | ||
|
|
75513058a5 | ||
|
|
0cf55eca75 | ||
|
|
e6cbdd5466 | ||
|
|
90f634b285 | ||
|
|
666ee6f41c | ||
|
|
4342aefa5d | ||
|
|
7224c7d7fb | ||
|
|
dff7529707 | ||
|
|
2435b33480 | ||
|
|
c4652d799a | ||
|
|
5140b00ccf | ||
|
|
f1ba068d05 | ||
|
|
01db7078c7 | ||
|
|
64fd857da6 | ||
|
|
555652d9c3 | ||
|
|
8c35203b7d | ||
|
|
0303a00299 | ||
|
|
dd16e374ee | ||
|
|
ce4495589b | ||
|
|
af350914ef | ||
|
|
8dd2afc4fa | ||
|
|
240aa8a212 | ||
|
|
c58b5eac1d | ||
|
|
0bd8a76b05 | ||
|
|
853266b380 | ||
|
|
0adc9c9e77 | ||
|
|
150e734955 | ||
|
|
d0ba0151d1 | ||
|
|
67c70661a6 | ||
|
|
9c4efeb59d | ||
|
|
ea0afc84fa | ||
|
|
c663d79b97 | ||
|
|
8bd87be687 | ||
|
|
8101c78e78 | ||
|
|
9b5737a14e | ||
|
|
3d4c073856 | ||
|
|
f868ac0e1a | ||
|
|
eaa9091bcd | ||
|
|
76ab99cf73 | ||
|
|
bed9555f9a | ||
|
|
9c5294ca88 | ||
|
|
781d8ab282 | ||
|
|
34ef1c2f26 | ||
|
|
fdc54cfd0b | ||
|
|
a63aff09ce | ||
|
|
3d2aced2f7 | ||
|
|
1d6111b89f | ||
|
|
21c906cc5c | ||
|
|
a67fe7ead1 | ||
|
|
f0691d2c24 | ||
|
|
fb30648e2e | ||
|
|
216cbb3861 | ||
|
|
be63df4bf6 | ||
|
|
4cf35fd946 | ||
|
|
dd418ee0f5 | ||
|
|
eb5cc7be4f | ||
|
|
a8f2de1a56 | ||
|
|
51b82ac1ac | ||
|
|
0d97222797 | ||
|
|
b30463ab01 | ||
|
|
9d932b0d2c | ||
|
|
8d76b9655c | ||
|
|
0e6c4d9684 | ||
|
|
02c5efac26 | ||
|
|
ea4d978bc1 | ||
|
|
22548a3c70 | ||
|
|
cd6ca76988 | ||
|
|
5d3cbd567a | ||
|
|
70ef1d4009 | ||
|
|
3acf0ac6c4 | ||
|
|
a73c336ead | ||
|
|
d46aea53bd | ||
|
|
3dc89d49e2 | ||
|
|
822d5dfd7d | ||
|
|
879634bf9c | ||
|
|
795ef54d70 | ||
|
|
14b06d2dcc | ||
|
|
ed959edbbb | ||
|
|
7940ea791c | ||
|
|
3f270aa4cc | ||
|
|
da3f1cc426 | ||
|
|
a892461dac | ||
|
|
209d2d027b | ||
|
|
b8385d7775 | ||
|
|
a3c365f9fe | ||
|
|
87d4a4b8ca | ||
|
|
1aa53a4720 | ||
|
|
6bcf2952f6 | ||
|
|
e2927e1d0e | ||
|
|
bb839cd6c1 | ||
|
|
caa0e1bf1a | ||
|
|
f3759d07a5 | ||
|
|
604fde895f | ||
|
|
f46c391e5d | ||
|
|
1e45b0184b | ||
|
|
447ea23862 | ||
|
|
72786c4d43 | ||
|
|
3d3e47c9db | ||
|
|
a9726cab56 | ||
|
|
400aa4d8a3 | ||
|
|
599d3ab392 | ||
|
|
84336d4655 | ||
|
|
696e926177 | ||
|
|
30babd7e1f | ||
|
|
6ff0b411e4 | ||
|
|
9f623f3f3e | ||
|
|
d8bee457f4 | ||
|
|
fcabd63561 | ||
|
|
73c024c705 | ||
|
|
27da084b65 | ||
|
|
dfa610f352 | ||
|
|
a0a597725a | ||
|
|
7ae194a8ee | ||
|
|
7f7e103465 | ||
|
|
59c64451ff | ||
|
|
965f360578 | ||
|
|
3f79d79f25 | ||
|
|
cad023a73e | ||
|
|
7490c900b3 | ||
|
|
7c182b66a6 | ||
|
|
f6320d3a66 | ||
|
|
de06827c01 |
@@ -0,0 +1,384 @@
|
||||
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
|
||||
@@ -14,6 +14,16 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
permissions: write-all
|
||||
steps:
|
||||
- name: start deployment
|
||||
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
|
||||
uses: bobheadxi/deployments@v1
|
||||
id: deployment
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
step: start
|
||||
debug: true
|
||||
env: preview-${{ github.event.pull_request.number }}
|
||||
|
||||
- name: Clone
|
||||
uses: actions/checkout@v4
|
||||
|
||||
@@ -76,6 +86,10 @@ 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: |
|
||||
@@ -91,10 +105,37 @@ jobs:
|
||||
clean: false
|
||||
single-commit: true
|
||||
|
||||
- name: Comment preview URL on PR
|
||||
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
|
||||
|
||||
|
||||
- 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: |
|
||||
gh pr comment ${{ github.event.pull_request.number }} \
|
||||
--body "🚀 WebAssembly PR Preview for ${{github.event.pull_request.head.sha || github.sha }} is available at: https://${{ github.repository_owner }}.github.io/fallout2-ce/PR-${{ github.event.pull_request.number }}/"
|
||||
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:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
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
|
||||
with:
|
||||
step: finish
|
||||
status: success
|
||||
debug: true
|
||||
env: ${{ steps.deployment.outputs.env }}
|
||||
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
env_url: https://${{ github.repository_owner }}.github.io/fallout2-ce/PR-${{ github.event.pull_request.number }}/
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ jobs:
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: os/android/app/.cxx
|
||||
key: android-cmake-v100
|
||||
key: android-cmake-v101
|
||||
|
||||
- name: Setup signing config
|
||||
if: env.KEYSTORE_FILE_BASE64 != '' && env.KEYSTORE_PROPERTIES_FILE_BASE64 != ''
|
||||
@@ -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.apk
|
||||
mv os/android/app/build/outputs/apk/debug/app-debug.apk os/android/app/build/outputs/apk/debug/fallout2-ce-debug.apk
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fallout2-ce-debug.apk
|
||||
path: os/android/app/build/outputs/apk/debug/fallout2-ce.apk
|
||||
path: os/android/app/build/outputs/apk/debug/fallout2-ce-debug.apk
|
||||
retention-days: 7
|
||||
|
||||
ios:
|
||||
@@ -128,7 +128,7 @@ jobs:
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: out
|
||||
key: ios-cmake-v100
|
||||
key: ios-cmake-v101
|
||||
|
||||
- name: Configure
|
||||
run: |
|
||||
@@ -142,12 +142,13 @@ 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.ipa
|
||||
path: out/build/ios/fallout2-ce.ipa
|
||||
name: fallout2-ce-debug.ipa
|
||||
path: out/build/ios/fallout2-ce-debug.ipa
|
||||
retention-days: 7
|
||||
|
||||
linux:
|
||||
@@ -183,7 +184,7 @@ jobs:
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: out
|
||||
key: linux-${{ matrix.arch }}-cmake-v100
|
||||
key: linux-${{ matrix.arch }}-cmake-v101
|
||||
|
||||
- name: Configure
|
||||
run: |
|
||||
@@ -200,7 +201,7 @@ jobs:
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fallout2-ce-linux-${{ matrix.arch }}
|
||||
name: fallout2-ce-linux-${{ matrix.arch }}-debug
|
||||
path: out/build/linux-${{ matrix.arch }}-debug/fallout2-ce-linux-${{ matrix.arch }}
|
||||
retention-days: 7
|
||||
|
||||
@@ -235,13 +236,13 @@ jobs:
|
||||
|
||||
- name: Change executable file name
|
||||
run: |
|
||||
mv build/fallout2-ce build/fallout2-ce-linux-armhf
|
||||
mv build/fallout2-ce build/fallout2-ce-linux-armhf-debug
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fallout2-ce-linux-armhf
|
||||
path: build/fallout2-ce-linux-armhf
|
||||
name: fallout2-ce-linux-armhf-debug
|
||||
path: build/fallout2-ce-linux-armhf-debug
|
||||
retention-days: 7
|
||||
|
||||
linux-arm64:
|
||||
@@ -266,13 +267,13 @@ jobs:
|
||||
|
||||
- name: Change executable file name
|
||||
run: |
|
||||
mv build/fallout2-ce build/fallout2-ce-linux-arm64
|
||||
mv build/fallout2-ce build/fallout2-ce-linux-arm64-debug
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fallout2-ce-linux-arm64
|
||||
path: build/fallout2-ce-linux-arm64
|
||||
name: fallout2-ce-linux-arm64-debug
|
||||
path: build/fallout2-ce-linux-arm64-debug
|
||||
retention-days: 7
|
||||
|
||||
macos:
|
||||
@@ -288,7 +289,7 @@ jobs:
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: out
|
||||
key: macos-cmake-v100
|
||||
key: macos-cmake-v101
|
||||
|
||||
- name: Configure
|
||||
run: |
|
||||
@@ -302,12 +303,13 @@ 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.dmg
|
||||
path: out/build/macos/Fallout II Community Edition.dmg
|
||||
name: fallout2-ce-macos-debug.dmg
|
||||
path: out/build/macos/Fallout II Community Edition Debug.dmg
|
||||
retention-days: 7
|
||||
|
||||
windows:
|
||||
@@ -333,11 +335,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-v100
|
||||
# - name: Cache cmake build
|
||||
# uses: actions/cache@v4
|
||||
# with:
|
||||
# path: out
|
||||
# key: windows-${{ matrix.arch }}-cmake-v102
|
||||
|
||||
- name: Configure
|
||||
shell: cmd
|
||||
@@ -349,22 +351,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 }}-release
|
||||
&& cmake --build --preset windows-${{ matrix.arch }}-debug
|
||||
|
||||
- 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
|
||||
mv out/build/windows-${{ matrix.arch }}/Debug/fallout2-ce.exe out/build/windows-${{ matrix.arch }}/Debug/fallout2-ce-${{ matrix.arch }}-debug.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
|
||||
name: fallout2-ce-windows-${{ matrix.arch }}-debug
|
||||
path: out/build/windows-${{ matrix.arch }}/Debug/fallout2-ce-${{ matrix.arch }}-debug.exe
|
||||
retention-days: 7
|
||||
|
||||
|
||||
release:
|
||||
name: Release Continuous build
|
||||
name: Debug Release Continuous build
|
||||
runs-on: ubuntu-latest
|
||||
needs: [android, ios, linux, linux-armhf, linux-arm64, macos, windows]
|
||||
permissions: write-all
|
||||
@@ -380,7 +382,7 @@ jobs:
|
||||
uses: dev-drprasad/delete-tag-and-release@v0.2.1
|
||||
with:
|
||||
delete_release: true
|
||||
tag_name: continious
|
||||
tag_name: continious-debug
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -429,7 +431,7 @@ jobs:
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
files: artifacts/*
|
||||
tag_name: continious
|
||||
tag_name: continious-debug
|
||||
draft: false
|
||||
prerelease: true
|
||||
name: Fallout2-CE Continuous Build
|
||||
@@ -12,6 +12,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
deployments: write
|
||||
steps:
|
||||
- name: Checkout gh-pages branch
|
||||
uses: actions/checkout@v4
|
||||
@@ -43,4 +44,12 @@ jobs:
|
||||
else
|
||||
git commit --amend -m "đźš® Remove preview for closed PR #${{ github.event.pull_request.number }}"
|
||||
git push --force
|
||||
fi
|
||||
fi
|
||||
|
||||
- name: mark environment as deactivated
|
||||
uses: bobheadxi/deployments@v1
|
||||
with:
|
||||
step: deactivate-env
|
||||
env: preview-${{ github.event.pull_request.number }}
|
||||
desc: Environment was pruned
|
||||
debug: true
|
||||
|
||||
@@ -288,10 +288,16 @@ target_sources(${EXECUTABLE_NAME} PUBLIC
|
||||
"src/sfall_opcodes.h"
|
||||
"src/sfall_arrays.cc"
|
||||
"src/sfall_arrays.h"
|
||||
"src/sfall_callbacks.cc"
|
||||
"src/sfall_callbacks.h"
|
||||
"src/touch.cc"
|
||||
"src/touch.h"
|
||||
"src/scan_unimplemented.cc"
|
||||
"third_party/lodepng/lodepng.cpp"
|
||||
)
|
||||
|
||||
target_include_directories(${EXECUTABLE_NAME} PUBLIC "third_party/lodepng")
|
||||
|
||||
if(IOS)
|
||||
target_sources(${EXECUTABLE_NAME} PUBLIC
|
||||
"src/platform/ios/paths.h"
|
||||
|
||||
@@ -44,7 +44,7 @@ $ sudo apt install libsdl2-2.0-0
|
||||
|
||||
- Alternatively you can use Fallout 2 from Macplay/The Omni Group as a base - you need to extract game assets from the original bundle. Mount CD/DMG, right click `Fallout 2` -> `Show Package Contents`, navigate to `Contents/Resources`. Copy `GameData` folder somewhere, for example `/Applications/Fallout2`.
|
||||
|
||||
- Or if you're a Terminal user and have Homebrew installed you can extract the needed files from the GoG installer:
|
||||
- Or if you're a Terminal user and have Homebrew installed you can extract the needed files from the GoG installer. **Note**: You must use "Offline backup game installer", not the main game installer.
|
||||
|
||||
```console
|
||||
$ brew install innoextract
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
#include "test_utils.h"
|
||||
#include "sfall.h"
|
||||
|
||||
procedure start begin
|
||||
display_msg("Testing iface_tag functions...");
|
||||
// assumes no iface tags active in the save game
|
||||
|
||||
// SNEAK
|
||||
show_iface_tag(0);
|
||||
call assertTrue("show_iface_tag(SNEAK)", is_iface_tag_active(0));
|
||||
hide_iface_tag(0);
|
||||
call assertFalse("hide_iface_tag(SNEAK)", is_iface_tag_active(0));
|
||||
|
||||
// LEVEL
|
||||
show_iface_tag(3);
|
||||
call assertTrue("show_iface_tag(LEVEL)", is_iface_tag_active(3));
|
||||
hide_iface_tag(3);
|
||||
call assertFalse("hide_iface_tag(LEVEL)", is_iface_tag_active(3));
|
||||
|
||||
// ADDICTED
|
||||
show_iface_tag(4);
|
||||
call assertTrue("show_iface_tag(ADDICTED)", is_iface_tag_active(4));
|
||||
hide_iface_tag(4);
|
||||
call assertFalse("hide_iface_tag(ADDICTED)", is_iface_tag_active(4));
|
||||
|
||||
// POISONED
|
||||
call assertFalse("hide_iface_tag(POISONED)", is_iface_tag_active(1));
|
||||
|
||||
// RADIATED
|
||||
call assertFalse("hide_iface_tag(RADIATED)", is_iface_tag_active(2));
|
||||
|
||||
call report_test_results("iface_tag");
|
||||
end
|
||||
@@ -0,0 +1,14 @@
|
||||
|
||||
#include "sfall.h"
|
||||
|
||||
// this is the basic message_box function used by RPU and Et Tu
|
||||
#define message_box_warning(text) message_box4(text, 0x01, 134, 145)
|
||||
|
||||
procedure start begin
|
||||
// I don't see a practice way to auto test message_box, so this is just a way to do manual testing
|
||||
variable ret = message_box1("Basic Dialog\nwith multiple lines\nand such.");
|
||||
display_msg("chose: " + ret);
|
||||
message_box2("Basic Dialog\nwith default flags.", -1); // -1 means use default flags
|
||||
message_box2("Basic Dialog\nsmall.", 0x02);
|
||||
message_box_warning("Missing config values\n(just testing).");
|
||||
end
|
||||
@@ -0,0 +1,30 @@
|
||||
#include "test_utils.h"
|
||||
#include "sfall.h"
|
||||
|
||||
procedure start begin
|
||||
|
||||
display_msg("Testing metarule_exist functions...");
|
||||
|
||||
call assertEquals("string_format", metarule_exist("string_format"), 1);
|
||||
call assertEquals("metarule_exist", metarule_exist("metarule_exist"), 1);
|
||||
|
||||
// This will fail on sFall
|
||||
call assertEquals("opcode_exists", metarule_exist("opcode_exists"), 1);
|
||||
|
||||
if metarule_exist("opcode_exists") then begin // And example if how to use it
|
||||
#define opcode_exists(opcode) sfall_func1("opcode_exists", opcode)
|
||||
#define OP_GET_UPTIME 0x81B3
|
||||
#define OP_NOOP 0x8000
|
||||
#define OP_WRITE_INT 0x81D1
|
||||
|
||||
call assertEquals("opcode_exists OP_GET_UPTIME", opcode_exists(OP_GET_UPTIME), 1);
|
||||
call assertEquals("opcode_exists OP_NOOP", opcode_exists(OP_NOOP), 1);
|
||||
// Probably will never be implemented on fallout2-ce
|
||||
call assertEquals("opcode_exists OP_WRITE_INT", opcode_exists(OP_WRITE_INT), 0);
|
||||
call assertEquals("opcode_exists 0xFFFF", opcode_exists(0xFFFF), 0);
|
||||
end else begin
|
||||
display_msg("Opcode exists metarule is not available, skipping tests.");
|
||||
end
|
||||
|
||||
call report_test_results("metarule_exist");
|
||||
end
|
||||
@@ -0,0 +1,7 @@
|
||||
#include "sfall.h"
|
||||
|
||||
procedure start begin
|
||||
// this isn't a unit test, just a way to easily test different values manually
|
||||
display_msg("Setting world map mult");
|
||||
set_map_time_multi(1.0);
|
||||
end
|
||||
@@ -18,6 +18,17 @@ procedure assertTrue(variable desc, variable a) begin
|
||||
end
|
||||
end
|
||||
|
||||
procedure assertFalse(variable desc, variable a) begin
|
||||
test_suite_assertions++;
|
||||
|
||||
if (a) then begin
|
||||
display_msg("Assertion failed \""+desc+"\": is not false");
|
||||
test_suite_errors ++;
|
||||
end else if (test_suite_verbose) then begin
|
||||
display_msg("Assert \""+desc+"\" ok");
|
||||
end
|
||||
end
|
||||
|
||||
procedure assertEquals(variable desc, variable a, variable b) begin
|
||||
test_suite_assertions++;
|
||||
|
||||
|
||||
+5
-18
@@ -1032,9 +1032,7 @@ int _action_climb_ladder(Object* critter, Object* ladder)
|
||||
reg_anim_begin(animationRequestOptions);
|
||||
|
||||
int tile = tileGetTileInDirection(ladder->tile, ROTATION_SE, 1);
|
||||
int walkDistance = 5;
|
||||
configGetInt(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_USE_WALK_DISTANCE, &walkDistance);
|
||||
if (actionPoints != -1 || objectGetDistanceBetween(critter, ladder) < walkDistance) {
|
||||
if (actionPoints != -1 || objectWithinWalkDistance(critter, ladder)) {
|
||||
animationRegisterMoveToTile(critter, tile, ladder->elevation, actionPoints, 0);
|
||||
} else {
|
||||
animationRegisterRunToTile(critter, tile, ladder->elevation, actionPoints, 0);
|
||||
@@ -1101,9 +1099,7 @@ int _action_use_an_item_on_object(Object* user, Object* targetObj, Object* item)
|
||||
|
||||
reg_anim_begin(animationRequestOptions);
|
||||
|
||||
int walkDistance = 5;
|
||||
configGetInt(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_USE_WALK_DISTANCE, &walkDistance);
|
||||
if (actionPoints != -1 || objectGetDistanceBetween(user, targetObj) < walkDistance) {
|
||||
if (actionPoints != -1 || objectWithinWalkDistance(user, targetObj)) {
|
||||
animationRegisterMoveToObject(user, targetObj, actionPoints, 0);
|
||||
} else {
|
||||
animationRegisterRunToObject(user, targetObj, -1, 0);
|
||||
@@ -1173,15 +1169,12 @@ int actionPickUp(Object* critter, Object* item)
|
||||
}
|
||||
}
|
||||
|
||||
int walkDistance = 5;
|
||||
configGetInt(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_USE_WALK_DISTANCE, &walkDistance);
|
||||
|
||||
if (isInCombat()) {
|
||||
reg_anim_begin(ANIMATION_REQUEST_RESERVED);
|
||||
animationRegisterMoveToObject(critter, item, critter->data.critter.combat.ap, 0);
|
||||
} else {
|
||||
reg_anim_begin(critter == gDude ? ANIMATION_REQUEST_RESERVED : ANIMATION_REQUEST_UNRESERVED);
|
||||
if (objectGetDistanceBetween(critter, item) >= walkDistance) {
|
||||
if (!objectWithinWalkDistance(critter, item)) {
|
||||
animationRegisterRunToObject(critter, item, -1, 0);
|
||||
} else {
|
||||
animationRegisterMoveToObject(critter, item, -1, 0);
|
||||
@@ -1281,16 +1274,13 @@ int _action_loot_container(Object* critter, Object* container)
|
||||
}
|
||||
}
|
||||
|
||||
int walkDistance = 5;
|
||||
configGetInt(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_USE_WALK_DISTANCE, &walkDistance);
|
||||
|
||||
if (isInCombat()) {
|
||||
reg_anim_begin(ANIMATION_REQUEST_RESERVED);
|
||||
animationRegisterMoveToObject(critter, container, critter->data.critter.combat.ap, 0);
|
||||
} else {
|
||||
reg_anim_begin(critter == gDude ? ANIMATION_REQUEST_RESERVED : ANIMATION_REQUEST_UNRESERVED);
|
||||
|
||||
if (objectGetDistanceBetween(critter, container) < walkDistance) {
|
||||
if (objectWithinWalkDistance(critter, container)) {
|
||||
animationRegisterMoveToObject(critter, container, -1, 0);
|
||||
} else {
|
||||
animationRegisterRunToObject(critter, container, -1, 0);
|
||||
@@ -1488,16 +1478,13 @@ int actionUseSkill(Object* user, Object* target, int skill)
|
||||
}
|
||||
}
|
||||
|
||||
int walkDistance = 5;
|
||||
configGetInt(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_USE_WALK_DISTANCE, &walkDistance);
|
||||
|
||||
if (isInCombat()) {
|
||||
reg_anim_begin(ANIMATION_REQUEST_RESERVED);
|
||||
animationRegisterMoveToObject(performer, target, performer->data.critter.combat.ap, 0);
|
||||
} else {
|
||||
reg_anim_begin(user == gDude ? ANIMATION_REQUEST_RESERVED : ANIMATION_REQUEST_UNRESERVED);
|
||||
if (target != gDude) {
|
||||
if (objectGetDistanceBetween(performer, target) >= walkDistance) {
|
||||
if (!objectWithinWalkDistance(performer, target)) {
|
||||
animationRegisterRunToObject(performer, target, -1, 0);
|
||||
} else {
|
||||
animationRegisterMoveToObject(performer, target, -1, 0);
|
||||
|
||||
+6
-4
@@ -1713,16 +1713,18 @@ static bool canUseDoor(Object* critter, Object* door)
|
||||
}
|
||||
|
||||
// 0x415EE8
|
||||
int _make_path(Object* object, int from, int to, unsigned char* rotations, int a5)
|
||||
int _make_path(Object* object, int from, int to, unsigned char* rotations, int requireEmptyDest)
|
||||
{
|
||||
return pathfinderFindPath(object, from, to, rotations, a5, _obj_blocking_at);
|
||||
return pathfinderFindPath(object, from, to, rotations, requireEmptyDest, _obj_blocking_at);
|
||||
}
|
||||
|
||||
// TODO: move pathfinding into another unit
|
||||
// If requireEmptyDest == 1, will not return a path if the destination tile is blocked (according to `callback`).
|
||||
// Returns path length, or 0 if no path is available.
|
||||
// 0x415EFC
|
||||
int pathfinderFindPath(Object* object, int from, int to, unsigned char* rotations, int a5, PathBuilderCallback* callback)
|
||||
int pathfinderFindPath(Object* object, int from, int to, unsigned char* rotations, int requireEmptyDest, PathBuilderCallback* callback)
|
||||
{
|
||||
if (a5) {
|
||||
if (requireEmptyDest) {
|
||||
if (callback(object, to, object->elevation) != nullptr) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
+2
-2
@@ -143,8 +143,8 @@ int animationRegisterToggleOutline(Object* object, bool outline, int delay);
|
||||
int animationRegisterPlaySoundEffect(Object* owner, const char* soundEffectName, int delay);
|
||||
int animationRegisterAnimateForever(Object* owner, int anim, int delay);
|
||||
int animationRegisterPing(int flags, int delay);
|
||||
int _make_path(Object* object, int from, int to, unsigned char* a4, int a5);
|
||||
int pathfinderFindPath(Object* object, int from, int to, unsigned char* rotations, int a5, PathBuilderCallback* callback);
|
||||
int _make_path(Object* object, int from, int to, unsigned char* rotations, int requireEmptyDest);
|
||||
int pathfinderFindPath(Object* object, int from, int to, unsigned char* rotations, int requireEmptyDest, PathBuilderCallback* callback);
|
||||
int _make_straight_path(Object* object, int from, int to, StraightPathNode* straightPathNodeList, Object** obstaclePtr, int a6);
|
||||
int _make_straight_path_func(Object* object, int from, int to, StraightPathNode* straightPathNodeList, Object** obstaclePtr, int a6, PathBuilderCallback* callback);
|
||||
void _object_animate();
|
||||
|
||||
+14
-1
@@ -1,5 +1,6 @@
|
||||
#include "art.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -619,7 +620,7 @@ char* artBuildFilePath(int fid)
|
||||
|
||||
v2 = fid;
|
||||
|
||||
v10 = (fid & 0x70000000) >> 28;
|
||||
v10 = FID_ROTATION(fid);
|
||||
|
||||
v1 = artAliasFid(fid);
|
||||
if (v1 != -1) {
|
||||
@@ -702,8 +703,13 @@ static int artReadList(const char* path, char** artListPtr, int* artListSizePtr)
|
||||
artList[12] = '\0';
|
||||
|
||||
artList += 13;
|
||||
|
||||
count--;
|
||||
}
|
||||
|
||||
// Sanity check. There was a bug with uncompressed database file seek
|
||||
assert(count == 0);
|
||||
|
||||
fileClose(stream);
|
||||
|
||||
return 0;
|
||||
@@ -1006,6 +1012,13 @@ static void artCacheFreeImpl(void* ptr)
|
||||
internal_free(ptr);
|
||||
}
|
||||
|
||||
/* FID Structure:
|
||||
3 bits for rotation
|
||||
4 bits for object type
|
||||
8 bits for animation type
|
||||
4 bits for weapon code
|
||||
12 bits for frame ID
|
||||
*/
|
||||
static int buildFidInternal(unsigned short frmId, unsigned char weaponCode, unsigned char animType, unsigned char objectType, unsigned char rotation)
|
||||
{
|
||||
return ((rotation << 28) & 0x70000000) | (objectType << 24) | ((animType << 16) & 0xFF0000) | ((weaponCode << 12) & 0xF000) | (frmId & 0xFFF);
|
||||
|
||||
+2
-1
@@ -324,7 +324,8 @@ void automapShow(bool isInGame, bool isUsingScanner)
|
||||
|
||||
int automapWindowX = (screenGetWidth() - AUTOMAP_WINDOW_WIDTH) / 2;
|
||||
int automapWindowY = (screenGetHeight() - AUTOMAP_WINDOW_HEIGHT) / 2;
|
||||
int window = windowCreate(automapWindowX, automapWindowY, AUTOMAP_WINDOW_WIDTH, AUTOMAP_WINDOW_HEIGHT, color, WINDOW_MODAL | WINDOW_MOVE_ON_TOP);
|
||||
// adding WINDOW_TRANSPARENT and WINDOW_DRAGGABLE_BY_BACKGROUND for testing temporarily
|
||||
int window = windowCreate(automapWindowX, automapWindowY, AUTOMAP_WINDOW_WIDTH, AUTOMAP_WINDOW_HEIGHT, color, WINDOW_MODAL | WINDOW_MOVE_ON_TOP | WINDOW_TRANSPARENT | WINDOW_DRAGGABLE_BY_BACKGROUND);
|
||||
|
||||
int scannerBtn = buttonCreate(window,
|
||||
111,
|
||||
|
||||
+7
-3
@@ -36,6 +36,7 @@
|
||||
#include "random.h"
|
||||
#include "scripts.h"
|
||||
#include "settings.h"
|
||||
#include "sfall_callbacks.h"
|
||||
#include "sfall_config.h"
|
||||
#include "sfall_global_scripts.h"
|
||||
#include "skill.h"
|
||||
@@ -2620,7 +2621,7 @@ static void _combat_begin(Object* attacker)
|
||||
100,
|
||||
FID_ANIM_TYPE(v1->fid),
|
||||
(v1->fid & 0xF000) >> 12,
|
||||
(v1->fid & 0x70000000) >> 28);
|
||||
FID_ROTATION(v1->fid));
|
||||
|
||||
reg_anim_clear(v1);
|
||||
reg_anim_begin(ANIMATION_REQUEST_RESERVED);
|
||||
@@ -2632,6 +2633,7 @@ static void _combat_begin(Object* attacker)
|
||||
_process_bk();
|
||||
}
|
||||
}
|
||||
sfallOnCombatStart();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2788,7 +2790,7 @@ static void _combat_over()
|
||||
99,
|
||||
FID_ANIM_TYPE(critter->fid),
|
||||
(critter->fid & 0xF000) >> 12,
|
||||
(critter->fid & 0x70000000) >> 28);
|
||||
FID_ROTATION(critter->fid));
|
||||
reg_anim_clear(critter);
|
||||
reg_anim_begin(ANIMATION_REQUEST_RESERVED);
|
||||
animationRegisterAnimate(critter, ANIM_UP_STAIRS_RIGHT, -1);
|
||||
@@ -2841,6 +2843,8 @@ static void _combat_over()
|
||||
queueRemoveEventsByType(gDude, EVENT_TYPE_KNOCKOUT);
|
||||
knockoutEventProcess(gDude, nullptr);
|
||||
}
|
||||
|
||||
sfallOnCombatEnd();
|
||||
}
|
||||
|
||||
// 0x422194
|
||||
@@ -3490,7 +3494,7 @@ void attackInit(Attack* attack, Object* attacker, Object* defender, int hitMode,
|
||||
int _combat_attack(Object* attacker, Object* defender, int hitMode, int hitLocation)
|
||||
{
|
||||
if (attacker != gDude && hitMode == HIT_MODE_PUNCH && randomBetween(1, 4) == 1) {
|
||||
int fid = buildFid(OBJ_TYPE_CRITTER, attacker->fid & 0xFFF, ANIM_KICK_LEG, (attacker->fid & 0xF000) >> 12, (attacker->fid & 0x70000000) >> 28);
|
||||
int fid = buildFid(OBJ_TYPE_CRITTER, attacker->fid & 0xFFF, ANIM_KICK_LEG, (attacker->fid & 0xF000) >> 12, FID_ROTATION(attacker->fid));
|
||||
if (artExists(fid)) {
|
||||
hitMode = HIT_MODE_KICK;
|
||||
}
|
||||
|
||||
+19
-17
@@ -792,15 +792,15 @@ char* killTypeGetDescription(int killType)
|
||||
}
|
||||
}
|
||||
|
||||
// 0x42D9F4
|
||||
int _critter_heal_hours(Object* critter, int a2)
|
||||
// 0x42D9F4 _critter_heal_hours heals critters based on the number of elapsed hours
|
||||
int _critter_heal_hours(Object* critter, int hours)
|
||||
{
|
||||
if (PID_TYPE(critter->pid) != OBJ_TYPE_CRITTER) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (critter->data.critter.hp < critterGetStat(critter, STAT_MAXIMUM_HIT_POINTS)) {
|
||||
critterAdjustHitPoints(critter, 14 * (a2 / 3));
|
||||
critterAdjustHitPoints(critter, 14 * (hours / 3));
|
||||
}
|
||||
|
||||
critter->data.critter.combat.maneuver &= ~CRITTER_MANUEVER_FLEEING;
|
||||
@@ -815,7 +815,7 @@ static int _critterClearObjDrugs(Object* obj, void* data)
|
||||
}
|
||||
|
||||
// 0x42DA64
|
||||
void critterKill(Object* critter, int anim, bool a3)
|
||||
void critterKill(Object* critter, int anim, bool refreshRect)
|
||||
{
|
||||
if (PID_TYPE(critter->pid) != OBJ_TYPE_CRITTER) {
|
||||
return;
|
||||
@@ -904,7 +904,7 @@ void critterKill(Object* critter, int anim, bool a3)
|
||||
|
||||
itemDestroyAllHidden(critter);
|
||||
|
||||
if (a3) {
|
||||
if (refreshRect) {
|
||||
tileWindowRefreshRect(&updatedRect, elevation);
|
||||
}
|
||||
|
||||
@@ -1282,21 +1282,23 @@ int _critter_wake_clear(Object* obj, void* data)
|
||||
}
|
||||
|
||||
// 0x42E4C0
|
||||
int _critter_set_who_hit_me(Object* a1, Object* a2)
|
||||
// note: this is sometimes called with (attacker, defender) and sometimes with (defender, attacker).
|
||||
// `hitMe` may be nullptr
|
||||
int _critter_set_who_hit_me(Object* critter, Object* hitMe)
|
||||
{
|
||||
if (a1 == nullptr) {
|
||||
if (critter == nullptr) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (a2 != nullptr && FID_TYPE(a2->fid) != OBJ_TYPE_CRITTER) {
|
||||
if (hitMe != nullptr && FID_TYPE(hitMe->fid) != OBJ_TYPE_CRITTER) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (PID_TYPE(a1->pid) == OBJ_TYPE_CRITTER) {
|
||||
if (a2 == nullptr || a1->data.critter.combat.team != a2->data.critter.combat.team || (statRoll(a1, STAT_INTELLIGENCE, -1, nullptr) < 2 && (!objectIsPartyMember(a1) || !objectIsPartyMember(a2)))) {
|
||||
a1->data.critter.combat.whoHitMe = a2;
|
||||
if (a2 == gDude) {
|
||||
reactionSetValue(a1, -3);
|
||||
if (PID_TYPE(critter->pid) == OBJ_TYPE_CRITTER) {
|
||||
if (hitMe == nullptr || critter->data.critter.combat.team != hitMe->data.critter.combat.team || (statRoll(critter, STAT_INTELLIGENCE, -1, nullptr) < 2 && (!objectIsPartyMember(critter) || !objectIsPartyMember(hitMe)))) {
|
||||
critter->data.critter.combat.whoHitMe = hitMe;
|
||||
if (hitMe == gDude) {
|
||||
reactionSetValue(critter, -3);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1346,7 +1348,7 @@ bool _critter_can_obj_dude_rest()
|
||||
}
|
||||
|
||||
// 0x42E62C
|
||||
int critterGetMovementPointCostAdjustedForCrippledLegs(Object* critter, int actionPoints)
|
||||
int critterGetMovementPointCostAdjustedForCrippledLegs(Object* critter, int distance)
|
||||
{
|
||||
if (PID_TYPE(critter->pid) != OBJ_TYPE_CRITTER) {
|
||||
return 0;
|
||||
@@ -1354,11 +1356,11 @@ int critterGetMovementPointCostAdjustedForCrippledLegs(Object* critter, int acti
|
||||
|
||||
int flags = critter->data.critter.combat.results;
|
||||
if ((flags & DAM_CRIP_LEG_LEFT) != 0 && (flags & DAM_CRIP_LEG_RIGHT) != 0) {
|
||||
return 8 * actionPoints;
|
||||
return 8 * distance;
|
||||
} else if ((flags & DAM_CRIP_LEG_ANY) != 0) {
|
||||
return 4 * actionPoints;
|
||||
return 4 * distance;
|
||||
} else {
|
||||
return actionPoints;
|
||||
return distance;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -43,8 +43,8 @@ int killsSave(File* stream);
|
||||
int critterGetKillType(Object* critter);
|
||||
char* killTypeGetName(int killType);
|
||||
char* killTypeGetDescription(int killType);
|
||||
int _critter_heal_hours(Object* obj, int a2);
|
||||
void critterKill(Object* critter, int anim, bool a3);
|
||||
int _critter_heal_hours(Object* obj, int hours);
|
||||
void critterKill(Object* critter, int anim, bool refreshRect);
|
||||
int critterGetExp(Object* critter);
|
||||
bool critterIsActive(Object* critter);
|
||||
bool critterIsDead(Object* critter);
|
||||
@@ -64,11 +64,11 @@ int _critter_sneak_clear(Object* obj, void* data);
|
||||
bool dudeIsSneaking();
|
||||
int knockoutEventProcess(Object* obj, void* data);
|
||||
int _critter_wake_clear(Object* obj, void* data);
|
||||
int _critter_set_who_hit_me(Object* a1, Object* a2);
|
||||
int _critter_set_who_hit_me(Object* critter, Object* hitMe);
|
||||
bool _critter_can_obj_dude_rest();
|
||||
int critterGetMovementPointCostAdjustedForCrippledLegs(Object* critter, int a2);
|
||||
int critterGetMovementPointCostAdjustedForCrippledLegs(Object* critter, int distance);
|
||||
bool critterIsEncumbered(Object* critter);
|
||||
bool critterIsFleeing(Object* a1);
|
||||
bool critterIsFleeing(Object* critter);
|
||||
bool _critter_flag_check(int pid, int flag);
|
||||
void critter_flag_set(int pid, int flag);
|
||||
void critter_flag_unset(int pid, int flag);
|
||||
|
||||
@@ -621,12 +621,20 @@ int fileNameListInit(const char* pattern, char*** fileNameListPtr, int a3, int a
|
||||
int fileNamesLength = xlist->fileNamesLength;
|
||||
for (int index = 0; index < fileNamesLength - 1; index++) {
|
||||
if (compat_stricmp(xlist->fileNames[index], xlist->fileNames[index + 1]) == 0) {
|
||||
char* temp = xlist->fileNames[index + 1];
|
||||
memmove(&(xlist->fileNames[index + 1]), &(xlist->fileNames[index + 2]), sizeof(*xlist->fileNames) * (xlist->fileNamesLength - index - 1));
|
||||
// If the current item is equal to the next one, then remove it.
|
||||
// Example 1:
|
||||
// fileNamesLength = 6
|
||||
// 0 1 2 3 4 5
|
||||
// [a, b, c1, c2, d, e]
|
||||
// duplicate found at index=2
|
||||
// move items 3,4,5 to 2,3,4 and move duplicate to the end
|
||||
// [a, b, c2, d, e, c1]
|
||||
char* temp = xlist->fileNames[index];
|
||||
memmove(&(xlist->fileNames[index]), &(xlist->fileNames[index + 1]), sizeof(*xlist->fileNames) * (xlist->fileNamesLength - index - 1));
|
||||
xlist->fileNames[xlist->fileNamesLength - 1] = temp;
|
||||
|
||||
fileNamesLength--;
|
||||
index--;
|
||||
index--; // Repeat the same index if there are more duplicates.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user