Skip to content

Commit

Permalink
feat: 1.4.6 Handle SIGINT, add bsp floor layout gen (#84)
Browse files Browse the repository at this point in the history
## Added
- Add `SIGINT` handler
  - Try to free the arenas when `Ctrl+C` is received
- Add bsp implementation, based on
[mtsdurica](https://github.com/mtsdurica/bsp-dungeon-generator)'s
rendition of [the popular
algorithm](https://en.wikipedia.org/wiki/Binary_space_partitioning)
- With the author's permission, the code is relicensed under
`GPL-3.0-only`, to have only one license for all the game sources.
  - Thanks to Matúš for its availability and politeness

## Changed
- Add `from_bsp` field to `Floor`
- Enlarge `seed` field in `Path` by 1
- Update experimental binary savefile version to `0.0.3`
  - Improves #80
- Chore: recompute floor area in `floor_set_room_types()` with
`G_EXPERIMENTAL_ON == 1`
- Floors generated with bsp will have a random position for `HOME` room
- Use `enemy_area_ratio` to loop in enemy room placement for new floors
  - Floors generated with bsp will have relatively less enemies

## Fixes
- Fix: drop repetitive done_loading log message
- Fix: avoid leaving the terminal messed up on binary savefile load
errors
- Fix: free arenas in `initRoom()` for invalid classes BASIC, WALL
- Fix: removed some UB

## Notes
- Chore: use `-X` in `raylib` build to toggle floor layout render
- Chore: fix wrong doxygen comments for `Path` and `SerPath`
  - Closes #83 
- Bump `koliseo` to `0.4.3`
- Bump `s4c-scripts` to `0.1.1`
- Bump `invil` to `0.2.13`
  • Loading branch information
jgabaut authored Apr 29, 2024
1 parent 2ea157a commit cef8d44
Show file tree
Hide file tree
Showing 26 changed files with 787 additions and 76 deletions.
4 changes: 3 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ else
helapordo_SOURCES =
endif

helapordo_SOURCES += src/core/game_core.c src/utils/game_utils.c src/utils/game_init.c src/utils/game_fight.c src/utils/game_debug.c src/core/equips.c src/ser/ser_core.c src/utils/saves.c src/utils/turn_op.c src/utils/rooms.c src/utils/artifacts.c src/utils/specials.c src/main.c src/core/sprites.c src/utils/floors.c koliseo/src/koliseo.c sprites4curses/s4c-animate/animate.c src/animations/mummy_shuffle.c src/animations/ghost_spell.c src/animations/boar_scream.c src/animations/troll_club.c src/animations/goblin_shoot.c src/animations/zombie_walk.c src/animations/imp_fireball.c src/animations/werewolf_transform.c src/animations/knight_tapis.c src/animations/mage_spark.c src/animations/archer_drop.c src/animations/assassin_poof.c src/animations/crawlingdude_crawl.c src/animations/srwarthog_square.c src/animations/headlessninja_throw.c src/animations/bluetroll_wonder.c src/animations/enter_door.c src/animations/alt_chest_opening.c src/core/game_lore.c src/core/game_lore_alt.c src/palette.c
helapordo_SOURCES += src/core/game_core.c src/utils/game_utils.c src/utils/game_init.c src/utils/game_fight.c src/utils/game_debug.c src/core/equips.c src/ser/ser_core.c src/utils/saves.c src/utils/turn_op.c src/utils/rooms.c src/utils/artifacts.c src/utils/specials.c src/main.c src/core/sprites.c src/utils/floors.c koliseo/src/koliseo.c sprites4curses/s4c-animate/animate.c src/animations/mummy_shuffle.c src/animations/ghost_spell.c src/animations/boar_scream.c src/animations/troll_club.c src/animations/goblin_shoot.c src/animations/zombie_walk.c src/animations/imp_fireball.c src/animations/werewolf_transform.c src/animations/knight_tapis.c src/animations/mage_spark.c src/animations/archer_drop.c src/animations/assassin_poof.c src/animations/crawlingdude_crawl.c src/animations/srwarthog_square.c src/animations/headlessninja_throw.c src/animations/bluetroll_wonder.c src/animations/enter_door.c src/animations/alt_chest_opening.c src/core/game_lore.c src/core/game_lore_alt.c src/palette.c src/bsp/bsp.c
if HL_RAYLIB_BUILD
AM_CFLAGS += -DHELAPORDO_RAYLIB_BUILD
helapordo_SOURCES += src/build-rl/helapordo_raylib.c src/build-rl/game_rl.c
Expand Down Expand Up @@ -232,6 +232,7 @@ clean:
-rm src/animations/*.o
-rm src/palette.*
-rm src/ser/*.o
-rm src/bsp/*.o
-rm koliseo/src/*.o
-rm ./*.o
-rm src/anvil__helapordo.*
Expand All @@ -249,6 +250,7 @@ cleanob:
-rm src/core/*.o
-rm src/utils/*.o
-rm src/ser/*.o
-rm src/bsp/*.o
-rm ./scripts/save2l/*.o
@echo -e "\033[1;33mDone.\e[0m"

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@

I try to upload precompiled binaries for the ncurses build:

- `x86_64-Linux` : [download latest](https://github.com/jgabaut/helapordo/releases/download/1.4.5/helapordo-nc-1.4.5-Linux-x86_64.zip)
- `x86_64-Linux` : [download latest](https://github.com/jgabaut/helapordo/releases/download/1.4.6/helapordo-nc-1.4.6-Linux-x86_64.zip)
- `aarch64-Linux` (from [Termux](https://f-droid.org/packages/com.termux/) on Android).
- `x86_64-w64-mingw32` (*JUST A DEMO.* Any help with debugging the full game is welcome.) : [download latest](https://github.com/jgabaut/helapordo/releases/download/1.4.5/helapordo.exe-nc-1.4.5-w64-mingw32-x86_64.zip)
- `x86_64-w64-mingw32` (*JUST A DEMO.* Any help with debugging the full game is welcome.) : [download latest](https://github.com/jgabaut/helapordo/releases/download/1.4.6/helapordo.exe-nc-1.4.6-w64-mingw32-x86_64.zip)

- `darwin-arm64` : [download latest](https://github.com/jgabaut/helapordo/releases/download/1.4.3/helapordo-nc-1.4.3-darwin-arm64.zip) (Available = `1.4.3`. Latest = `1.4.5`)
- `darwin-arm64` : [download latest](https://github.com/jgabaut/helapordo/releases/download/1.4.5/helapordo-nc-1.4.5-darwin-arm64.zip) (Available = `1.4.5`. Latest = `1.4.6`)
- You should always check if the releases page has a newer build for you than the one linked here.

📦 v1.4.5 19/04/2024
📦 v1.4.6 29/04/2024
https://github.com/jgabaut/helapordo/releases

## Building <a name = "building"></a>
Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Define the package name and version
AC_INIT([helapordo], [1.4.5], [[email protected]])
AC_INIT([helapordo], [1.4.6], [[email protected]])

# Verify automake version and enable foreign option
AM_INIT_AUTOMAKE([foreign -Wall])
Expand Down Expand Up @@ -187,7 +187,7 @@ AM_CONDITIONAL([USE_EMOJI_BUILD], [test "$enable_emoji" = "yes"])
# Set a default version number if not specified externally
AC_ARG_VAR([VERSION], [Version number])
if test -z "$VERSION"; then
VERSION="1.4.5"
VERSION="1.4.6"
fi

# Output variables to the config.h header
Expand Down
2 changes: 1 addition & 1 deletion docs/helapordo.doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ PROJECT_NAME = helapordo
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 1.4.5
PROJECT_NUMBER = 1.4.6

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
3 changes: 2 additions & 1 deletion format
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ SRC_BUILD_NC_DIR="src/build-nc"
SRC_BUILD_NC_W64_DIR="src/build-nc-w64"
SRC_BUILD_RL_DIR="src/build-rl"
SRC_SER_DIR="src/ser"
SRC_BSP_DIR="src/bsp"

hlpd_SOURCES=("$SRC_DIR"/*.c "$SRC_DIR"/*.h "$SRC_CORE_DIR"/*.c "$SRC_CORE_DIR"/*.h "$SRC_UTILS_DIR"/*.c "$SRC_UTILS_DIR"/*.h "$SRC_BUILD_NC_DIR"/*.c "$SRC_BUILD_NC_DIR"/*.h "$SRC_BUILD_NC_W64_DIR"/*.c "$SRC_BUILD_NC_W64_DIR"/*.h "$SRC_BUILD_RL_DIR"/*.c "$SRC_BUILD_RL_DIR"/*.h "$SRC_SER_DIR"/*.c "$SRC_SER_DIR"/*.h )
hlpd_SOURCES=("$SRC_DIR"/*.c "$SRC_DIR"/*.h "$SRC_CORE_DIR"/*.c "$SRC_CORE_DIR"/*.h "$SRC_UTILS_DIR"/*.c "$SRC_UTILS_DIR"/*.h "$SRC_BUILD_NC_DIR"/*.c "$SRC_BUILD_NC_DIR"/*.h "$SRC_BUILD_NC_W64_DIR"/*.c "$SRC_BUILD_NC_W64_DIR"/*.h "$SRC_BUILD_RL_DIR"/*.c "$SRC_BUILD_RL_DIR"/*.h "$SRC_SER_DIR"/*.c "$SRC_SER_DIR"/*.h "$SRC_BSP_DIR"/*.c "$SRC_BSP_DIR"*/.h )
CONFIG_FILE=".astylerc"

printf "Running \033[1;34mastyle -s4 --style=linux\e[0m for all source files.\n"
Expand Down
2 changes: 1 addition & 1 deletion invil
Submodule invil updated 4 files
+6 −0 CHANGELOG.md
+1 −1 Cargo.lock
+1 −1 Cargo.toml
+23 −9 src/ops.rs
2 changes: 1 addition & 1 deletion kazoj/bone/const.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ void fail(char* msg, int ex, int val) {

int main(void) {
int check = -1;
if ( ! (( check = strcmp(VERSION, "1.4.5") ) == 0)) {
if ( ! (( check = strcmp(VERSION, "1.4.6") ) == 0)) {
fail("VERSION",0,check);
};
if ( ! (HLP_MAX_INDEX == 31) ) {
Expand Down
2 changes: 1 addition & 1 deletion kazoj/bone/const_rl.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ void fail(char* msg, int ex, int val) {

int main(void) {
int check = -1;
if ( ! (( check = strcmp(VERSION, "1.4.5") ) == 0)) {
if ( ! (( check = strcmp(VERSION, "1.4.6") ) == 0)) {
fail("VERSION",0,check);
};
if ( ! (HLP_MAX_INDEX == 31) ) {
Expand Down
2 changes: 1 addition & 1 deletion koliseo
2 changes: 1 addition & 1 deletion s4c-scripts
Loading

0 comments on commit cef8d44

Please sign in to comment.