Remove unused components

scene_man
En Yi 2023-02-11 22:12:17 +08:00
parent 9d959bad07
commit 9106899c8a
2 changed files with 1 additions and 23 deletions

View File

@ -4,7 +4,7 @@
#include <stdint.h> #include <stdint.h>
// TODO: Look at sc to use macros to auto generate functions // TODO: Look at sc to use macros to auto generate functions
#define N_COMPONENTS 9 #define N_COMPONENTS 7
enum ComponentEnum enum ComponentEnum
{ {
CBBOX_COMP_T, CBBOX_COMP_T,
@ -14,8 +14,6 @@ enum ComponentEnum
CJUMP_COMP_T, CJUMP_COMP_T,
CPLAYERSTATE_T, CPLAYERSTATE_T,
CCONTAINER_T, CCONTAINER_T,
CSELECTABLE_T,
CSELECTION_T,
}; };
typedef enum ComponentEnum ComponentEnum_t; typedef enum ComponentEnum ComponentEnum_t;
@ -97,22 +95,6 @@ typedef struct _CContainer_t
ContainerItem_t item; ContainerItem_t item;
}CContainer_t; }CContainer_t;
typedef struct _CSelection_t
{
uint8_t max_choices;
uint8_t curr_choice;
void * data_arr;
unsigned int elem_size;
}CSelection_t;
typedef struct _CSelectable_t CSelectable_t;
typedef void(*selected_callback_t)(CSelectable_t *);
struct _CSelectable_t
{
selected_callback_t callback;
};
static inline void set_bbox(CBBox_t* p_bbox, unsigned int x, unsigned int y) static inline void set_bbox(CBBox_t* p_bbox, unsigned int x, unsigned int y)
{ {
p_bbox->size.x = x; p_bbox->size.x = x;

View File

@ -11,8 +11,6 @@ static CMovementState_t cmstate_buffer[MAX_COMP_POOL_SIZE];
static CJump_t cjump_buffer[1]; // Only player is expected to have this static CJump_t cjump_buffer[1]; // Only player is expected to have this
static CPlayerState_t cplayerstate_buffer[1]; // Only player is expected to have this static CPlayerState_t cplayerstate_buffer[1]; // Only player is expected to have this
static CContainer_t ccontainer_buffer[MAX_COMP_POOL_SIZE]; static CContainer_t ccontainer_buffer[MAX_COMP_POOL_SIZE];
static CSelectable_t cselectable_buffer[32];
static CSelection_t cselection_buffer[32];
// Use hashmap as a Set // Use hashmap as a Set
// Use list will be used to check if an object exist // Use list will be used to check if an object exist
@ -39,8 +37,6 @@ static MemPool_t comp_mempools[N_COMPONENTS] =
{cjump_buffer, 1, sizeof(CJump_t), NULL, {0}}, {cjump_buffer, 1, sizeof(CJump_t), NULL, {0}},
{cplayerstate_buffer, 1, sizeof(CPlayerState_t), NULL, {0}}, {cplayerstate_buffer, 1, sizeof(CPlayerState_t), NULL, {0}},
{ccontainer_buffer, MAX_COMP_POOL_SIZE, sizeof(CContainer_t), NULL, {0}}, {ccontainer_buffer, MAX_COMP_POOL_SIZE, sizeof(CContainer_t), NULL, {0}},
{cselectable_buffer, 32, sizeof(CSelectable_t), NULL, {0}},
{cselection_buffer, 32, sizeof(CSelection_t), NULL, {0}},
}; };
static MemPool_t ent_mempool = {entity_buffer, MAX_COMP_POOL_SIZE, sizeof(Entity_t), NULL, {0}}; static MemPool_t ent_mempool = {entity_buffer, MAX_COMP_POOL_SIZE, sizeof(Entity_t), NULL, {0}};