Skip to content

Commit

Permalink
feat: 1.4.3 Solve circular dependencies, refactor (#75)
Browse files Browse the repository at this point in the history
- Drop rooms.h circular dependency on helapordo.h
- Refactor:
  - Slim helapordo.h to the bare minimum
  - New files
  - New subdirectories
  - Improved Makefile.am configuration ambiguity (maybe)
- Bump amboso to 2.0.4
- Bump invil to 0.2.8
- Rough implementation of FLOORS_H declarations for raylib build
  • Loading branch information
jgabaut authored Feb 22, 2024
1 parent 6737595 commit 969447c
Show file tree
Hide file tree
Showing 65 changed files with 19,065 additions and 18,021 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Build-CI-make.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Run aclocal
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/make-anviltest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Run sudo apt update
run: sudo apt update -y
- name: Install astyle
run: sudo apt install astyle -y

- name: Run aclocal
run: aclocal
- name: Run autoconf
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/make-doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

name: Generate ./docs/docs.pdf
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 1

Expand All @@ -31,7 +31,7 @@ jobs:
- name: Install doxygen-latex
run: |
sudo apt install doxygen-latex -y
- name: Run aclocal
run: aclocal
- name: Run autoconf
Expand Down
19 changes: 16 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,23 @@ endif
# Compiler flags
AM_CFLAGS = $(HELAPORDO_CFLAGS) -Werror -Wpedantic -Wall -std=c11 -DHELAPORDO_BUILD_STR=\"$(HL_BUILD_STR)\"

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/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/anvil__helapordo.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
if HL_RAYLIB_BUILD
AM_CFLAGS += -DHELAPORDO_RAYLIB_BUILD
helapordo_SOURCES = src/helapordo_raylib.c src/game_core.c src/game_utils.c src/game_rl.c src/artifacts.c src/specials.c src/main.c src/sprites.c src/floors.c koliseo/src/koliseo.c sprites4curses/s4c-animate/animate.c src/anvil__helapordo.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/game_lore.c src/game_lore_alt.c src/palette.c
helapordo_SOURCES += src/build-rl/helapordo_raylib.c src/build-rl/game_rl.c
else
AM_CFLAGS += -DHELAPORDO_CURSES_BUILD
helapordo_SOURCES = src/helapordo.c src/game_core.c src/game_utils.c src/game_curses.c src/rooms.c src/artifacts.c src/specials.c src/main.c src/sprites.c src/floors.c sprites4curses/s4c-animate/animate.c koliseo/src/koliseo.c src/anvil__helapordo.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/game_lore.c src/game_lore_alt.c src/palette.c
helapordo_SOURCES += src/build-nc/game_curses.c
endif

if WINDOWS_BUILD
helapordo_SOURCES += src/floor_tester.c
if !HL_RAYLIB_BUILD
helapordo_SOURCES += src/build-nc-w64/helapordo_win.c src/build-nc-w64/floor_tester.c
endif
else
if HL_CURSES_BUILD
helapordo_SOURCES += src/build-nc/helapordo.c
endif
endif

./anvil:
Expand Down Expand Up @@ -191,6 +198,9 @@ clean:
-rm $(TARGET)
-rm sprites4curses/s4c-animate/*.o
-rm src/*.o
-rm src/build-*/*.o
-rm src/core/*.o
-rm src/utils/*.o
-rm src/animations/*.o
-rm src/palette.*
-rm koliseo/src/*.o
Expand All @@ -204,6 +214,9 @@ cleanob:
-rm sprites4curses/s4c-animate/*.o
-rm koliseo/src/*.o
-rm src/*.o
-rm src/build-*/*.o
-rm src/core/*.o
-rm src/utils/*.o
@echo -e "\033[1;33mDone.\e[0m"

# Default target (builds everything)
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
- `aarch64-apple-darwin`
- `Windows` (through `x86_64-w64-mingw32`)

**DISCLAIMER:** The `Windows` build is proof-of-concept as:
**DISCLAIMER:** The `Windows` ncurses build is proof-of-concept as:

- The gameplay loop is a simplified version of `Rogue` gamemode from the main build.
- Work in progress on running the original gameloop.
Expand All @@ -49,15 +49,15 @@

- Some source files are expected to be generated at build time, by a symlink executable named `anvil`. By default, the configuration will pick an implementation for `anvil` depending on passed host:
- `darwin*`: default is `repo_invil`. This means you need the Rust build toolchain to be installed.
- `linux*`, `mingw*`: default is `repo_amboso`. This means you need `bash >=4.x`, and your `awk` should not be `mawk`.
- `linux*`, `mingw*`: default is `repo_amboso`. This means you need `bash >=4.x`, and `gawk`.
- To readily override the default implementation for `anvil`, you can pass `--enable-anvilpick` to the `./configure` script:
`./configure --enable-anvilpick`
This will ensure you get an interactive prompt to pick an implementation (and can still use the default one by pressing Enter without typing anything), whenever `make` needs to create `./anvil`.

- Needed programs, depending on chosen `ANVIL_IMPL`:
- `awk` is needed by `amboso` to generate `./src/anvil__helapordo.h`.
- `gawk` is needed by `amboso` to generate `./src/anvil__helapordo.h`.
- `bash >=4` is needed to run `amboso`.
- Unfortunately, `mawk` is not compatible with `amboso`.
- Unfortunately, `nawk` and `mawk` are not compatible with `amboso`.
- If you dont' have those, you can use `invil` to generate `./src/anvil__helapordo.h`.
- You will need `cargo` to build `invil`.
- If you want to just build the code without `./src/anvil__helapordo.h`., you can apply the patch file provided at [this link](https://github.com/jgabaut/helapordo/issues/52#issuecomment-1871877437).
Expand Down Expand Up @@ -146,11 +146,11 @@

I try to upload precompiled binaries for the ncurses build:

- `x86_64-Linux` : [download latest](https://github.com/jgabaut/helapordo/releases/download/1.4.2/helapordo-nc-1.4.2-Linux-x86_64.zip)
- `x86_64-Linux` : [download latest](https://github.com/jgabaut/helapordo/releases/download/1.4.3/helapordo-nc-1.4.3-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.2/helapordo.exe-nc-1.4.2-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.3/helapordo.exe-nc-1.4.3-w64-mingw32-x86_64.zip)

- `darwin-arm64` : [download latest](https://github.com/jgabaut/helapordo/releases/download/1.4.1/helapordo-nc-1.4.1-darwin-arm64.zip) (Available = `1.4.1`. Latest = `1.4.2`)
- `darwin-arm64` : [download latest](https://github.com/jgabaut/helapordo/releases/download/1.4.2/helapordo-nc-1.4.2-darwin-arm64.zip) (Available = `1.4.2`. Latest = `1.4.3`)

📦 v1.4.2 09/02/2024
📦 v1.4.3 22/02/2024
https://github.com/jgabaut/helapordo/releases
2 changes: 1 addition & 1 deletion amboso
Submodule amboso updated 67 files
+1 −1 .github/workflows/anviltest-base-init-mode.yml
+1 −1 .github/workflows/anviltest-base-purge-mode.yml
+1 −1 .github/workflows/anviltest-git-init-mode.yml
+1 −1 .github/workflows/anviltest-git-purge-mode.yml
+1 −1 .github/workflows/anviltest-test-macro.yml
+1 −1 .github/workflows/codeql.yml
+1 −1 .github/workflows/run-make-check.yml
+1 −1 .github/workflows/try_anvil-auto.yml
+2 −0 .gitignore
+2 −2 Makefile
+70 −53 README.md
+28 −24 amboso
+191 −240 amboso_fn.sh
+0 −1 bin/stego.lock
+0 −7 bin/v0.1.0/hello_world.c
+0 −11 bin/v0.9.0/Makefile
+0 −7 bin/v0.9.0/hello_world.c
+0 −3 bin/v1.0.0/.gitignore
+0 −3 bin/v1.1.0/.gitignore
+0 −3 bin/v1.1.2/.gitignore
+0 −3 bin/v1.2.0/.gitignore
+0 −3 bin/v1.3.0/.gitignore
+0 −3 bin/v1.3.1/.gitignore
+0 −3 bin/v1.3.2/.gitignore
+0 −3 bin/v1.4.8-b/.gitignore
+0 −3 bin/v1.4.9/.gitignore
+0 −3 bin/v1.5.2/.gitignore
+0 −3 bin/v1.6.10/.gitignore
+0 −3 bin/v1.6.11/.gitignore
+0 −3 bin/v1.6.12/.gitignore
+0 −3 bin/v1.6.2/.gitignore
+0 −3 bin/v1.6.3/.gitignore
+0 −3 bin/v1.6.4/.gitignore
+0 −3 bin/v1.6.5/.gitignore
+0 −3 bin/v1.6.6/.gitignore
+0 −3 bin/v1.6.8/.gitignore
+0 −3 bin/v1.6.9/.gitignore
+0 −3 bin/v1.7.0/.gitignore
+0 −3 bin/v1.7.2/.gitignore
+0 −3 bin/v1.7.3/.gitignore
+0 −3 bin/v1.7.4/.gitignore
+0 −3 bin/v1.9.0/.gitignore
+0 −3 bin/v1.9.1/.gitignore
+0 −3 bin/v1.9.2/.gitignore
+0 −3 bin/v1.9.3/.gitignore
+0 −3 bin/v1.9.4/.gitignore
+0 −3 bin/v1.9.5/.gitignore
+0 −3 bin/v1.9.6/.gitignore
+0 −3 bin/v1.9.7/.gitignore
+0 −3 bin/v1.9.8/.gitignore
+0 −3 bin/v1.9.9/.gitignore
+0 −3 bin/v2.0.0/.gitignore
+0 −3 bin/v2.0.1/.gitignore
+0 −3 bin/v2.0.2/.gitignore
+0 −3 bin/v2.0.3/.gitignore
+1 −1 kazoj/bone/lint_anvil_stego.k
+1 −1 kazoj/bone/lint_anvil_stego.k.stdout
+1 −1 kazoj/bone/std_amboso_kern.k
+1 −0 kazoj/bone/std_amboso_kern.k.stderr
+1 −7 kazoj/bone/std_amboso_kern.k.stdout
+1 −1 kazoj/bone/std_amboso_set.k.stdout
+28 −23 kazoj/bone/try_amboso_sourcing.k
+1 −1 kazoj/bone/try_amboso_sourcing.k.stderr
+2 −1 stego.lock
+1 −1 utils/amboso_call
+0 −0 utils/try-anvil/try_anvil
+0 −0 utils/try-anvil/try_anvil_auto
5 changes: 5 additions & 0 deletions bin/v1.4.3/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#amboso compliant version folder, will ignore everything inside BUT the gitignore, to keep the clean dir
#we also keep specific dependencies...
*
!.gitignore
!static
1 change: 1 addition & 0 deletions bin/v1.4.3/static
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.2], [[email protected]])
AC_INIT([helapordo], [1.4.3], [[email protected]])

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

# Output variables to the config.h header
Expand Down
13 changes: 9 additions & 4 deletions 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.2"
PROJECT_NUMBER = "1.4.3"

# 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 Expand Up @@ -935,7 +935,12 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.

INPUT = "./src"
INPUT = "./src" \
"./src/core" \
"./src/utils" \
"./src/build-nc" \
"./src/build-rl" \
"./src/build-nc-w64"

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
Expand Down Expand Up @@ -1671,7 +1676,7 @@ DISABLE_INDEX = NO
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.

GENERATE_TREEVIEW = NO
GENERATE_TREEVIEW = YES

# When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the
# FULL_SIDEBAR option determines if the side bar is limited to only the treeview
Expand Down Expand Up @@ -2439,7 +2444,7 @@ HIDE_UNDOC_RELATIONS = YES
# set to NO
# The default value is: NO.

HAVE_DOT = NO
HAVE_DOT = yes

# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
# to run in parallel. When set to 0 doxygen will base this on the number of
Expand Down
7 changes: 6 additions & 1 deletion format
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ else
exit 1
fi
SRC_DIR="src"
SRC_CORE_DIR="src/core"
SRC_UTILS_DIR="src/utils"
SRC_BUILD_NC_DIR="src/build-nc"
SRC_BUILD_NC_W64_DIR="src/build-nc-w64"
SRC_BUILD_RL_DIR="src/build-rl"

hlpd_SOURCES=("$SRC_DIR"/*.c "$SRC_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 )
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
4 changes: 2 additions & 2 deletions kazoj/bone/const.c
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#include <stdio.h>
#include <string.h>
#define HELAPORDO_CURSES_BUILD
#include "../../src/game_core.h"
#include "../../src/core/game_core.h"

void fail(char* msg, int ex, int val) {
printf("[Fail] %s, expected (%i), was %i\n",msg,ex,val);
}

int main(void) {
int check = -1;
if ( ! (( check = strcmp(VERSION, "1.4.2") ) == 0)) {
if ( ! (( check = strcmp(VERSION, "1.4.3") ) == 0)) {
fail("VERSION",0,check);
};
if ( ! (HLP_MAX_INDEX == 31) ) {
Expand Down
4 changes: 2 additions & 2 deletions kazoj/bone/const_rl.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <stdio.h>
#include <string.h>
#define HELAPORDO_RAYLIB_BUILD
#include "../../src/game_core.h"
#include "../../src/core/game_core.h"
#include <raylib.h>

void fail(char* msg, int ex, int val) {
Expand All @@ -10,7 +10,7 @@ void fail(char* msg, int ex, int val) {

int main(void) {
int check = -1;
if ( ! (( check = strcmp(VERSION, "1.4.2") ) == 0)) {
if ( ! (( check = strcmp(VERSION, "1.4.3") ) == 0)) {
fail("VERSION",0,check);
};
if ( ! (HLP_MAX_INDEX == 31) ) {
Expand Down
Empty file added kazoj/bone/const_rl.k.stderr
Empty file.
Empty file added kazoj/bone/const_rl.k.stdout
Empty file.
1 change: 0 additions & 1 deletion src/floor_tester.c → src/build-nc-w64/floor_tester.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "floor_tester.h"
#include "floors.h"

#ifdef HELAPORDO_CURSES_BUILD
int test_floors(void)
Expand Down
1 change: 1 addition & 0 deletions src/floor_tester.h → src/build-nc-w64/floor_tester.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#ifndef FLOOR_TEST_H
#define FLOOR_TEST_H
#include "../utils/floors.h"

int test_floors(void);

Expand Down
Loading

0 comments on commit 969447c

Please sign in to comment.