From 1ae6a63f79edd72aa39c7f7e2bca5182a68592b4 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Mon, 10 Jul 2023 23:06:59 +0100 Subject: Draw entities in order This makes a difference on the less powerful machines and helps avoiding flickering. --- src/entities.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/entities.h') diff --git a/src/entities.h b/src/entities.h index 169e582..ca2bb1f 100644 --- a/src/entities.h +++ b/src/entities.h @@ -6,6 +6,11 @@ #define WALK_DELAY 8 +#define USED_FREE 0 +#define USED_BG 1 +#define USED_FG 2 +#define USED_PLAYER 3 + typedef struct entity_s { uint8_t used; @@ -30,6 +35,9 @@ void entities_init(); Entity *entities_new(); void entities_update(); +/* MUST be run before draw */ +void entities_sort(); +/* also erases/draws the player */ void entities_draw(); void entities_warp_out_all(); -- cgit v1.2.3