Skip to content

Commit

Permalink
Merge branch 'master' into kids_books
Browse files Browse the repository at this point in the history
  • Loading branch information
DoctorBoomstick committed Feb 22, 2024
2 parents da9459b + c5cc8e5 commit 4d0c929
Show file tree
Hide file tree
Showing 180 changed files with 3,259 additions and 3,274 deletions.
1 change: 0 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ llvm-namespace-comment,\
misc-*,\
modernize-*,\
-modernize-use-auto,\
-modernize-use-emplace,\
-modernize-use-trailing-return-type,\
performance-*,\
-performance-avoid-endl,\
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/emscripten.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,14 @@ jobs:
build_catatclysm:
name: Build
runs-on: ubuntu-latest
env:
CCACHE: 1

steps:
- uses: actions/checkout@v4

- uses: mymindstorm/setup-emsdk@v14

- name: Prepare web data
run: ./build-scripts/prepare-web-data.sh

- name: Install ccache
run: |
emsdk install ccache-git-emscripten-64bit
Expand Down Expand Up @@ -77,6 +76,7 @@ jobs:
# The forked ccache seems to crash unless EM_CONFIG is defined, I'm not
# sure why this isn't figured out automatically.
export EM_CONFIG=$EMSDK/.emscripten
export CCACHE_COMPILERCHECK=string:3.1.51
ccache --zero-stats
ccache -M 5G
ccache --show-stats
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
echo "release_name=Cataclysm-DDA experimental build ${{ steps.get-timestamp.outputs.time }}" >> $GITHUB_OUTPUT
- uses: actions/checkout@v4
- run: |
gh release create ${{ steps.generate_env_vars.outputs.tag_name }} --generate-notes --prerelease --title "${{ steps.generate_env_vars.outputs.release_name }}"
gh release create ${{ steps.generate_env_vars.outputs.tag_name }} --generate-notes --prerelease --title "${{ steps.generate_env_vars.outputs.release_name }}" --target "$(git log -1 --format='%H')"
builds:
needs: release
Expand Down Expand Up @@ -266,7 +266,6 @@ jobs:
- name: Build CDDA (WebAssembly)
if: matrix.wasm
run: |
./build-scripts/prepare-web-data.sh
./build-scripts/build-emscripten.sh
./build-scripts/prepare-web.sh
(cd build && zip ../cdda-${{ matrix.artifact }}-${{ needs.release.outputs.timestamp }}.${{ matrix.ext }} *)
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ ifeq ($(NATIVE), emscripten)
endif

# Flags that are common across compile and link phases.
EMCC_COMMON_FLAGS = -sUSE_SDL=2 -sUSE_SDL_IMAGE=2 -sUSE_SDL_TTF=2 -sSDL2_IMAGE_FORMATS=['png']
EMCC_COMMON_FLAGS = -sUSE_SDL=2 -sUSE_SDL_IMAGE=2 -sUSE_SDL_TTF=2 -sSDL2_IMAGE_FORMATS=['png'] -fexceptions

ifneq ($(RELEASE), 1)
EMCC_COMMON_FLAGS += -g
Expand All @@ -650,7 +650,7 @@ ifeq ($(NATIVE), emscripten)
CXXFLAGS += $(EMCC_COMMON_FLAGS)
LDFLAGS += $(EMCC_COMMON_FLAGS)

LDFLAGS += --preload-file web_bundle@/
LDFLAGS += -sFORCE_FILESYSTEM
LDFLAGS += -sEXPORTED_RUNTIME_METHODS=['FS','stackTrace','jsStackTrace']
LDFLAGS += -sINITIAL_MEMORY=512MB
LDFLAGS += -sMAXIMUM_MEMORY=4GB
Expand Down
1 change: 1 addition & 0 deletions build-data/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@
e.preventDefault();
}
</script>
<script async type="text/javascript" src="cataclysm-tiles.data.js"></script>
<script async type="text/javascript" src="cataclysm-tiles.js"></script>
</body>
</html>
10 changes: 8 additions & 2 deletions build-scripts/build-emscripten.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#!/bin/bash
set -exo pipefail

CCACHE=${CCACHE:-0}

emsdk install 3.1.51
emsdk activate 3.1.51 ccache-git-emscripten-64bit
emsdk activate 3.1.51
if [ "$CCACHE" == "1" ]
then
emsdk activate ccache-git-emscripten-64bit
fi

make -j`nproc` NATIVE=emscripten BACKTRACE=0 TILES=1 TESTS=0 RUNTESTS=0 RELEASE=1 CCACHE=1 LINTJSON=0 cataclysm-tiles.js
make -j`nproc` NATIVE=emscripten BACKTRACE=0 TILES=1 TESTS=0 RUNTESTS=0 RELEASE=1 CCACHE="$CCACHE" LINTJSON=0 cataclysm-tiles.js
22 changes: 0 additions & 22 deletions build-scripts/prepare-web-data.sh

This file was deleted.

24 changes: 23 additions & 1 deletion build-scripts/prepare-web.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,32 @@
#!/bin/bash
set -exo pipefail

rm -rf web_bundle

BUNDLE_DIR=web_bundle
DATA_DIR=$BUNDLE_DIR/data
mkdir -p $DATA_DIR
cp -R data/{core,font,fontdata.json,json,mods,names,raw,motd,credits,title,help} $DATA_DIR/
cp -R gfx $BUNDLE_DIR/

# Remove .DS_Store files.
find web_bundle -name ".DS_Store" -type f -exec rm {} \;

# Remove obsolete mods.
echo "Removing obsolete mods..."
for MOD_DIR in $DATA_DIR/mods/*/ ; do
if jq -e '.[] | select(.type == "MOD_INFO") | .obsolete' "$MOD_DIR/modinfo.json" >/dev/null; then
echo "$MOD_DIR is obsolete, excluding from web_bundle..."
rm -rf $MOD_DIR
fi
done

$EMSDK/upstream/emscripten/tools/file_packager cataclysm-tiles.data --js-output=cataclysm-tiles.data.js --no-node --preload "$BUNDLE_DIR""@/"

mkdir -p build/
cp \
build-data/web/index.html \
cataclysm-tiles.{data,js,wasm} \
cataclysm-tiles.{data,data.js,js,wasm} \
data/font/Terminus.ttf \
build
cp data/cataicon.ico build/favicon.ico
2 changes: 1 addition & 1 deletion data/json/construction.json
Original file line number Diff line number Diff line change
Expand Up @@ -6861,7 +6861,7 @@
"pre_flags": [ "DIGGABLE", "FLAT" ],
"pre_special": "check_empty",
"post_terrain": "t_pit_shallow",
"byproducts": [ { "group": "digging_soil_loam_50L", "count": 5 } ],
"byproducts": [ { "group": "digging_soil_loam_50L", "count": 4 }, { "group": "digging_topsoil_loam_50L", "count": 1 } ],
"activity_level": "EXTRA_EXERCISE",
"do_turn_special": "do_turn_shovel"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@
"condition": { "math": [ "u_effect_intensity('ink_gland_ink')", ">", "1" ] },
"effect": [
{ "u_cast_spell": { "id": "ink_gland_spray" } },
{ "u_message": "Your ink glands spray some ink into attacker eyes!", "type": "good" },
{ "u_message": "Your ink glands spray some ink into your attacker's eyes!", "type": "good" },
{
"u_add_effect": "ink_gland_ink",
"duration": "PERMANENT",
Expand Down
Loading

0 comments on commit 4d0c929

Please sign in to comment.