ECS improvements!

This commit is contained in:
2025-08-21 18:58:34 -05:00
parent 9f5894cdcb
commit 1b4c270ccb
8 changed files with 70 additions and 37 deletions

View File

@@ -8,4 +8,4 @@
#include "camera.h"
camera_t CAMERA_DATA[ECS_ENTITY_COUNT_MAX] = { 0 };
ecscomponent_t CAMERA_COMPONENT = ecsComponentInit(CAMERA_DATA);
ecscomponent_t CAMERA_COMPONENT = ecsComponentInit(CAMERA_DATA, NULL);

View File

@@ -20,7 +20,7 @@ extern ecscomponent_t CAMERA_COMPONENT;
*
* @param id The ID of the entity to initialize the camera for.
*/
#define cameraAdd(id) ecsComponentDataAdd(&CAMERA_COMPONENT, id)
#define cameraAdd(id) ((camera_t*)ecsComponentDataAdd(&CAMERA_COMPONENT, id))
/**
* Gets the camera component data for a specific entity.
@@ -28,7 +28,7 @@ extern ecscomponent_t CAMERA_COMPONENT;
* @param id The ID of the entity to get the camera data for.
* @return Pointer to the camera data for the entity.
*/
#define cameraGet(id) ecsComponentDataGet(&CAMERA_COMPONENT, id)
#define cameraGet(id) ((camera_t*)ecsComponentDataGet(&CAMERA_COMPONENT, id))
/**
* Checks if the camera component has data for a specific entity.