aboutsummaryrefslogtreecommitdiff
path: root/src/scene/scene_memory.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/scene/scene_memory.h')
-rw-r--r--src/scene/scene_memory.h39
1 files changed, 0 insertions, 39 deletions
diff --git a/src/scene/scene_memory.h b/src/scene/scene_memory.h
deleted file mode 100644
index d175cba..0000000
--- a/src/scene/scene_memory.h
+++ /dev/null
@@ -1,39 +0,0 @@
1/// Memory management of scene objects.
2#pragma once
3
4#include "types.h"
5
6/// Initialize scene memory.
7///
8/// The scene memory guarantees that every object maps to an index different
9/// than 0. This way, 0 can be used as a special index to denote "no value".
10void scene_mem_init();
11
12/// Destroy the scene memory and all allocated objects.
13void scene_mem_destroy();
14
15#define NAMED_INDEX(name) name##_idx
16
17#define DECL_MEMORY(name, type) \
18 typedef struct type type; \
19 /* xyz* mem_alloc_xyz() */ \
20 type* mem_alloc_##name(); \
21 /* mem_free_xyz(xyz**) */ \
22 void mem_free_##name(type**); \
23 /* xyz* mem_get_xyz(xyz_idx); */ \
24 type* mem_get_##name(NAMED_INDEX(name)); \
25 /* xyz_idx mem_get_xyz_index(const xyz*); */ \
26 NAMED_INDEX(name) mem_get_##name##_index(const type*);
27
28DECL_MEMORY(anima, Anima)
29DECL_MEMORY(animation, Animation)
30DECL_MEMORY(camera, SceneCamera)
31DECL_MEMORY(light, Light)
32DECL_MEMORY(material, Material)
33DECL_MEMORY(mesh, Mesh)
34DECL_MEMORY(mesh_link, MeshLink)
35DECL_MEMORY(model, Model)
36DECL_MEMORY(node, SceneNode)
37DECL_MEMORY(object, SceneObject)
38DECL_MEMORY(scene, Scene)
39DECL_MEMORY(skeleton, Skeleton)