Skip to content

Commit

Permalink
feat: 1.4.0 Add WIP raylib build (#65)
Browse files Browse the repository at this point in the history
- Add --enable-raylib config option
- Add --enable-anvilpick config option
  - Set repo_invil default for darwin
- Use repo_invil default when using interactive selection for anvil
- Add -V to print build info
- Add WIP raylib build
- Add helapordo_build_string
- Update PACK_NAME to
$(TARGET)-$(HL_BUILD_STR)-$(VERSION)-$(OS)-$(MACHINE)
- Add clock_t start_time to Gamestate
  - Add timer under G_EXPERIMENTAL_ON for Enemy, Boss rooms
- Print build in title screen
- Add mandatory define for build (mutually exclusive,
HELAPORDO_CURSES_BUILD or HELAPORDO_RAYLIB_BUILD)
- Add hlpd_dbg_features()
- Bump s4c to 0.4.2
- Bump amboso to 2.0.1

---------

Signed-off-by: jgabaut <[email protected]>
  • Loading branch information
jgabaut authored Jan 5, 2024
1 parent c8941a9 commit 3798ec8
Show file tree
Hide file tree
Showing 34 changed files with 2,295 additions and 448 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,6 @@ static/animations/*.txt

# ignore anvil symlink
anvil

# ignore anvil.log
anvil.log
20 changes: 16 additions & 4 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ SHELL := /bin/bash
.ONESHELL:
# Check system info
MACHINE := $$(uname -m)
PACK_NAME = $(TARGET)-$(VERSION)-$(OS)-$(MACHINE)
PACK_NAME = $(TARGET)-$(HL_BUILD_STR)-$(VERSION)-$(OS)-$(MACHINE)
PALETTE_PATH = "./static/palette.gpl"

# Source files
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

# Linking rule
LDADD = $(HELAPORDO_LDFLAGS)
Expand All @@ -38,7 +37,15 @@ KLS_LDFLAGS = -O2
endif

# Compiler flags
AM_CFLAGS = $(HELAPORDO_CFLAGS) -Werror -Wpedantic -Wall -std=c11
AM_CFLAGS = $(HELAPORDO_CFLAGS) -Werror -Wpedantic -Wall -std=c11 -DHELAPORDO_BUILD_STR=\"$(HL_BUILD_STR)\"

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
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
endif

if WINDOWS_BUILD
helapordo_SOURCES += src/floor_tester.c
Expand Down Expand Up @@ -99,7 +106,12 @@ const.k:
$(CCOMP) kazoj/bone/const.c -o kazoj/bone/const.k
@echo -e "\n\033[1;32mDone.\e[0m"

anviltest: const.k
const_rl.k:
@echo -en "Building const_rl.k test"
$(CCOMP) kazoj/bone/const_rl.c -o kazoj/bone/const_rl.k -lraylib -DS4C_RAYLIB_EXTENSION
@echo -e "\n\033[1;32mDone.\e[0m"

anviltest: const.k const_rl.k
@echo -en "Running anvil tests.\n"
./anvil -tX
@echo -e "\n\033[1;32mDone.\e[0m"
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Here's a gif of a new game being started.

![Gif of game screen](https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExNHF0Y2ZkdnYzY3Y3MmxhYzQ2Y25tenA0ajgzMmRscTRobDU5YzcyZiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/OxQAY7H9UwiXBUMt4h/giphy.gif)
![Gif of game screen](https://media2.giphy.com/media/v1.Y2lkPTc5MGI3NjExZjgycTdlazZzbHJ4MnljZm1jOW9rOGY0Y3NydXlreWl4YTNlc212NSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/DG0aoSpfx92NYjNOKO/source.gif)


## Table of Contents <a name = "index"></a>
Expand Down Expand Up @@ -144,15 +144,15 @@

## Latest Release <a name = "latest_release"></a>

I try to upload precompiled binaries for:
I try to upload precompiled binaries for the ncurses build:

- `x86_64-Linux` : [download latest](https://github.com/jgabaut/helapordo/releases/download/1.3.6/helapordo-1.3.6-Linux-x86_64.zip)
- `x86_64-Linux` : [download latest](https://github.com/jgabaut/helapordo/releases/download/1.4.0/helapordo-nc-1.4.0-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.3.6/helapordo.exe-1.3.6-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.0/helapordo.exe-nc-1.4.0-w64-mingw32-x86_64.zip)

Some releases may offer a precompiled binary for:

- `darwin-arm64` : [download latest](https://github.com/jgabaut/helapordo/releases/download/1.3.5/helapordo-1.3.5-darwin-arm64.zip) (Available = `1.3.5`. Latest = `1.3.6`)
- `darwin-arm64` : [download latest](https://github.com/jgabaut/helapordo/releases/download/1.3.5/helapordo-1.3.5-darwin-arm64.zip) (Available = `1.3.5`. Latest = `1.4.0`)

📦 v1.3.6 03/01/2023
📦 v1.4.0 05/01/2023
https://github.com/jgabaut/helapordo/releases
2 changes: 1 addition & 1 deletion amboso
1 change: 1 addition & 0 deletions bin/stego.lock
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ errortestsdir = "kulpo"
"1.3.4" = "Bump invil to 0.1.6, amboso to 1.9.9, koliseo to 0.3.18"
"1.3.5" = "Improve configure.ac, bump amboso to 2.0.0, invil to 0.2.1, koliseo to 0.3.20"
"1.3.6" = "Fix invil version time, bump s4c to 0.4.0, add --enable-anvilpick, repo_invil by default on macOS"
"1.4.0" = "Add WIP raylib integration, bump s4c to 0.4.2"
5 changes: 5 additions & 0 deletions bin/v1.4.0/.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.0/static
145 changes: 111 additions & 34 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.3.6], [[email protected]])
AC_INIT([helapordo], [1.4.0], [[email protected]])

# Verify automake version and enable foreign option
AM_INIT_AUTOMAKE([foreign -Wall])
Expand All @@ -11,6 +11,9 @@ build_windows=no
build_mac=no
build_anvilpick=no

build_curses=yes
build_raylib=no

# Check for the --enable-debug option
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug], [Enable debug build])],
Expand All @@ -26,64 +29,138 @@ AC_ARG_ENABLE([anvilpick],
[enable_anvilpick=$enableval],
[enable_anvilpick=no])

AC_ARG_ENABLE([raylib],
[AS_HELP_STRING([--enable-raylib], [Enable raylib build])],
[enable_raylib=$enableval],
[enable_raylib=no])

# Define the include and library paths based on the host system
case "${host_os}" in
mingw*)
# mingw32 specific flags
echo "Building for mingw32: [$host_cpu-$host_vendor-$host_os]"
build_windows=yes
# mingw32 specific flags
AC_SUBST([HELAPORDO_CFLAGS], ["-I/usr/x86_64-w64-mingw32/include -fstack-protector -DWINDOWS_BUILD -DKOLISEO_HAS_CURSES -DNCURSES_STATIC"])
AC_SUBST([HELAPORDO_LDFLAGS], ["-L/usr/x86_64-w64-mingw32/lib -lpanelw -lmenuw -lncursesw -static"])
AC_SUBST([CCOMP], ["/usr/bin/x86_64-w64-mingw32-gcc"])
AC_SUBST([OS], ["w64-mingw32"])
AC_SUBST([TARGET], ["helapordo.exe"])
if test "$enable_anvilpick" = "yes"; then
echo "Building with anvil interactive selection"
build_anvilpick=yes
AC_SUBST([ANVIL_IMPL], ["-i repo_amboso"])
if test "$enable_raylib" = "yes"; then
echo "Building with raylib"
build_raylib=yes
AC_SUBST([HELAPORDO_CFLAGS], ["-I/usr/x86_64-w64-mingw32/include -fstack-protector -DWINDOWS_BUILD -DS4C_RAYLIB_EXTENSION"])
AC_SUBST([HELAPORDO_LDFLAGS], ["-L/usr/x86_64-w64-mingw32/lib -lraylib -lm -lgdi32 -lwinmm -static"])
AC_SUBST([CCOMP], ["/usr/bin/x86_64-w64-mingw32-gcc"])
AC_SUBST([OS], ["w64-mingw32"])
AC_SUBST([TARGET], ["helapordo.exe"])
if test "$enable_anvilpick" = "yes"; then
echo "Building with anvil interactive selection"
build_anvilpick=yes
AC_SUBST([ANVIL_IMPL], ["-i repo_invil"])
else
AC_SUBST([ANVIL_IMPL], ["repo_amboso"])
fi
AC_SUBST([HL_BUILD_STR], ["rl"])
else
AC_SUBST([ANVIL_IMPL], ["repo_amboso"])
echo "Building with ncurses"
#build_raylib=no
#build_curses=yes
AC_SUBST([HELAPORDO_CFLAGS], ["-I/usr/x86_64-w64-mingw32/include -fstack-protector -DWINDOWS_BUILD -DKOLISEO_HAS_CURSES -DNCURSES_STATIC"])
AC_SUBST([HELAPORDO_LDFLAGS], ["-L/usr/x86_64-w64-mingw32/lib -lpanelw -lmenuw -lncursesw -static"])
AC_SUBST([CCOMP], ["/usr/bin/x86_64-w64-mingw32-gcc"])
AC_SUBST([OS], ["w64-mingw32"])
AC_SUBST([TARGET], ["helapordo.exe"])
if test "$enable_anvilpick" = "yes"; then
echo "Building with anvil interactive selection"
build_anvilpick=yes
AC_SUBST([ANVIL_IMPL], ["-i repo_invil"])
else
AC_SUBST([ANVIL_IMPL], ["repo_amboso"])
fi
AC_SUBST([HL_BUILD_STR], ["nc"])
fi
;;
darwin*)
# macOS specific flags
echo "Building for macos: [$host_cpu-$host_vendor-$host_os]"
build_mac=yes
# macOS specific flags
AC_SUBST([HELAPORDO_CFLAGS], ["-I/opt/homebrew/opt/ncurses/include -DKOLISEO_HAS_CURSES"])
AC_SUBST([HELAPORDO_LDFLAGS], ["-L/opt/homebrew/opt/ncurses/lib -lmenu -lpanel -lncurses"])
AC_SUBST([OS], ["darwin"])
AC_SUBST([TARGET], ["helapordo"])
if test "$enable_anvilpick" = "yes"; then
echo "Building with anvil interactive selection"
build_anvilpick=yes
AC_SUBST([ANVIL_IMPL], ["-i repo_invil"])
if test "$enable_raylib" = "yes"; then
echo "Building with raylib"
build_raylib=yes
build_curses=no
AC_SUBST([HELAPORDO_CFLAGS], ["-I/opt/homebrew/opt/raylib/include -DS4C_RAYLIB_EXTENSION"])
AC_SUBST([HELAPORDO_LDFLAGS], ["-L/opt/homebrew/opt/raylib/lib -lraylib"])
AC_SUBST([OS], ["darwin"])
AC_SUBST([TARGET], ["helapordo"])
if test "$enable_anvilpick" = "yes"; then
echo "Building with anvil interactive selection"
build_anvilpick=yes
AC_SUBST([ANVIL_IMPL], ["-i repo_invil"])
else
AC_SUBST([ANVIL_IMPL], ["repo_invil"])
fi
AC_SUBST([HL_BUILD_STR], ["rl"])
else
AC_SUBST([ANVIL_IMPL], ["repo_invil"])
echo "Building with ncurses"
#build_raylib=no
#build_curses=yes
AC_SUBST([HELAPORDO_CFLAGS], ["-I/opt/homebrew/opt/ncurses/include -DKOLISEO_HAS_CURSES"])
AC_SUBST([HELAPORDO_LDFLAGS], ["-L/opt/homebrew/opt/ncurses/lib -lmenu -lpanel -lncurses"])
AC_SUBST([OS], ["darwin"])
AC_SUBST([TARGET], ["helapordo"])
if test "$enable_anvilpick" = "yes"; then
echo "Building with anvil interactive selection"
build_anvilpick=yes
AC_SUBST([ANVIL_IMPL], ["-i repo_invil"])
else
AC_SUBST([ANVIL_IMPL], ["repo_invil"])
fi
AC_SUBST([HL_BUILD_STR], ["nc"])
fi
;;
linux*)
# Linux specific flags
echo "Building for Linux: [$host_cpu-$host_vendor-$host_os]"
build_linux=yes
# Linux specific flags
AC_SUBST([HELAPORDO_CFLAGS], ["-DKOLISEO_HAS_CURSES"])
AC_SUBST([HELAPORDO_LDFLAGS], ["-lmenu -lpanel -lncurses"])
AC_SUBST([OS], ["Linux"])
AC_SUBST([CCOMP], ["gcc"]) #Yes
AC_SUBST([TARGET], ["helapordo"])
if test "$enable_anvilpick" = "yes"; then
echo "Building with anvil interactive selection"
build_anvilpick=yes
AC_SUBST([ANVIL_IMPL], ["-i repo_amboso"])
if test "$enable_raylib" = "yes"; then
echo "Building with raylib"
build_raylib=yes
build_curses=no
AC_SUBST([HELAPORDO_CFLAGS], ["-DS4C_RAYLIB_EXTENSION"])
AC_SUBST([HELAPORDO_LDFLAGS], ["-lraylib"])
AC_SUBST([OS], ["Linux"])
AC_SUBST([CCOMP], ["gcc"]) #Yes
AC_SUBST([TARGET], ["helapordo"])
if test "$enable_anvilpick" = "yes"; then
echo "Building with anvil interactive selection"
build_anvilpick=yes
AC_SUBST([ANVIL_IMPL], ["-i repo_invil"])
else
AC_SUBST([ANVIL_IMPL], ["repo_amboso"])
fi
AC_SUBST([HL_BUILD_STR], ["rl"])

else
AC_SUBST([ANVIL_IMPL], ["repo_amboso"])
echo "Building with ncurses"
#build_raylib=no
#build_curses=yes
AC_SUBST([HELAPORDO_CFLAGS], ["-DKOLISEO_HAS_CURSES"])
AC_SUBST([HELAPORDO_LDFLAGS], ["-lmenu -lpanel -lncurses"])
AC_SUBST([OS], ["Linux"])
AC_SUBST([CCOMP], ["gcc"]) #Yes
AC_SUBST([TARGET], ["helapordo"])
if test "$enable_anvilpick" = "yes"; then
echo "Building with anvil interactive selection"
build_anvilpick=yes
AC_SUBST([ANVIL_IMPL], ["-i repo_invil"])
else
AC_SUBST([ANVIL_IMPL], ["repo_amboso"])
fi
AC_SUBST([HL_BUILD_STR], ["nc"])
fi
;;
*)
AC_MSG_ERROR(["OS $host_os is not supported"])
;;
esac

AM_CONDITIONAL([HL_RAYLIB_BUILD], [test "$build_raylib" = "yes"])
AM_CONDITIONAL([HL_CURSES_BUILD], [test "$build_curses" = "yes"])
AM_CONDITIONAL([ANVILPICK_BUILD], [test "$build_anvilpick" = "yes"])
AM_CONDITIONAL([WINDOWS_BUILD], [test "$build_windows" = "yes"])
AM_CONDITIONAL([DARWIN_BUILD], [test "$build_mac" = "yes"])
Expand All @@ -92,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.3.6"
VERSION="1.4.0"
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.3.6"
PROJECT_NUMBER = "1.4.0"

# 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
2 changes: 1 addition & 1 deletion invil
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion kazoj/bone/const.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <stdio.h>
#include <string.h>
#define HELAPORDO_CURSES_BUILD
#include "../../src/game_core.h"

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

int main(void) {
int check = -1;
if ( ! (( check = strcmp(VERSION, "1.3.6") ) == 0)) {
if ( ! (( check = strcmp(VERSION, "1.4.0-dev") ) == 0)) {
fail("VERSION",0,check);
};
if ( ! (HLP_MAX_INDEX == 30) ) {
Expand Down
Loading

0 comments on commit 3798ec8

Please sign in to comment.