summaryrefslogtreecommitdiff
path: root/src/kdtree.h
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2023-07-21 01:53:48 +0200
committerdavidovski <david@davidovski.xyz>2023-07-21 01:53:48 +0200
commit2dcefdb4565f96b808ed01ce1d96a802b8f73931 (patch)
tree4776446d3040fbf97b09ef4abda6be816d3c7c67 /src/kdtree.h
parent1aceb70c5659677929bfbbd3f6480bacd8d75e35 (diff)
add chunked tiledmap io
Diffstat (limited to 'src/kdtree.h')
-rw-r--r--src/kdtree.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/kdtree.h b/src/kdtree.h
index 8969533..e121442 100644
--- a/src/kdtree.h
+++ b/src/kdtree.h
@@ -1,3 +1,6 @@
+#include <stdio.h>
+#include <stdlib.h>
+
typedef struct KDTree {
unsigned int x;
unsigned int y;
@@ -19,3 +22,12 @@ void kdtree_free(kdtree_t **root);
//! in order walk of nodes in kdtree
void kdtree_walk(kdtree_t *root, void (* consume)(kdtree_t*));
+//! get number of nodes in a kdtree
+int kdtree_size(kdtree_t *root);
+
+//! write tree to a file
+int kdtree_fwrite(kdtree_t *root, FILE *file);
+
+//! read a tree from file
+int kdtree_fread(kdtree_t **root, FILE *file);
+