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/node.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/node.c')
-rw-r--r-- | height-map-display/src/map/node.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/height-map-display/src/map/node.c b/height-map-display/src/map/node.c new file mode 100644 index 0000000..eaf2877 --- /dev/null +++ b/height-map-display/src/map/node.c @@ -0,0 +1,20 @@ +#include "node.h" + +#include <stdio.h> +#include <stdlib.h> +#include <malloc.h> + +Node* create_node(int x, int y, float elevation) { + Node* node = (Node*)malloc(sizeof(Node)); + if (node != NULL) { + node->x = x; + node->y = y; + node->elevation = elevation; + } + return node; +} + +void change_node_height(Node* node, float diff) { + if (node != NULL) { node->elevation = node->elevation + diff; } +} + |