@@ -8046,9 +8046,9 @@ void flecs_add_to_root_table(
80468046 ecs_assert(r != NULL, ECS_INTERNAL_ERROR, NULL);
80478047 ecs_assert(r->table == NULL, ECS_INTERNAL_ERROR, NULL);
80488048
8049- ecs_table_diff_t diff = ECS_TABLE_DIFF_INIT ;
8050- flecs_new_entity(world, e, r, &world->store.root, &diff, false, 0) ;
8051- ecs_assert( r->table == &world->store.root, ECS_INTERNAL_ERROR, NULL );
8049+ int32_t row = flecs_table_append(world, &world->store.root, e, false, false) ;
8050+ r->table = &world->store.root;
8051+ r->row = ECS_ROW_TO_RECORD(row, r->row & ECS_ROW_FLAGS_MASK );
80528052
80538053 flecs_journal(world, EcsJournalNew, e, 0, 0);
80548054}
@@ -8513,16 +8513,16 @@ void flecs_deferred_add_remove(
85138513 const ecs_entity_desc_t *desc,
85148514 ecs_entity_t scope,
85158515 ecs_id_t with,
8516- bool flecs_new_entity ,
8516+ bool new_entity ,
85178517 bool name_assigned)
85188518{
85198519 const char *sep = desc->sep;
85208520 const char *root_sep = desc->root_sep;
85218521
85228522 /* If this is a new entity without a name, add the scope. If a name is
85238523 * provided, the scope will be added by the add_path_w_sep function */
8524- if (flecs_new_entity ) {
8525- if (flecs_new_entity && scope && !name && !name_assigned) {
8524+ if (new_entity ) {
8525+ if (new_entity && scope && !name && !name_assigned) {
85268526 ecs_add_id(world, entity, ecs_pair(EcsChildOf, scope));
85278527 }
85288528
@@ -8668,7 +8668,7 @@ ecs_entity_t ecs_entity_init(
86688668 }
86698669
86708670 const char *root_sep = desc->root_sep;
8671- bool flecs_new_entity = false;
8671+ bool new_entity = false;
86728672 bool name_assigned = false;
86738673
86748674 /* Remove optional prefix from name. Entity names can be derived from
@@ -8716,7 +8716,7 @@ ecs_entity_t ecs_entity_init(
87168716 } else {
87178717 result = ecs_new(world);
87188718 }
8719- flecs_new_entity = true;
8719+ new_entity = true;
87208720 ecs_assert(ecs_get_type(world, result) != NULL,
87218721 ECS_INTERNAL_ERROR, NULL);
87228722 ecs_assert(ecs_get_type(world, result)->count == 0,
@@ -8771,10 +8771,10 @@ ecs_entity_t ecs_entity_init(
87718771
87728772 if (ecs_is_deferred(world)) {
87738773 flecs_deferred_add_remove((ecs_world_t*)stage, result, name, desc,
8774- scope, with, flecs_new_entity , name_assigned);
8774+ scope, with, new_entity , name_assigned);
87758775 } else {
87768776 if (flecs_traverse_add(world, result, name, desc,
8777- scope, with, flecs_new_entity , name_assigned))
8777+ scope, with, new_entity , name_assigned))
87788778 {
87798779 return 0;
87808780 }
@@ -10365,9 +10365,10 @@ void ecs_make_alive(
1036510365 ecs_assert(r != NULL, ECS_INTERNAL_ERROR, NULL);
1036610366 ecs_assert(r->table == NULL, ECS_INTERNAL_ERROR, NULL);
1036710367
10368- ecs_table_diff_t diff = ECS_TABLE_DIFF_INIT;
10369- flecs_new_entity(world, entity, r, &world->store.root, &diff, false, 0);
10370- ecs_assert(r->table == &world->store.root, ECS_INTERNAL_ERROR, NULL);
10368+ int32_t row = flecs_table_append(
10369+ world, &world->store.root, entity, false, false);
10370+ r->table = &world->store.root;
10371+ r->row = ECS_ROW_TO_RECORD(row, r->row & ECS_ROW_FLAGS_MASK);
1037110372error:
1037210373 return;
1037310374}
0 commit comments