From e7a4152899e63182a4cc0dffff6cd331d6dac305 Mon Sep 17 00:00:00 2001 From: Schark Date: Sun, 17 Mar 2024 01:32:33 -0700 Subject: Map overhaul, need to fix renderer --- height-map-display/src/map/square.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 height-map-display/src/map/square.c (limited to 'height-map-display/src/map/square.c') 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 +#include +#include + +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; + } +} -- cgit v1.2.3-18-g5258