From 66e1d8ff03e2df73d9690f5702633cb6934a3052 Mon Sep 17 00:00:00 2001 From: quou Date: Sat, 5 Oct 2024 12:22:00 +1000 Subject: give the game a name --- .gitignore | 2 +- 1bitjam.c | 45 --------------------------------------------- Makefile | 4 ++-- config.h | 2 +- hftrss.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 49 insertions(+), 49 deletions(-) delete mode 100644 1bitjam.c create mode 100644 hftrss.c diff --git a/.gitignore b/.gitignore index 40ef3ee..c366547 100644 --- a/.gitignore +++ b/.gitignore @@ -7,5 +7,5 @@ pack.h /convimg /convanim /packassets -/1bitjam +/hftrss /distrib diff --git a/1bitjam.c b/1bitjam.c deleted file mode 100644 index 1b903c1..0000000 --- a/1bitjam.c +++ /dev/null @@ -1,45 +0,0 @@ -#include "asset.h" -#include "config.h" -#include "game.h" -#include "maths.h" -#include "memory.h" -#include "plat.h" -#include "render.h" - -int entrypoint(int argc, const char** argv, Arena* m) { - Heap h; - App* a; - FPS f; - Renderer r; - Game* game; - (void)argc; - (void)argv; - init_maths(); - init_heap( - &h, - arena_alloc(m, app_memory_size), - app_memory_size - ); - a = new_app(&h, game_name); - init_audio(); - init_fps(&f, default_mpf); - game = arena_alloc(m, sizeof *game); - init_game(game, game_state_menu); - while (a->o) { - fps_begin(&f); - while (f.now >= f.next && a->o) { - app_begin(a); - update_game(game, a); - ren_begin(&r, a->fb, viewport_w, viewport_h); - ren_clear(&r); - ren_game(game, &r); - ren_end(&r); - app_end(a); - fps_update(&f); - } - fps_end(&f); - } - deinit_audio(); - deinit_app(a); - return error_none; -} diff --git a/Makefile b/Makefile index b7582d1..61b0cf4 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ includes = -I./ cflags = $(includes) $(conf_cflags) \ -Wall -Wextra -pedantic -std=c90 lflags = $(libs) $(conf_lflags) -target = 1bitjam +target = hftrss int_dir = intermediate data_dir = data convimg = convimg @@ -43,13 +43,13 @@ ifeq ($(config), release_gnu64) endif sources = \ - 1bitjam.c \ animation.c \ asset.c \ deathzone.c \ effect.c \ enemy.c \ game.c \ + hftrss.c \ hud.c \ map.c \ maths.c \ diff --git a/config.h b/config.h index 6a69ee7..906f097 100644 --- a/config.h +++ b/config.h @@ -3,7 +3,7 @@ #include "maths.h" -#define game_name "1bit Game Jam" +#define game_name "hftrss" #define memory_size (1024 * 32) #define app_memory_size (1024 * 16) diff --git a/hftrss.c b/hftrss.c new file mode 100644 index 0000000..1b903c1 --- /dev/null +++ b/hftrss.c @@ -0,0 +1,45 @@ +#include "asset.h" +#include "config.h" +#include "game.h" +#include "maths.h" +#include "memory.h" +#include "plat.h" +#include "render.h" + +int entrypoint(int argc, const char** argv, Arena* m) { + Heap h; + App* a; + FPS f; + Renderer r; + Game* game; + (void)argc; + (void)argv; + init_maths(); + init_heap( + &h, + arena_alloc(m, app_memory_size), + app_memory_size + ); + a = new_app(&h, game_name); + init_audio(); + init_fps(&f, default_mpf); + game = arena_alloc(m, sizeof *game); + init_game(game, game_state_menu); + while (a->o) { + fps_begin(&f); + while (f.now >= f.next && a->o) { + app_begin(a); + update_game(game, a); + ren_begin(&r, a->fb, viewport_w, viewport_h); + ren_clear(&r); + ren_game(game, &r); + ren_end(&r); + app_end(a); + fps_update(&f); + } + fps_end(&f); + } + deinit_audio(); + deinit_app(a); + return error_none; +} -- cgit v1.2.3-54-g00ecf