mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-17 01:11:45 +00:00
[ecs] Add a ui function pointer to components
This allows components to display themselves in the UI. Because the component meta-data is copied into the registry, the function pointer can be updated by systems (eg, the renderers) to display system-specific interpretations of the component.
This commit is contained in:
parent
44c1ef5968
commit
102a0d591b
1 changed files with 4 additions and 0 deletions
|
@ -42,6 +42,7 @@
|
|||
*/
|
||||
///@{
|
||||
|
||||
struct imui_ctx_s;
|
||||
struct ecs_registry_s;
|
||||
typedef struct component_s {
|
||||
size_t size;
|
||||
|
@ -51,6 +52,9 @@ typedef struct component_s {
|
|||
uint32_t (*rangeid) (struct ecs_registry_s *reg, uint32_t ent,
|
||||
uint32_t comp);
|
||||
const char *name;
|
||||
void (*ui) (void *comp, struct imui_ctx_s *imui_ctx,
|
||||
struct ecs_registry_s *reg, uint32_t ent,
|
||||
void *data);
|
||||
} component_t;
|
||||
|
||||
#define COMPINLINE GNU89INLINE inline
|
||||
|
|
Loading…
Reference in a new issue