aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/gfx/sizes.h2
-rw-r--r--src/asset/asset_cache.c2
-rw-r--r--src/scene/object_impl.h5
-rw-r--r--src/scene/scene_memory.c2
4 files changed, 7 insertions, 4 deletions
diff --git a/include/gfx/sizes.h b/include/gfx/sizes.h
index 05eefc7..14f72bc 100644
--- a/include/gfx/sizes.h
+++ b/include/gfx/sizes.h
@@ -86,7 +86,7 @@
86/// Maximum number of matrices in the immediate-mode renderer's matrix stack. 86/// Maximum number of matrices in the immediate-mode renderer's matrix stack.
87#define IMM_MAX_NUM_MATRICES 32 87#define IMM_MAX_NUM_MATRICES 32
88 88
89// Asset Manager. 89// Asset Cache.
90 90
91#define GFX_MAX_NUM_ASSETS 1024 91#define GFX_MAX_NUM_ASSETS 1024
92 92
diff --git a/src/asset/asset_cache.c b/src/asset/asset_cache.c
index 16c4d5c..727b63f 100644
--- a/src/asset/asset_cache.c
+++ b/src/asset/asset_cache.c
@@ -179,6 +179,7 @@ static Model* clone_model(const Model* model) {
179 179
180void gfx_init_asset_cache(AssetCache* cache) { 180void gfx_init_asset_cache(AssetCache* cache) {
181 assert(cache); 181 assert(cache);
182
182 mempool_make(&cache->assets); 183 mempool_make(&cache->assets);
183 184
184 // Allocate a dummy asset at index 0 to guarantee that no assets allocated by 185 // Allocate a dummy asset at index 0 to guarantee that no assets allocated by
@@ -189,6 +190,7 @@ void gfx_init_asset_cache(AssetCache* cache) {
189 190
190void gfx_destroy_asset_cache(AssetCache* cache) { 191void gfx_destroy_asset_cache(AssetCache* cache) {
191 assert(cache); 192 assert(cache);
193 // TODO: Destroy assets here.
192 mempool_del(&cache->assets); 194 mempool_del(&cache->assets);
193} 195}
194 196
diff --git a/src/scene/object_impl.h b/src/scene/object_impl.h
index 88f8e31..ead93f1 100644
--- a/src/scene/object_impl.h
+++ b/src/scene/object_impl.h
@@ -21,6 +21,7 @@ typedef struct MeshLink {
21typedef struct SceneObject { 21typedef struct SceneObject {
22 mesh_link_idx mesh_link; /// First MeshLink in the list. 22 mesh_link_idx mesh_link; /// First MeshLink in the list.
23 skeleton_idx skeleton; /// 0 for static objects. 23 skeleton_idx skeleton; /// 0 for static objects.
24 node_idx parent; /// Parent SceneNode. 24 // TODO: Can we just store node indices in nodes, not the contained object?
25 aabb3 box; 25 node_idx parent; /// Parent SceneNode.
26 aabb3 box;
26} SceneObject; 27} SceneObject;
diff --git a/src/scene/scene_memory.c b/src/scene/scene_memory.c
index d1d81a9..91880bb 100644
--- a/src/scene/scene_memory.c
+++ b/src/scene/scene_memory.c
@@ -73,7 +73,7 @@ void scene_mem_init() {
73 mempool_make(&mem.skeletons); 73 mempool_make(&mem.skeletons);
74 74
75 // Allocate dummy objects at index 0 to guarantee that no objects allocated by 75 // Allocate dummy objects at index 0 to guarantee that no objects allocated by
76 // the caller map to index 0. 76 // the caller map to index 0. This allows 0 to be used as a sentinel.
77 ALLOC_DUMMY(&mem.animas); 77 ALLOC_DUMMY(&mem.animas);
78 ALLOC_DUMMY(&mem.animations); 78 ALLOC_DUMMY(&mem.animations);
79 ALLOC_DUMMY(&mem.cameras); 79 ALLOC_DUMMY(&mem.cameras);