From e41500c9953a628366e237a0993ab81e7fadc14e Mon Sep 17 00:00:00 2001 From: 999pingGG Date: Thu, 28 Sep 2023 10:47:24 -0600 Subject: [PATCH] Misc corrections to the docs (#1048) --- docs/Relationships.md | 8 ++++---- examples/c/entities/iterate_components/src/main.c | 2 +- examples/c/prefabs/basics/src/main.c | 2 +- examples/c/prefabs/override/src/main.c | 2 +- examples/c/reflection/auto_define_enum/src/main.c | 2 +- flecs.h | 4 ++-- include/flecs.h | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/Relationships.md b/docs/Relationships.md index 47b8ec5978..1d38178ca1 100644 --- a/docs/Relationships.md +++ b/docs/Relationships.md @@ -762,7 +762,7 @@ The following examples show how to use cleanup policies ```c // Remove Archer from entities when Archer is deleted ECS_TAG(world, Archer); -ecs_add_pair(world, EcsOnDelete, EcsRemove); +ecs_add_pair(world, Archer, EcsOnDelete, EcsRemove); ecs_entity_t e = ecs_new_w_id(world, Archer); @@ -770,7 +770,7 @@ ecs_entity_t e = ecs_new_w_id(world, Archer); ecs_delete(world, Archer); ``` ```cpp -// Delete entities with Archer when Archer is deleted +// Remove Archer from entities when Archer is deleted world.component() .add(flecs::OnDelete, flecs::Remove); @@ -784,7 +784,7 @@ world.component().destruct(); ```c // Delete entities with Archer when Archer is deleted ECS_TAG(world, Archer); -ecs_add_pair(world, EcsOnDelete, EcsDelete); +ecs_add_pair(world, Archer, EcsOnDelete, EcsDelete); ecs_entity_t e = ecs_new_w_id(world, Archer); @@ -806,7 +806,7 @@ world.component().destruct(); ```c // Delete children when deleting parent ECS_TAG(world, ChildOf); -ecs_add_pair(world, EcsOnDeleteTarget, EcsDelete); +ecs_add_pair(world, ChildOf, EcsOnDeleteTarget, EcsDelete); ecs_entity_t p = ecs_new_id(world); ecs_entity_t e = ecs_new_w_pair(world, ChildOf, p); diff --git a/examples/c/entities/iterate_components/src/main.c b/examples/c/entities/iterate_components/src/main.c index 5537e78024..054ac25dba 100644 --- a/examples/c/entities/iterate_components/src/main.c +++ b/examples/c/entities/iterate_components/src/main.c @@ -15,7 +15,7 @@ void iterate_components(ecs_world_t *ecs, ecs_entity_t e) { ecs_os_free(type_str); // 2. To print individual ids, iterate the type array with ecs_id_str - ecs_id_t *type_ids = type->array; + const ecs_id_t *type_ids = type->array; int32_t i, count = type->count; for (i = 0; i < count; i ++) { diff --git a/examples/c/prefabs/basics/src/main.c b/examples/c/prefabs/basics/src/main.c index 7a25928ecd..d51c4308ab 100644 --- a/examples/c/prefabs/basics/src/main.c +++ b/examples/c/prefabs/basics/src/main.c @@ -15,7 +15,7 @@ // // To get a private copy of a component, an instance can add it which is called // an override. Overrides can be manual (by using add) or automatic (see the -// auto_override example). +// override example). // // If a prefab has children, adding the IsA relationship instantiates the prefab // children for the instance (see hierarchy example). diff --git a/examples/c/prefabs/override/src/main.c b/examples/c/prefabs/override/src/main.c index 7150d725da..020439a9ae 100644 --- a/examples/c/prefabs/override/src/main.c +++ b/examples/c/prefabs/override/src/main.c @@ -24,7 +24,7 @@ int main(int argc, char *argv[]) { ecs_entity_t SpaceShip = ecs_new_prefab(ecs, "SpaceShip"); - // Attack and Damage are properties that can be shared across many + // Attack and Defense are properties that can be shared across many // spaceships. This saves memory, and speeds up prefab creation as we don't // have to copy the values of Attack and Defense to private components. ecs_set(ecs, SpaceShip, Attack, { 75 }); diff --git a/examples/c/reflection/auto_define_enum/src/main.c b/examples/c/reflection/auto_define_enum/src/main.c index 7293f71d9a..66c7740a75 100644 --- a/examples/c/reflection/auto_define_enum/src/main.c +++ b/examples/c/reflection/auto_define_enum/src/main.c @@ -16,7 +16,7 @@ int main(int argc, char *argv[]) { ecs_world_t *ecs = ecs_init_w_args(argc, argv); // Register both components. Note that Color is registered first, so that - // when Line is registered, the type information of Color can be looked up + // when Car is registered, the type information of Color can be looked up ECS_META_COMPONENT(ecs, Color); ECS_META_COMPONENT(ecs, Car); diff --git a/flecs.h b/flecs.h index 4350bf69ed..7f9960ff5a 100644 --- a/flecs.h +++ b/flecs.h @@ -5680,7 +5680,7 @@ void ecs_modified_id( * @param world The world. * @param entity The entity. * @param id The id of the component to set. - * @param size The size of the pointer to the value. + * @param size The size of the pointed-to value. * @param ptr The pointer to the value. * @return The entity. A new entity if no entity was provided. */ @@ -11213,7 +11213,7 @@ ecs_entity_t ecs_system_init( * Any system may interrupt execution by setting the interrupted_by member in * the ecs_iter_t value. This is particularly useful for manual systems, where * the value of interrupted_by is returned by this operation. This, in - * cominbation with the param argument lets applications use manual systems + * combination with the param argument lets applications use manual systems * to lookup entities: once the entity has been found its handle is passed to * interrupted_by, which is then subsequently returned. * diff --git a/include/flecs.h b/include/flecs.h index e98550b623..9009b094b2 100644 --- a/include/flecs.h +++ b/include/flecs.h @@ -2883,7 +2883,7 @@ void ecs_modified_id( * @param world The world. * @param entity The entity. * @param id The id of the component to set. - * @param size The size of the pointer to the value. + * @param size The size of the pointed-to value. * @param ptr The pointer to the value. * @return The entity. A new entity if no entity was provided. */