Optimized entity memory.
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
@@ -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() {
|
||||||
|
|||||||
Reference in New Issue
Block a user