Skip to content

Commit

Permalink
1.4.10 - Fix raylib mockup, bump savefile version (#100)
Browse files Browse the repository at this point in the history
## Changed
- The raylib build gets to see more of the lower APIs thanks to new
notifications interface
- Drop s4c-gui inclusion for raylib build
- Trim gameloop_rl(), use hlpd_getopts() and hlpd_reset_logfile()
- Use texture rendering to scale the whole texture
- Changed some error messages for save loading

## Fixed
- Add release_data.o to make clean
- Refactor hlpd_default_keybinds and other places needed to build with
raylib

## Notes
- Add sizeof(SerGamestate), sizeof(SerSaveHeader) to const.c,
const_rl.c anvil tests
- Use int64_t for start_time in SerGamestate, instead of
platform-specific-width clock_t
- Use int32_t for a couple of SerChest values
- Bump HELAPORDO_BINSAVEFILE_VERSION to 0.0.5
  • Loading branch information
jgabaut committed Jun 14, 2024
1 parent 6ce2f7f commit 5d7bbb7
Show file tree
Hide file tree
Showing 25 changed files with 921 additions and 1,109 deletions.
14 changes: 10 additions & 4 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@ else
helapordo_SOURCES =
endif

helapordo_SOURCES += src/core/game_core.c src/utils/game_utils.c src/core/game_animations.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 s4c-gui/src/s4c_gui.c src/release_data/release_data.c
helapordo_SOURCES += src/core/game_core.c src/utils/game_utils.c src/core/game_animations.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 src/release_data/release_data.c


if HL_RAYLIB_BUILD
AM_CFLAGS += -DHELAPORDO_RAYLIB_BUILD
helapordo_SOURCES += src/build-rl/helapordo_raylib.c src/build-rl/game_rl.c s4c-gui/src/s4c_gui.c
helapordo_SOURCES += src/build-rl/helapordo_raylib.c src/build-rl/game_rl.c
else
AM_CFLAGS += -DHELAPORDO_CURSES_BUILD
helapordo_SOURCES += src/build-nc/game_curses.c
helapordo_SOURCES += src/build-nc/game_curses.c s4c-gui/src/s4c_gui.c
endif

if WINDOWS_BUILD
Expand All @@ -85,10 +87,12 @@ else
hlpd_save2l_SOURCES =
endif

hlpd_save2l_SOURCES += src/core/game_core.c src/core/sprites.c src/utils/game_utils.c scripts/save2l/save2l.c src/ser/ser_core.c koliseo/src/koliseo.c s4c-gui/src/s4c_gui.c sprites4curses/s4c-animate/animate.c src/palette.c
hlpd_save2l_SOURCES += src/core/game_core.c src/core/sprites.c src/utils/game_utils.c scripts/save2l/save2l.c src/ser/ser_core.c koliseo/src/koliseo.c sprites4curses/s4c-animate/animate.c src/palette.c

if HL_RAYLIB_BUILD
hlpd_save2l_SOURCES += src/build-rl/game_rl.c
else
hlpd_save2l_SOURCES += s4c-gui/src/s4c_gui.c
endif

./anvil:
Expand Down Expand Up @@ -301,6 +305,7 @@ clean:
-rm src/palette.*
-rm src/ser/*.o
-rm src/bsp/*.o
-rm src/release_data/*.o
-rm koliseo/src/*.o
-rm ./*.o
-rm src/anvil__helapordo.*
Expand All @@ -320,6 +325,7 @@ cleanob:
-rm src/utils/*.o
-rm src/ser/*.o
-rm src/bsp/*.o
-rm src/release_data/*.o
-rm ./scripts/save2l/*.o
@echo -e "\033[1;33mDone.\e[0m"

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@

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

I try to upload precompiled binaries for the ncurses build:
📦 v1.4.10 14/06/2024
I try to upload precompiled binaries for the `ncurses` build:

- `x86_64-Linux` : [download latest](https://github.com/jgabaut/helapordo/releases/download/1.4.9/helapordo-nc-1.4.9-Linux-x86_64.zip)
- `x86_64-Linux` : [download latest](https://github.com/jgabaut/helapordo/releases/download/1.4.10/helapordo-nc-1.4.10-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.8/helapordo.exe-nc-1.4.8-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.8/helapordo.exe-nc-1.4.8-w64-mingw32-x86_64.zip) (Available = `1.4.8`)

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

📦 v1.4.9 02/06/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.9], [jgabaut@github.com])
AC_INIT([helapordo], [1.4.10], [jgabaut@github.com])

# Verify automake version and enable foreign option
AM_INIT_AUTOMAKE([foreign -Wall])
Expand Down Expand Up @@ -193,7 +193,7 @@ AM_CONDITIONAL([USE_DEFAULT_BACKGROUND], [test "$enable_default_background" = "y
# Set a default version number if not specified externally
AC_ARG_VAR([VERSION], [Version number])
if test -z "$VERSION"; then
VERSION="1.4.9"
VERSION="1.4.10"
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.9
PROJECT_NUMBER = 1.4.10

# 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
8 changes: 7 additions & 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.9") ) == 0)) {
if ( ! (( check = strcmp(VERSION, "1.4.10") ) == 0)) {
fail("VERSION",0,check);
};
if ( ! (HLP_MAX_INDEX == 35) ) {
Expand Down Expand Up @@ -112,6 +112,12 @@ int main(void) {
if ( ! SAVEHEADER_BUFSIZE == 15 ) {
fail("SAVEHEADER_BUFSIZE", 15, SAVEHEADER_BUFSIZE);
};
if ( ! (sizeof(SerGamestate) == 7828) ) {
fail("sizeof(SerGamestate", 7828, sizeof(SerGamestate));
};
if ( ! (sizeof(SerSaveHeader) == 68) ) {
fail("sizeof(SerSaveHeader", 68, sizeof(SerSaveHeader));
};
if ( ! (EQUIPPERKSMAX == 2) ) {
fail("EQUIPPERKSMAX",2,EQUIPPERKSMAX);
};
Expand Down
9 changes: 8 additions & 1 deletion kazoj/bone/const_rl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <string.h>
#define HELAPORDO_RAYLIB_BUILD
#include "../../src/core/game_core.h"
#include "../../src/ser/ser_core.h"
#include <raylib.h>

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

int main(void) {
int check = -1;
if ( ! (( check = strcmp(VERSION, "1.4.9") ) == 0)) {
if ( ! (( check = strcmp(VERSION, "1.4.10") ) == 0)) {
fail("VERSION",0,check);
};
if ( ! (HLP_MAX_INDEX == 35) ) {
Expand Down Expand Up @@ -97,6 +98,12 @@ int main(void) {
if ( ! (PERKSMAX == 8) ) {
fail("PERKSMAX",8,PERKSMAX);
};
if ( ! (sizeof(SerGamestate) == 7828) ) {
fail("sizeof(SerGamestate", 7828, sizeof(SerGamestate));
};
if ( ! (sizeof(SerSaveHeader) == 68) ) {
fail("sizeof(SerSaveHeader", 68, sizeof(SerSaveHeader));
};
if ( ! (EQUIPPERKSMAX == 2) ) {
fail("EQUIPPERKSMAX",2,EQUIPPERKSMAX);
};
Expand Down
3 changes: 3 additions & 0 deletions src/bsp/bsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,8 @@ void dbg_BSP_Room(BSP_Room* bsp_room)
}
}

#ifdef HELAPORDO_CURSES_BUILD

static void draw_vertical_wall(WINDOW* win, BSP_Wall* w, int start_y, int start_x)
{
for (int y = w->start_y; y <= w->end_y; y++) {
Expand Down Expand Up @@ -473,3 +475,4 @@ void draw_BSP_Tree(WINDOW* win, BSP_Room* node, int depth, int x, int y, int hz_

wrefresh(win);
}
#endif // HELAPORDO_CURSES_BUILD
3 changes: 3 additions & 0 deletions src/bsp/bsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ typedef struct BSP_Room {
BSP_Room* floor_bsp_gen(Floor* floor, Koliseo_Temp* t_kls, int base_x, int base_y);

void dbg_BSP_Room(BSP_Room* bsp_room);

#ifdef HELAPORDO_CURSES_BUILD
void draw_BSP_Room(WINDOW* win, BSP_Room* bsp_room, int start_y, int start_x, int depth);
void draw_BSP_Tree(WINDOW* win, BSP_Room* node, int depth, int x, int y, int hz_spacing, int vrt_spacing);
#endif // HELAPORDO_CURSES_BUILD

#endif
6 changes: 1 addition & 5 deletions src/build-nc-w64/helapordo_win.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void gameloop_Win(int argc, char **argv)

gen_random_seed(seed);

while ((option = getopt(argc, argv, "r:E:tTGRXQLlvdhsaV")) != -1) {
while ((option = getopt(argc, argv, "r:E:tTGRXQLvdhaV")) != -1) {
switch (option) {
case 'd': {
#ifndef HELAPORDO_DEBUG_ACCESS
Expand Down Expand Up @@ -131,10 +131,6 @@ void gameloop_Win(int argc, char **argv)
GS_AUTOSAVE_ON = 0;
}
break;
case 's': {
GAMEMODE = Story;
}
break;
case 'R': {
GAMEMODE = Rogue;
}
Expand Down
4 changes: 0 additions & 4 deletions src/build-rl/game_rl.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@
#include "../core/sprites.h"
#include "../core/game_animations.h"

#define EXPECTED_RAYLIB_VERSION_MAJOR 4 /**< Defines min expected major ncurses version.*/
#define EXPECTED_RAYLIB_VERSION_MINOR 5 /**< Defines min expected minor ncurses version.*/
#define EXPECTED_RAYLIB_VERSION_PATCH 0 /**< Defines min expected patch ncurses version.*/

void handleTutorial(S4C_Color* palette);
void setEnemySprite(Enemy * e);
void setEquipSprite(Equip * e);
Expand Down
Loading

0 comments on commit 5d7bbb7

Please sign in to comment.