diff options
author | Schark <jordan@schark.online> | 2024-03-17 01:32:33 -0700 |
---|---|---|
committer | Schark <jordan@schark.online> | 2024-03-17 01:32:33 -0700 |
commit | e7a4152899e63182a4cc0dffff6cd331d6dac305 (patch) | |
tree | 40e7ddb1617b526f80452ad61214b921d2bc23be /height-map-display/src/map/square.c | |
parent | 34fb121dd1583de307e8ba95cc3ad7fb2abb24e1 (diff) | |
download | gamedev-e7a4152899e63182a4cc0dffff6cd331d6dac305.tar.gz gamedev-e7a4152899e63182a4cc0dffff6cd331d6dac305.zip |
Map overhaul, need to fix renderer
Diffstat (limited to 'height-map-display/src/map/square.c')
-rw-r--r-- | height-map-display/src/map/square.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/height-map-display/src/map/square.c b/height-map-display/src/map/square.c new file mode 100644 index 0000000..707f8b7 --- /dev/null +++ b/height-map-display/src/map/square.c @@ -0,0 +1,21 @@ +#include "square.h" +#include "node.h" + +#include <stdio.h> +#include <stdlib.h> +#include <malloc.h> + +Square* init_square(Node *nodes[4], Terrain_Type terrain) { + Square* square; + for (int i; i < 4; i++) { + square->nodes[i] = nodes[i]; + } + square->terrain = terrain; + return square; +} + +void change_square_height(Square* square, float diff) { + for (int i; i < 4; i++) { + square->nodes[i]->elevation = square->nodes[i]->elevation + diff; + } +} |