summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/allocator.h16
-rw-r--r--include/list.h5
-rw-r--r--include/pathfinding.h5
3 files changed, 23 insertions, 3 deletions
diff --git a/include/allocator.h b/include/allocator.h
new file mode 100644
index 0000000..d1fe9f4
--- /dev/null
+++ b/include/allocator.h
@@ -0,0 +1,16 @@
+#ifndef INCLUDE_ALLOCATOR
+#define INCLUDE_ALLOCATOR
+
+#include <projectbase/project_base.h>
+
+typedef struct t_allocator {
+ void* memory;
+ uint64_t cursor;
+ uint64_t size;
+} allocator;
+
+allocator create_allocator(uint64_t size);
+void* allocator_alloc(allocator* al, uint64_t size);
+void destroy_allocator(allocator* al);
+
+#endif \ No newline at end of file
diff --git a/include/list.h b/include/list.h
index d4809de..41a5705 100644
--- a/include/list.h
+++ b/include/list.h
@@ -4,6 +4,8 @@
#include <projectbase/project_base.h>
+#include "allocator.h"
+
typedef struct t_list_item
{
void *next;
@@ -15,10 +17,11 @@ typedef struct t_list
list_item *start;
u32 count;
u16 size;
+ allocator* al;
} list;
void list_destroy(list* list);
-list list_create(u16 size);
+list list_create(u16 size, allocator* al);
list_item *list_push(list *list, void *data);
void* list_at(list *list, u32 index);
void list_remove_at(list *list, u32 index);
diff --git a/include/pathfinding.h b/include/pathfinding.h
index 2b38766..6bef101 100644
--- a/include/pathfinding.h
+++ b/include/pathfinding.h
@@ -3,6 +3,7 @@
#include <projectbase/project_base.h>
+#include "allocator.h"
#include "players.h"
#include "objects.h"
#include "list.h"
@@ -12,8 +13,8 @@ typedef struct t_pathfinding_request
vec2f start;
vec2f end;
array *to_fill;
- bool cancelled;
- bool done;
+ uint64_t timestamp;
+ mutex mutex;
} pathfinding_request;
array global_pathfinding_queue;