summaryrefslogtreecommitdiff
path: root/src/map.c
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrik@amftech.nl>2022-12-27 09:05:33 +0100
committerAldrik Ramaekers <aldrik@amftech.nl>2022-12-27 09:05:33 +0100
commitd055cf69c8925e895cfcb726a4339f843f3ccfc1 (patch)
tree895f6f7d22272810f7d350f1b5f9b5b2c7dddd30 /src/map.c
parent88fb94168c87dd8cc07e16cb988e0ea5c25bc202 (diff)
work
Diffstat (limited to 'src/map.c')
-rw-r--r--src/map.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/map.c b/src/map.c
index faa447e..2b22888 100644
--- a/src/map.c
+++ b/src/map.c
@@ -95,9 +95,18 @@ static int get_height_of_tile_tr(int current_height, int x, int y) {
// load hardcoded map.
void load_map_from_data() {
+
+ // load map from file..
+ file_content content = platform_read_file_content("data/maps/map1.dat", "rb");
+ memcpy(&map_to_load, content.content, content.content_length);
+
+ //map_to_load.width = MAP_SIZE_X;
+ //map_to_load.height = MAP_SIZE_Y;
+ //memcpy(map_to_load.heightmap, map, sizeof(map));
+
for (int y = 0; y < MAP_SIZE_Y; y++) {
for (int x = MAP_SIZE_X-1; x >= 0; x--) {
- int h = map[y][x];
+ int h = map_to_load.heightmap[y][x];
int highest_point_topleft = get_height_of_tile_tl(h, x, y);
int highest_point_topright = get_height_of_tile_tr(h, x, y);
int highest_point_bottomright = get_height_of_tile_br(h, x, y);