aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2024-01-27 17:53:11 +0100
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2024-01-28 04:12:46 +0100
commite49e3073c67af785447ddb0ecbdc521b68cf3ea9 (patch)
tree6eb641e4aaa6e86c2767aba1093a54b541c52164
parentdb3ee0d63620bd42f27a6b359f0996df927481dd (diff)
Add unit sprites
-rw-r--r--res/CMakeLists.txt54
-rw-r--r--res/unit1_24.bmpbin0 -> 9270 bytes
-rw-r--r--res/unit2_24.bmpbin0 -> 9270 bytes
-rw-r--r--res/unit3_24.bmpbin0 -> 9270 bytes
-rw-r--r--res/unit4_24.bmpbin0 -> 9270 bytes
-rw-r--r--res/unit5_24.bmpbin0 -> 9270 bytes
-rw-r--r--res/unit6_24.bmpbin0 -> 9270 bytes
-rw-r--r--src/game/src/res.c36
-rw-r--r--src/unit/inc/unit.h17
-rw-r--r--src/unit/src/unit.c2
10 files changed, 100 insertions, 9 deletions
diff --git a/res/CMakeLists.txt b/res/CMakeLists.txt
index 75ea4c1..65f1ccd 100644
--- a/res/CMakeLists.txt
+++ b/res/CMakeLists.txt
@@ -80,6 +80,54 @@ sprite(NAME grass
CY 48
TRANSPARENT TRUE)
+sprite(NAME unit1
+ X 384
+ Y 0
+ BPP 4
+ CX 384
+ CY 48
+ TRANSPARENT TRUE)
+
+sprite(NAME unit2
+ X 384
+ Y 0
+ BPP 4
+ CX 384
+ CY 48
+ TRANSPARENT TRUE)
+
+sprite(NAME unit3
+ X 384
+ Y 0
+ BPP 4
+ CX 384
+ CY 48
+ TRANSPARENT TRUE)
+
+sprite(NAME unit4
+ X 384
+ Y 0
+ BPP 4
+ CX 384
+ CY 48
+ TRANSPARENT TRUE)
+
+sprite(NAME unit5
+ X 384
+ Y 0
+ BPP 4
+ CX 384
+ CY 48
+ TRANSPARENT TRUE)
+
+sprite(NAME unit6
+ X 384
+ Y 0
+ BPP 4
+ CX 384
+ CY 48
+ TRANSPARENT TRUE)
+
level(NAME city1)
container(NAME jancity
@@ -94,4 +142,10 @@ container(NAME jancity
btn_right
btn_small
font
+ unit1
+ unit2
+ unit3
+ unit4
+ unit5
+ unit6
)
diff --git a/res/unit1_24.bmp b/res/unit1_24.bmp
new file mode 100644
index 0000000..c2ff9da
--- /dev/null
+++ b/res/unit1_24.bmp
Binary files differ
diff --git a/res/unit2_24.bmp b/res/unit2_24.bmp
new file mode 100644
index 0000000..caf7dd6
--- /dev/null
+++ b/res/unit2_24.bmp
Binary files differ
diff --git a/res/unit3_24.bmp b/res/unit3_24.bmp
new file mode 100644
index 0000000..68dd625
--- /dev/null
+++ b/res/unit3_24.bmp
Binary files differ
diff --git a/res/unit4_24.bmp b/res/unit4_24.bmp
new file mode 100644
index 0000000..6d9ae96
--- /dev/null
+++ b/res/unit4_24.bmp
Binary files differ
diff --git a/res/unit5_24.bmp b/res/unit5_24.bmp
new file mode 100644
index 0000000..5d9225a
--- /dev/null
+++ b/res/unit5_24.bmp
Binary files differ
diff --git a/res/unit6_24.bmp b/res/unit6_24.bmp
new file mode 100644
index 0000000..65fe5a0
--- /dev/null
+++ b/res/unit6_24.bmp
Binary files differ
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};