From 49379fe29f1e4a1ed19ada85db4c37909a611142 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Tue, 4 Jul 2023 23:19:21 +0100 Subject: Warp all the entities out Used by the stage clear code. --- src/entities.c | 12 +++++++++++- src/entities.h | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/entities.c b/src/entities.c index be976ea..df8fb4e 100644 --- a/src/entities.c +++ b/src/entities.c @@ -4,9 +4,10 @@ #include "vga.h" #include "map.h" #include "data.h" - #include "entities.h" +#include "effect.h" + #define MAX_ENTITY 32 static Entity entities[MAX_ENTITY]; @@ -70,3 +71,12 @@ void entities_draw() blitrc(binary_sprites_start, &e->frames[e->dir * 4 + e->frame], &dst); } } + +void entities_warp_out_all() +{ + Entity *e = entities; + + for (uint8_t i = 0; i < last; i++, e++) + if (e->used) + effect_out_init(e); +} diff --git a/src/entities.h b/src/entities.h index d7a6a83..99424de 100644 --- a/src/entities.h +++ b/src/entities.h @@ -32,4 +32,6 @@ void entities_update(); void entities_erase(); void entities_draw(); +void entities_warp_out_all(); + #endif /* _ENTITIES_H */ -- cgit v1.2.3