aboutsummaryrefslogtreecommitdiff
path: root/src/terrain/inc
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2024-01-27 12:42:20 +0100
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2024-01-27 17:38:12 +0100
commit0f21739551b2daf578ad9c5ed3367c8a8ed7b7c9 (patch)
treea0e6bc7e10f9f815fe680fa54f5d912fb460608b /src/terrain/inc
parentdaf6f84ccdf817f7088aa527b4b37c2cca91c052 (diff)
downloadjancity-0f21739551b2daf578ad9c5ed3367c8a8ed7b7c9.tar.gz
Define terrain rendering and loading
Diffstat (limited to 'src/terrain/inc')
-rw-r--r--src/terrain/inc/terrain.h81
1 files changed, 75 insertions, 6 deletions
diff --git a/src/terrain/inc/terrain.h b/src/terrain/inc/terrain.h
index d640f17..f6cf37f 100644
--- a/src/terrain/inc/terrain.h
+++ b/src/terrain/inc/terrain.h
@@ -21,26 +21,95 @@ enum
enum terrain_type
{
- TERRAIN_TYPE_GRASS
+ ROOF1_1_NW,
+ ROOF1_1_N,
+ ROOF1_1_NE,
+ ROOF1_2_NW,
+ ROOF1_2_NE,
+ ROOF1_3_NW,
+ ROOF1_3_N,
+ ROOF1_3_NE,
+ ROOF1_4_N,
+
+ ROOF1_1_W,
+ ROOF1_1_C,
+ ROOF1_1_E,
+ ROOF1_2_SW,
+ ROOF1_2_SE,
+ ROOF1_3_SW,
+ ROOF1_3_S,
+ ROOF1_3_SE,
+ ROOF1_4_C,
+
+ ROOF1_1_SW,
+ ROOF1_1_S,
+ ROOF1_1_SE,
+ ROOF1_5_W,
+ ROOF1_5_C,
+ ROOF1_5_E,
+ ROOF1_6,
+ ROOF1_4_S,
+
+ ROOF2_1_NW,
+ ROOF2_1_N,
+ ROOF2_1_NE,
+ ROOF2_2_NW,
+ ROOF2_2_NE,
+ ROOF2_3_NW,
+ ROOF2_3_N,
+ ROOF2_3_NE,
+ ROOF2_4_N,
+
+ ROOF2_1_W,
+ ROOF2_1_C,
+ ROOF2_1_E,
+ ROOF2_2_SW,
+ ROOF2_2_SE,
+ ROOF2_3_SW,
+ ROOF2_3_S,
+ ROOF2_3_SE,
+ ROOF2_4_C,
+
+ ROOF2_1_SW,
+ ROOF2_1_S,
+ ROOF2_1_SE,
+ ROOF2_5_W,
+ ROOF2_5_C,
+ ROOF2_5_E,
+ ROOF2_6,
+ ROOF2_4_S,
+
+ ROOF1_START = ROOF1_1_NW,
+ ROOF1_END = ROOF1_4_S,
+ ROOF2_START = ROOF2_1_NW,
+ ROOF2_END = ROOF2_4_S
};
struct terrain_map
{
struct terrain_tile
{
- enum terrain_type t;
- unsigned char bl;
+ unsigned char t, obj;
} m[MAP_TILES][MAP_TILES];
int nx, ny, last_w, last_h;
};
-void terrain_init(struct terrain_map *map);
+int terrain_init(const char *path, struct terrain_map *map);
void terrain_update(struct terrain_map *map);
int terrain_render(const struct terrain_map *map, const struct camera *cam);
-void terrain_block_update(const struct util_rect *dim, bool alive, void *p);
-extern struct sprite grass_sprite;
+enum
+{
+ SIDEWALK,
+ ROOF1,
+ ROOF2,
+ BUILDING1,
+
+ MAX_TERRAIN_SPRITES
+};
+
+extern struct sprite terrain_sprites[MAX_TERRAIN_SPRITES];
#ifdef __cplusplus
}