aboutsummaryrefslogtreecommitdiff
path: root/src/pickup.c
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/pickup.c
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/pickup.c')
-rw-r--r--src/pickup.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pickup.c b/src/pickup.c
index 7036891..afc5ef2 100644
--- a/src/pickup.c
+++ b/src/pickup.c
@@ -109,6 +109,7 @@ static const Rect *frames_bonuses[] =
void pickup_time_init(Entity *e)
{
+ e->used = USED_BG;
e->frames = (const Rect *)frames_in;
e->flags = PICKUP_TIME;
e->counter = MAX_TTL * 2 + (rand() % MAX_TTL);
@@ -117,6 +118,7 @@ void pickup_time_init(Entity *e)
void pickup_bonus_init(Entity *e)
{
+ e->used = USED_BG;
e->frames = (const Rect *)frames_in;
e->flags = PICKUP_BONUS;
e->counter = MAX_TTL + (rand() % MAX_TTL);
@@ -125,6 +127,7 @@ void pickup_bonus_init(Entity *e)
void pickup_pickaxe_init(Entity *e)
{
+ e->used = USED_BG;
e->frames = (const Rect *)frames_in;
e->flags = PICKUP_PICKAXE;
e->counter = MAX_TTL / 2 + (rand() % MAX_TTL);
@@ -207,7 +210,7 @@ void pickup_update(Entity *e)
add_pickaxe();
break;
}
- e->used = 0;
+ e->used = USED_FREE;
sound_play_efx(EFX_PICKUP);
}
}