Skip to content

Commit 46c2f46

Browse files
authored
Merge branch 'main' into feature/code-readibility-3
2 parents 323cc61 + 04b8c84 commit 46c2f46

32 files changed

Lines changed: 767 additions & 133 deletions

.github/workflows/ci-build.yml

Lines changed: 88 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
uses: actions/cache@v4
6464
with:
6565
path: os/android/app/.cxx
66-
key: android-cmake-v1
66+
key: android-cmake-v2
6767

6868
- name: Setup signing config
6969
if: env.KEYSTORE_FILE_BASE64 != '' && env.KEYSTORE_PROPERTIES_FILE_BASE64 != ''
@@ -79,18 +79,22 @@ jobs:
7979
run: |
8080
cd os/android
8181
./gradlew assembleDebug
82-
82+
83+
- name: Prepare artifacts
84+
run: |
85+
mkdir artifacts/
86+
cp os/android/app/build/outputs/apk/debug/app-debug.apk artifacts/fallout2-ce-debug.apk
87+
8388
- name: Upload
8489
uses: actions/upload-artifact@v4
8590
with:
86-
name: fallout2-ce-debug.apk
87-
path: os/android/app/build/outputs/apk/debug/app-debug.apk
91+
name: artifact-fallout2-ce-debug.apk
92+
path: artifacts/*
8893
retention-days: 7
8994

9095
ios:
9196
name: iOS
92-
93-
runs-on: macos-12
97+
runs-on: macos-14
9498

9599
steps:
96100
- name: Clone
@@ -100,7 +104,7 @@ jobs:
100104
uses: actions/cache@v4
101105
with:
102106
path: build
103-
key: ios-cmake-v2
107+
key: ios-cmake-v4
104108

105109
- name: Configure
106110
run: |
@@ -123,14 +127,17 @@ jobs:
123127
124128
- name: Pack
125129
run: |
130+
mkdir artifacts/
126131
cd build
127132
cpack -C RelWithDebInfo
128-
133+
cd ../
134+
cp build/fallout2-ce.ipa artifacts/fallout2-ce.ipa
135+
129136
- name: Upload
130137
uses: actions/upload-artifact@v4
131138
with:
132-
name: fallout2-ce.ipa
133-
path: build/fallout2-ce.ipa
139+
name: artifact-fallout2-ce.ipa
140+
path: artifacts/*
134141
retention-days: 7
135142

136143
linux:
@@ -167,7 +174,7 @@ jobs:
167174
uses: actions/cache@v4
168175
with:
169176
path: build
170-
key: linux-${{ matrix.arch }}-cmake-v1
177+
key: linux-${{ matrix.arch }}-cmake-v3
171178

172179
- name: Configure (x86)
173180
if: matrix.arch == 'x86'
@@ -192,18 +199,22 @@ jobs:
192199
--build build \
193200
-j $(nproc) \
194201
# EOL
195-
202+
203+
- name: Prepare artifacts
204+
run: |
205+
mkdir artifacts/
206+
cp build/fallout2-ce artifacts/fallout2-ce-linux-${{ matrix.arch }}
207+
196208
- name: Upload
197209
uses: actions/upload-artifact@v4
198210
with:
199-
name: fallout2-ce-linux-${{ matrix.arch }}
200-
path: build/fallout2-ce
211+
name: artifact-fallout2-ce-linux-${{ matrix.arch }}
212+
path: artifacts/*
201213
retention-days: 7
202214

203215
macos:
204216
name: macOS
205-
206-
runs-on: macos-11
217+
runs-on: macos-14
207218

208219
steps:
209220
- name: Clone
@@ -213,7 +224,7 @@ jobs:
213224
uses: actions/cache@v4
214225
with:
215226
path: build
216-
key: macos-cmake-v4
227+
key: macos-cmake-v6
217228

218229
- name: Configure
219230
run: |
@@ -233,14 +244,17 @@ jobs:
233244
234245
- name: Pack
235246
run: |
247+
mkdir artifacts/
236248
cd build
237249
cpack -C RelWithDebInfo
238-
250+
cd ../
251+
cp "build/Fallout II Community Edition.dmg" "artifacts/Fallout II Community Edition.dmg"
252+
239253
- name: Upload
240254
uses: actions/upload-artifact@v4
241255
with:
242-
name: fallout2-ce-macos.dmg
243-
path: build/Fallout II Community Edition.dmg
256+
name: artifact-fallout2-ce-macos.dmg
257+
path: artifacts/*
244258
retention-days: 7
245259

246260
windows:
@@ -265,7 +279,7 @@ jobs:
265279
uses: actions/cache@v4
266280
with:
267281
path: build
268-
key: windows-${{ matrix.arch }}-cmake-v1
282+
key: windows-${{ matrix.arch }}-cmake-v2
269283

270284
- name: Configure
271285
run: |
@@ -281,10 +295,60 @@ jobs:
281295
--build build \
282296
--config RelWithDebInfo \
283297
# EOL
284-
298+
299+
- name: Prepare artifacts
300+
run: |
301+
mkdir artifacts/
302+
cp build/RelWithDebInfo/fallout2-ce.exe artifacts/fallout2-ce-windows-${{ matrix.arch }}.exe
303+
285304
- name: Upload
286305
uses: actions/upload-artifact@v4
287306
with:
288-
name: fallout2-ce-windows-${{ matrix.arch }}
289-
path: build/RelWithDebInfo/fallout2-ce.exe
307+
name: artifact-fallout2-ce-windows-${{ matrix.arch }}
308+
path: artifacts/*
290309
retention-days: 7
310+
311+
release:
312+
name: Release Continuous build
313+
runs-on: ubuntu-latest
314+
needs: [android, ios, linux, macos, windows]
315+
permissions: write-all
316+
steps:
317+
- name: Fetch artifacts
318+
if: ${{ always() && github.ref == 'refs/heads/main' && github.event_name == 'push' }}
319+
uses: actions/download-artifact@v4.1.7
320+
with:
321+
path: artifacts/
322+
323+
- name: Remove old release
324+
if: ${{ always() && github.ref == 'refs/heads/main' && github.event_name == 'push' }}
325+
uses: dev-drprasad/delete-tag-and-release@v0.2.1
326+
with:
327+
delete_release: true
328+
tag_name: continious
329+
env:
330+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
331+
332+
- name: Repackage binaries and allow GitHub to process removed release for few seconds
333+
if: ${{ always() && github.ref == 'refs/heads/main' && github.event_name == 'push' }}
334+
continue-on-error: true
335+
run: |
336+
cd artifacts/
337+
for i in artifact-*; do
338+
mv "$i"/* .
339+
rm -rf "$i"
340+
done
341+
ls -R .
342+
cd ../
343+
sleep 20s
344+
345+
- name: Upload new release
346+
if: ${{ always() && github.ref == 'refs/heads/main' && github.event_name == 'push' }}
347+
uses: softprops/action-gh-release@v0.1.15
348+
with:
349+
token: ${{ secrets.GITHUB_TOKEN }}
350+
files: artifacts/*
351+
tag_name: continious
352+
draft: false
353+
prerelease: true
354+
name: Fallout2-CE Continuous Build

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
ios:
6060
name: iOS
6161

62-
runs-on: macos-12
62+
runs-on: macos-14
6363

6464
steps:
6565
- name: Clone

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,3 +391,6 @@ FodyWeavers.xsd
391391
# CMake
392392
/out
393393
/build
394+
395+
# versioning header
396+
src/platform/git_version.h

CMakeLists.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ set(EXECUTABLE_NAME fallout2-ce)
66

77
if(APPLE)
88
if(IOS)
9-
set(CMAKE_OSX_DEPLOYMENT_TARGET "11" CACHE STRING "")
9+
set(CMAKE_OSX_DEPLOYMENT_TARGET "12" CACHE STRING "")
1010
set(CMAKE_OSX_ARCHITECTURES "arm64" CACHE STRING "")
1111
else()
12-
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11" CACHE STRING "")
12+
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "")
1313
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "")
1414
endif()
1515
endif()
@@ -26,6 +26,9 @@ else()
2626
add_executable(${EXECUTABLE_NAME} WIN32 MACOSX_BUNDLE)
2727
endif()
2828

29+
# Git Info
30+
include("cmake/gitver.cmake")
31+
2932
target_sources(${EXECUTABLE_NAME} PUBLIC
3033
"src/actions.cc"
3134
"src/actions.h"
@@ -225,6 +228,8 @@ target_sources(${EXECUTABLE_NAME} PUBLIC
225228
"src/text_object.h"
226229
"src/tile.cc"
227230
"src/tile.h"
231+
"src/tile_hires_stencil.cc"
232+
"src/tile_hires_stencil.h"
228233
"src/trait_defs.h"
229234
"src/trait.cc"
230235
"src/trait.h"
@@ -361,8 +366,7 @@ if(APPLE)
361366
endif()
362367

363368
add_subdirectory("third_party/fpattern")
364-
target_link_libraries(${EXECUTABLE_NAME} ${FPATTERN_LIBRARY})
365-
target_include_directories(${EXECUTABLE_NAME} PRIVATE ${FPATTERN_INCLUDE_DIR})
369+
target_link_libraries(${EXECUTABLE_NAME} fpattern::fpattern)
366370

367371
if((NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux") AND (NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") AND (NOT ${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD"))
368372
add_subdirectory("third_party/zlib")

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ There is also [Fallout Community Edition](https://github.com/alexbatalov/fallout
88

99
## Installation
1010

11-
You must own the game to play. Purchase your copy on [GOG](https://www.gog.com/game/fallout_2) or [Steam](https://store.steampowered.com/app/38410). Download latest [release](https://github.com/alexbatalov/fallout2-ce/releases) or build from source. You can also check latest [debug](https://github.com/alexbatalov/fallout2-ce/actions) build intended for testers.
11+
You must own the game to play. Purchase your copy on [GOG](https://www.gog.com/game/fallout_2), [Epic Games](https://store.epicgames.com/p/fallout-2) or [Steam](https://store.steampowered.com/app/38410). Download latest [release](https://github.com/alexbatalov/fallout2-ce/releases) or build from source. You can also check latest [debug](https://github.com/alexbatalov/fallout2-ce/actions) build intended for testers.
1212

1313
### Windows
1414

cmake/gitver.cmake

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Get author name
2+
execute_process(
3+
COMMAND git log -1 --pretty=format:%an
4+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
5+
OUTPUT_VARIABLE AUTHOR
6+
OUTPUT_STRIP_TRAILING_WHITESPACE
7+
)
8+
9+
# Get current branch
10+
execute_process(
11+
COMMAND git branch --show-current
12+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
13+
OUTPUT_VARIABLE BRANCH
14+
OUTPUT_STRIP_TRAILING_WHITESPACE
15+
)
16+
17+
# Get hash of the latest commit
18+
execute_process(
19+
COMMAND git log --pretty=format:%h -n 1
20+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
21+
OUTPUT_VARIABLE HASH
22+
OUTPUT_STRIP_TRAILING_WHITESPACE
23+
)
24+
25+
# Get last tag
26+
execute_process(
27+
COMMAND git describe --tags --abbrev=0
28+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
29+
OUTPUT_VARIABLE LATEST_TAG
30+
OUTPUT_STRIP_TRAILING_WHITESPACE
31+
)
32+
33+
# Get date of the latest commit
34+
execute_process(
35+
COMMAND git log -1 --date=format:"%b %d %Y %H:%M:%S" --pretty=format:%cd
36+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
37+
OUTPUT_VARIABLE DATE
38+
OUTPUT_STRIP_TRAILING_WHITESPACE
39+
)
40+
41+
# Define a variable for CI_BUILD
42+
set(CI_BUILD 0)
43+
44+
# Create git_version.h file
45+
configure_file(
46+
${CMAKE_CURRENT_SOURCE_DIR}/src/platform/git_version.h.in
47+
${CMAKE_CURRENT_SOURCE_DIR}/src/platform/git_version.h
48+
)

src/animation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ typedef enum AnimationType {
9292
LAST_SF_DEATH_ANIM = ANIM_FALL_FRONT_BLOOD_SF,
9393
} AnimationType;
9494

95-
#define FID_ANIM_TYPE(value) ((value)&0xFF0000) >> 16
95+
#define FID_ANIM_TYPE(value) ((value) & 0xFF0000) >> 16
9696

9797
// Signature of animation callback accepting 2 parameters.
9898
typedef int(AnimationCallback)(void* a1, void* a2);

src/art.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ int artCopyFileName(int objectType, int id, char* dest)
525525
{
526526
ArtListDescription* ptr;
527527

528-
if (objectType < OBJ_TYPE_ITEM && objectType >= OBJ_TYPE_COUNT) {
528+
if (objectType < OBJ_TYPE_ITEM || objectType >= OBJ_TYPE_COUNT) {
529529
return -1;
530530
}
531531

@@ -633,11 +633,11 @@ char* artBuildFilePath(int fid)
633633
v5 = (v2 & 0xF000) >> 12;
634634
type = FID_TYPE(v2);
635635

636-
if (v3 >= gArtListDescriptions[type].fileNamesLength) {
636+
if (type < OBJ_TYPE_ITEM || type >= OBJ_TYPE_COUNT) {
637637
return nullptr;
638638
}
639639

640-
if (type < OBJ_TYPE_ITEM || type >= OBJ_TYPE_COUNT) {
640+
if (v3 >= gArtListDescriptions[type].fileNamesLength) {
641641
return nullptr;
642642
}
643643

0 commit comments

Comments
 (0)