aboutsummaryrefslogtreecommitdiff
path: root/src/entities.h
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-07-10 23:06:59 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-07-10 23:06:59 +0100
commit1ae6a63f79edd72aa39c7f7e2bca5182a68592b4 (patch)
tree5c928964bd367019bdbd76db27841211680f7f0d /src/entities.h
parentacb17f540cd8bc3a1e50ae4ab22b97620b55673b (diff)
downloadgold-mine-run-1ae6a63f79edd72aa39c7f7e2bca5182a68592b4.tar.gz
gold-mine-run-1ae6a63f79edd72aa39c7f7e2bca5182a68592b4.zip
Draw entities in order
This makes a difference on the less powerful machines and helps avoiding flickering.
Diffstat (limited to 'src/entities.h')
-rw-r--r--src/entities.h8
1 files changed, 8 insertions, 0 deletions
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();