Optimized entity memory.

This commit is contained in:
2026-04-14 14:48:26 -05:00
parent 87bfb92576
commit 46a5403511
2 changed files with 8 additions and 2 deletions
+2 -2
View File
@@ -8,8 +8,8 @@
#pragma once #pragma once
#include "dusk.h" #include "dusk.h"
#define ENTITY_COUNT_MAX 128 #define ENTITY_COUNT_MAX 64
#define ENTITY_COMPONENT_COUNT_MAX 24 #define ENTITY_COMPONENT_COUNT_MAX 16
typedef uint8_t entityid_t; typedef uint8_t entityid_t;
typedef uint8_t componentid_t; typedef uint8_t componentid_t;
+6
View File
@@ -17,6 +17,12 @@ void entityManagerInit(void) {
ENTITY_MANAGER.entitiesWithComponent, 0xFF, ENTITY_MANAGER.entitiesWithComponent, 0xFF,
sizeof(entityid_t) * COMPONENT_TYPE_COUNT * ENTITY_COUNT_MAX sizeof(entityid_t) * COMPONENT_TYPE_COUNT * ENTITY_COUNT_MAX
); );
printf(
"Entity Manager size is currently: %zu bytes (%.2f KB)\n",
sizeof(entitymanager_t),
sizeof(entitymanager_t) / 1024.0f
);
} }
entityid_t entityManagerAdd() { entityid_t entityManagerAdd() {