diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2022-03-30 08:28:47 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2022-03-30 08:28:47 +0200 |
| commit | 1950fe7b0679c6b6486cc7b25bef813db2b1bb4e (patch) | |
| tree | c2098c9ec65f9a9e5fada68c0b51b0217f14b00c /src/terrain/inc | |
| parent | 06056a9b5e900f67702c509ce1ba2e2351357fb7 (diff) | |
| download | jancity-1950fe7b0679c6b6486cc7b25bef813db2b1bb4e.tar.gz | |
Implement sub-tile collboxes
These will be later used by the pathfinding algorithm.
Diffstat (limited to 'src/terrain/inc')
| -rw-r--r-- | src/terrain/inc/terrain.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/terrain/inc/terrain.h b/src/terrain/inc/terrain.h index 508fe25..fbe8af8 100644 --- a/src/terrain/inc/terrain.h +++ b/src/terrain/inc/terrain.h @@ -3,6 +3,7 @@ #include <camera.h> #include <gfx.h> +#include <util.h> #include <stddef.h> #ifdef __cplusplus @@ -25,13 +26,19 @@ enum terrain_type struct terrain_map { - enum terrain_type m[MAP_TILES][MAP_TILES]; + struct terrain_tile + { + enum terrain_type t; + unsigned char bl; + } m[MAP_TILES][MAP_TILES]; + int nx, ny, last_w, last_h; }; void terrain_init(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; |
