@@ -523,6 +523,7 @@ typedef struct ecs_header_t {
523523 ecs_mixins_t * mixins ; /**< Table with offsets to (optional) mixins */
524524} ecs_header_t ;
525525
526+ /** Opaque type for table record. */
526527typedef struct ecs_table_record_t ecs_table_record_t ;
527528
528529/** @} */
@@ -1398,8 +1399,8 @@ typedef struct ecs_observer_desc_t {
13981399
13991400 /** Used for internal purposes. Do not set. */
14001401 int32_t * last_event_id ;
1401- int8_t term_index_ ;
1402- ecs_flags32_t flags_ ;
1402+ int8_t term_index_ ; /**< Used for internal purposes. Do not set. */
1403+ ecs_flags32_t flags_ ; /**< Used for internal purposes. Do not set. */
14031404} ecs_observer_desc_t ;
14041405
14051406/** Used with ecs_emit().
@@ -1537,7 +1538,7 @@ typedef struct ecs_world_info_t {
15371538
15381539/** Type that contains information about a query group. */
15391540typedef struct ecs_query_group_info_t {
1540- uint64_t id ;
1541+ uint64_t id ; /**< Group id */
15411542 int32_t match_count ; /**< How often tables have been matched/unmatched */
15421543 int32_t table_count ; /**< Number of tables in group */
15431544 void * ctx ; /**< Group context, returned by on_group_create */
@@ -1581,30 +1582,33 @@ typedef struct EcsDefaultChildComponent {
15811582 ecs_id_t component ; /**< Default component id. */
15821583} EcsDefaultChildComponent ;
15831584
1584- /* Non-fragmenting ChildOf relationship. */
1585+ /** Non-fragmenting ChildOf relationship. */
15851586typedef struct EcsParent {
1586- ecs_entity_t value ;
1587+ ecs_entity_t value ; /**< Parent entity */
15871588} EcsParent ;
15881589
1589- /* Component with data to instantiate a non-fragmenting tree. */
1590+ /** Component with data to instantiate a non-fragmenting tree. */
15901591typedef struct {
1591- const char * child_name ; /* Name of prefab child */
1592- ecs_table_t * table ; /* Table in which child will be stored */
1593- uint32_t child ; /* Prefab child entity (without generation) */
1594- int32_t parent_index ; /* Index into children vector */
1592+ const char * child_name ; /**< Name of prefab child */
1593+ ecs_table_t * table ; /**< Table in which child will be stored */
1594+ uint32_t child ; /**< Prefab child entity (without generation) */
1595+ int32_t parent_index ; /**< Index into children vector */
15951596} ecs_tree_spawner_child_t ;
15961597
1598+ /** Tree spawner data for a single hierarchy depth. */
15971599typedef struct {
1598- ecs_vec_t children ; /* vector<ecs_tree_spawner_child_t> */
1600+ ecs_vec_t children ; /**< vector<ecs_tree_spawner_child_t> */
15991601} ecs_tree_spawner_t ;
16001602
1603+ /** Tree instantiation cache component.
1604+ * Tree instantiation cache, indexed by depth. Tables will have a
1605+ * (ParentDepth, depth) pair indicating the hierarchy depth. This means that
1606+ * for different depths, the tables the children are created in will also be
1607+ * different. Caching tables for different depths therefore speeds up
1608+ * instantiating trees even when the top level entity is not at the root.
1609+ */
16011610typedef struct EcsTreeSpawner {
1602- /* Tree instantiation cache, indexed by depth. Tables will have a
1603- * (ParentDepth, depth) pair indicating the hierarchy depth. This means that
1604- * for different depths, the tables the children are created in will also be
1605- * different. Caching tables for different depths therefore speeds up
1606- * instantiating trees even when the top level entity is not at the root. */
1607- ecs_tree_spawner_t data [FLECS_TREE_SPAWNER_DEPTH_CACHE_SIZE ];
1611+ ecs_tree_spawner_t data [FLECS_TREE_SPAWNER_DEPTH_CACHE_SIZE ]; /**< Cache data indexed by depth */
16081612} EcsTreeSpawner ;
16091613
16101614/** @} */
@@ -3371,6 +3375,7 @@ FLECS_ALWAYS_INLINE void* ecs_get_mut_id(
33713375 * @param world The world.
33723376 * @param entity The entity.
33733377 * @param component The component to get/add.
3378+ * @param size The size of the component.
33743379 * @return The component pointer.
33753380 *
33763381 * @see ecs_emplace_id()
@@ -4128,6 +4133,7 @@ char* ecs_get_path_w_sep(
41284133 * @param sep The separator to use between path elements.
41294134 * @param prefix The initial character to use for root elements.
41304135 * @param buf The buffer to write to.
4136+ * @param escape Whether to escape separator characters in names.
41314137 *
41324138 * @see ecs_get_path_w_sep()
41334139 */
@@ -5727,6 +5733,7 @@ void* ecs_field_w_size(
57275733 * @param it the iterator.
57285734 * @param size The size of the field type.
57295735 * @param index The index of the field.
5736+ * @param row The row to get data for.
57305737 * @return A pointer to the data of the field.
57315738 */
57325739FLECS_API
@@ -6191,6 +6198,8 @@ void ecs_table_swap_rows(
61916198 * @param entity The entity to commit.
61926199 * @param record The entity's record (optional, providing it saves a lookup).
61936200 * @param table The table to commit the entity to.
6201+ * @param added Components added to the entity.
6202+ * @param removed Components removed from the entity.
61946203 * @return True if the entity got moved, false otherwise.
61956204 */
61966205FLECS_API
@@ -6325,7 +6334,21 @@ int32_t ecs_search_relation(
63256334 ecs_id_t * component_out ,
63266335 struct ecs_table_record_t * * tr_out );
63276336
6328- /* Up traversal from entity */
6337+ /** Search for component id by following a relationship, starting from entity.
6338+ * This operation is the same as ecs_search_relation(), but starts the search
6339+ * from an entity rather than a table.
6340+ *
6341+ * @param world The world.
6342+ * @param entity The entity from which to begin the search.
6343+ * @param id The component id to search for.
6344+ * @param rel The relationship to follow.
6345+ * @param self If true, also search the entity itself.
6346+ * @param cr Optional component record for the id.
6347+ * @param tgt_out Out parameter for the target entity.
6348+ * @param id_out Out parameter for the found id.
6349+ * @param tr_out Out parameter for the table record.
6350+ * @return The index of the id in the entity's type, or -1 if not found.
6351+ */
63296352FLECS_API
63306353int32_t ecs_search_relation_for_entity (
63316354 const ecs_world_t * world ,
0 commit comments