From b4f904ecdcf6b0857d28ab4a877ad0f3468153f7 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Sat, 27 Jan 2024 13:54:57 +0100 Subject: Remove hp --- src/building/inc/building.h | 1 - src/building/src/building.c | 14 +------------- 2 files changed, 1 insertion(+), 14 deletions(-) (limited to 'src/building') diff --git a/src/building/inc/building.h b/src/building/inc/building.h index a0ab539..7c7d45f 100644 --- a/src/building/inc/building.h +++ b/src/building/inc/building.h @@ -31,7 +31,6 @@ struct building_cfg void building_create(const struct building_cfg *cfg, struct building *b); void building_set_alive_cb(void (*f)(const struct util_rect *dim, bool alive, void *p), void *p); int building_render(const struct building *b, const struct camera *cam, bool sel); -instance_hp building_maxhp(const struct building *b); const char *building_str(const struct building *b); extern struct sprite building_sprites[MAX_BUILDING_TYPES]; diff --git a/src/building/src/building.c b/src/building/src/building.c index 5ff9183..457d9e6 100644 --- a/src/building/src/building.c +++ b/src/building/src/building.c @@ -6,16 +6,6 @@ struct sprite building_sprites[MAX_BUILDING_TYPES]; -instance_hp building_maxhp(const struct building *const b) -{ - static const instance_hp hp[] = - { - [BUILDING_TYPE_BARRACKS] = 100 - }; - - return hp[b->type]; -} - int building_render(const struct building *const b, const struct camera *const cam, const bool sel) { @@ -33,8 +23,7 @@ int building_render(const struct building *const b, .prim_type = INSTANCE_RENDER_CFG_SPRITE, .prim = {.s = s}, .cam = cam, - .sel = sel, - .max_hp = building_maxhp(b) + .sel = sel }; return instance_render(&cfg); @@ -69,7 +58,6 @@ void building_create(const struct building_cfg *const cfg, i->r.x = cfg->x; i->r.y = cfg->y; i->alive = true; - i->hp = building_maxhp(b); if (cb) cb(&i->r, i->alive, op); -- cgit v1.2.3