diff options
| author | Aldrik Ramaekers <aldrik@amftech.nl> | 2023-04-30 19:18:50 +0200 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrik@amftech.nl> | 2023-04-30 19:18:50 +0200 |
| commit | 3767d1ce3e2b90d4eb667985c0997cb5293cc27e (patch) | |
| tree | a3a9671aefd322794518c55105ea0085e1d73d09 /include/map.h | |
| parent | 784b123af41337c57535b80c15fe13b62dfc1e66 (diff) | |
work
Diffstat (limited to 'include/map.h')
| -rw-r--r-- | include/map.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/map.h b/include/map.h index 4147146..6a509e2 100644 --- a/include/map.h +++ b/include/map.h @@ -6,8 +6,14 @@ #include "players.h" #include "objects.h" +typedef enum t_tile_type { + TILE_NONE = 0, + TILE_COBBLESTONE1 = 1, +} tile_type; + typedef struct t_tile { int height; + tile_type type; // filled in on load. int topleft; @@ -36,17 +42,21 @@ typedef struct t_map_data { int width; int height; int heightmap[MAP_SIZE_Y][MAP_SIZE_X]; + tile_type tiles[MAP_SIZE_Y][MAP_SIZE_X]; + object objects[MAX_OBJECTS]; } map_data; typedef struct t_extracted_map_data { int width; int height; tile heightmap[MAP_SIZE_Y][MAP_SIZE_X]; + object objects[MAX_OBJECTS]; } extracted_map_data; map_data map_to_load = {0}; extracted_map_data loaded_map = {0}; +void create_empty_map(); void load_map_from_file(); tile get_tile_under_coords(float x, float y); float get_height_of_tile_under_coords(float tocheckx, float tochecky); |
