aboutsummaryrefslogtreecommitdiff
path: root/1bitjam.c
diff options
context:
space:
mode:
Diffstat (limited to '1bitjam.c')
-rw-r--r--1bitjam.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/1bitjam.c b/1bitjam.c
index 547eee7..1b903c1 100644
--- a/1bitjam.c
+++ b/1bitjam.c
@@ -1,18 +1,17 @@
#include "asset.h"
#include "config.h"
+#include "game.h"
#include "maths.h"
#include "memory.h"
#include "plat.h"
-#include "rect.h"
#include "render.h"
-#include "world.h"
int entrypoint(int argc, const char** argv, Arena* m) {
Heap h;
App* a;
FPS f;
Renderer r;
- World* world;
+ Game* game;
(void)argc;
(void)argv;
init_maths();
@@ -24,19 +23,16 @@ int entrypoint(int argc, const char** argv, Arena* m) {
a = new_app(&h, game_name);
init_audio();
init_fps(&f, default_mpf);
- world = arena_alloc(m, sizeof world);
- init_world(world);
- generate_floor(&world->map, world);
+ 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_world(world, a);
-
+ update_game(game, a);
ren_begin(&r, a->fb, viewport_w, viewport_h);
ren_clear(&r);
- ren_world(world, &r);
+ ren_game(game, &r);
ren_end(&r);
app_end(a);
fps_update(&f);