diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2024-01-27 17:53:11 +0100 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2024-01-28 04:12:46 +0100 |
| commit | e49e3073c67af785447ddb0ecbdc521b68cf3ea9 (patch) | |
| tree | 6eb641e4aaa6e86c2767aba1093a54b541c52164 /src | |
| parent | db3ee0d63620bd42f27a6b359f0996df927481dd (diff) | |
| download | jancity-e49e3073c67af785447ddb0ecbdc521b68cf3ea9.tar.gz | |
Add unit sprites
Diffstat (limited to 'src')
| -rw-r--r-- | src/game/src/res.c | 36 | ||||
| -rw-r--r-- | src/unit/inc/unit.h | 17 | ||||
| -rw-r--r-- | src/unit/src/unit.c | 2 |
3 files changed, 46 insertions, 9 deletions
diff --git a/src/game/src/res.c b/src/game/src/res.c index f38443e..dead212 100644 --- a/src/game/src/res.c +++ b/src/game/src/res.c @@ -73,6 +73,42 @@ static const struct container c[] = .type = CONTAINER_TYPE_SPRITE, .data.sprite = &terrain_sprites[GRASS] }, + + { + .path = "unit1", + .type = CONTAINER_TYPE_SPRITE, + .data.sprite = &unit_sprites[UNIT_1_SPRITE] + }, + + { + .path = "unit2", + .type = CONTAINER_TYPE_SPRITE, + .data.sprite = &unit_sprites[UNIT_2_SPRITE] + }, + + { + .path = "unit3", + .type = CONTAINER_TYPE_SPRITE, + .data.sprite = &unit_sprites[UNIT_3_SPRITE] + }, + + { + .path = "unit4", + .type = CONTAINER_TYPE_SPRITE, + .data.sprite = &unit_sprites[UNIT_4_SPRITE] + }, + + { + .path = "unit5", + .type = CONTAINER_TYPE_SPRITE, + .data.sprite = &unit_sprites[UNIT_5_SPRITE] + }, + + { + .path = "unit6", + .type = CONTAINER_TYPE_SPRITE, + .data.sprite = &unit_sprites[UNIT_6_SPRITE] + } }; static bool init; diff --git a/src/unit/inc/unit.h b/src/unit/inc/unit.h index d86704d..8d3e1bf 100644 --- a/src/unit/inc/unit.h +++ b/src/unit/inc/unit.h @@ -76,16 +76,17 @@ const char *unit_str(const struct unit *u); enum { - UNIT_SPRITE_N, - UNIT_SPRITE_NE, - UNIT_SPRITE_E, - UNIT_SPRITE_SE, - UNIT_SPRITE_S, - - MAX_UNIT_SPRIES + UNIT_1_SPRITE, + UNIT_2_SPRITE, + UNIT_3_SPRITE, + UNIT_4_SPRITE, + UNIT_5_SPRITE, + UNIT_6_SPRITE, + + MAX_UNIT_SPRITES }; -extern struct sprite unit_sprites[MAX_UNIT_SPRIES]; +extern struct sprite unit_sprites[MAX_UNIT_SPRITES]; enum unit_sound { diff --git a/src/unit/src/unit.c b/src/unit/src/unit.c index 3333797..1bb1e0f 100644 --- a/src/unit/src/unit.c +++ b/src/unit/src/unit.c @@ -8,7 +8,7 @@ #include <stdlib.h> #include <string.h> -struct sprite unit_sprites[MAX_UNIT_SPRIES]; +struct sprite unit_sprites[MAX_UNIT_SPRITES]; struct sound unit_sounds[MAX_UNIT_SOUNDS]; enum {N_FRAMES = 5}; |
