Make OnLoad phase unstaged
@@ -1023,20 +1023,23 @@ void revalidate_system_refs(
static
void run_single_thread_stage(
ecs_world_t *world,
- ecs_vector_t *systems)
+ ecs_vector_t *systems,
+ bool staged)
{
uint32_t i, system_count = ecs_vector_count(systems);
if (system_count) {
ecs_entity_t *buffer = ecs_vector_first(systems);
+ if (staged) {
world->in_progress = true;
+ }
for (i = 0; i < system_count; i ++) {
ecs_run(world, buffer[i], world->delta_time, NULL);
}
- if (world->auto_merge) {
+ if (staged && world->auto_merge) {
world->in_progress = false;
ecs_merge(world);
world->in_progress = true;
@@ -1159,8 +1162,8 @@ bool ecs_progress(
/* -- System execution starts here -- */
- run_single_thread_stage(world, world->on_load_systems);
- run_single_thread_stage(world, world->post_load_systems);
+ run_single_thread_stage(world, world->on_load_systems, false);
+ run_single_thread_stage(world, world->post_load_systems, true);
if (has_threads) {
run_multi_thread_stage(world, world->pre_update_systems);
@@ -1168,14 +1171,14 @@ bool ecs_progress(
run_multi_thread_stage(world, world->on_validate_systems);
run_multi_thread_stage(world, world->post_update_systems);
} else {
- run_single_thread_stage(world, world->pre_update_systems);
- run_single_thread_stage(world, world->on_update_systems);
- run_single_thread_stage(world, world->on_validate_systems);
- run_single_thread_stage(world, world->post_update_systems);
+ run_single_thread_stage(world, world->pre_update_systems, true);
+ run_single_thread_stage(world, world->on_update_systems, true);
+ run_single_thread_stage(world, world->on_validate_systems, true);
+ run_single_thread_stage(world, world->post_update_systems, true);
}
- run_single_thread_stage(world, world->pre_store_systems);
- run_single_thread_stage(world, world->on_store_systems);
+ run_single_thread_stage(world, world->pre_store_systems, true);
+ run_single_thread_stage(world, world->on_store_systems, true);
/* -- System execution stops here -- */
