summaryrefslogtreecommitdiff
path: root/src/chunk.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/chunk.h')
-rw-r--r--src/chunk.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/chunk.h b/src/chunk.h
new file mode 100644
index 0000000..420211f
--- /dev/null
+++ b/src/chunk.h
@@ -0,0 +1,24 @@
+// SPDX-FileCopyrightText: 2024 Lizzy Fleckenstein <lizzy@vlhl.dev>
+//
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+#ifndef CHUNK_H
+#define CHUNK_H
+
+#include <stdbool.h>
+#include "vec.h"
+#include "content.h"
+
+typedef struct {
+ uint32_t pitch;
+ box2 bounds;
+ node *data;
+} chunk;
+
+chunk chunk_alloc(box2 b);
+node *chunk_index(chunk c, uvec2 v);
+node *chunk_index_abs(chunk c, vec2 v);
+void chunk_copy(chunk dst, chunk src);
+void chunk_clear(chunk c);
+
+#endif