aboutsummaryrefslogtreecommitdiff
path: root/src/unit
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2024-01-27 14:14:37 +0100
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2024-01-27 17:38:12 +0100
commit27553f8ed1d062c4d8175e7376f5b16cf2c8f9ef (patch)
treed46534843f12273ecb3cfc4923af6b600c385e08 /src/unit
parent0f21739551b2daf578ad9c5ed3367c8a8ed7b7c9 (diff)
downloadjancity-27553f8ed1d062c4d8175e7376f5b16cf2c8f9ef.tar.gz
Remove stale unit and building types
Diffstat (limited to 'src/unit')
-rw-r--r--src/unit/inc/unit_type.h2
-rw-r--r--src/unit/src/unit.c28
2 files changed, 8 insertions, 22 deletions
diff --git a/src/unit/inc/unit_type.h b/src/unit/inc/unit_type.h
index fddd5c9..f023784 100644
--- a/src/unit/inc/unit_type.h
+++ b/src/unit/inc/unit_type.h
@@ -3,8 +3,6 @@
enum unit_type
{
- UNIT_TYPE_PEASANT,
-
MAX_UNIT_TYPES
};
diff --git a/src/unit/src/unit.c b/src/unit/src/unit.c
index a95cca3..3333797 100644
--- a/src/unit/src/unit.c
+++ b/src/unit/src/unit.c
@@ -64,14 +64,7 @@ static void get_speed(const struct unit *const u, fix16_t *const x,
static const struct speed
{
fix16_t x, y;
- } speed[] =
- {
- [UNIT_TYPE_PEASANT] =
- {
- .x = FIX16_C_FROM_INT(1),
- .y = FIX16_C_FROM_INT(1)
- }
- };
+ } speed[1];
const struct speed *const s = &speed[u->type];
const int dx = abs(u->rx - u->tx);
@@ -258,6 +251,7 @@ typedef const struct
static anim_dim *peasant_anim(const struct unit *const u)
{
+#if 0
static anim_dim t[] =
{
{
@@ -312,6 +306,9 @@ static anim_dim *peasant_anim(const struct unit *const u)
return NULL;
return &t[ux];
+#else
+ return NULL;
+#endif
}
struct render_cfg
@@ -367,10 +364,7 @@ static int unit_quad(const struct unit *const u, struct render_cfg *const rcfg)
{
struct instance_render_quad *const qcfg = &rcfg->qcfg;
- static anim_dim *(*const f[])(const struct unit *) =
- {
- [UNIT_TYPE_PEASANT] = peasant_quad
- };
+ static anim_dim *(*const f[1])(const struct unit *);
anim_dim *const dim = f[u->type](u);
@@ -418,10 +412,7 @@ static void get_dimensions(const enum unit_type type, short *const w,
static const struct dim
{
short w, h;
- } dim[] =
- {
- [UNIT_TYPE_PEASANT] = {.w = 36, .h = 36}
- };
+ } dim[1];
const struct dim *const d = &dim[type];
*w = d->w;
@@ -451,10 +442,7 @@ void unit_create(const struct unit_cfg *const cfg, struct unit *const u)
const char *unit_str(const struct unit *const u)
{
- static const char *const str[] =
- {
- [UNIT_TYPE_PEASANT] = "Peasant"
- };
+ static const char *const str[1];
return str[u->type];
}