MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / cast

Method cast

modules/engine/runtime/src/ecs/storage.cpp:515–545  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

513}
514
515void sugoi_storage_t::cast(const sugoi_chunk_view_t& view, sugoi_group_t* group, sugoi_cast_callback_t callback, void* u)
516{
517 using namespace sugoi;
518 auto srcGroup = view.chunk->group;
519 if (srcGroup == group)
520 return;
521 if (scheduler)
522 {
523 SKR_ASSERT(scheduler->is_main_thread(this));
524 scheduler->sync_archetype(srcGroup->archetype);
525 }
526 if (!group)
527 {
528 entities.free_entities(view);
529 destruct_view(view);
530 free(view);
531 return;
532 }
533 if (full_view(view) && srcGroup->archetype == group->archetype)
534 {
535 srcGroup->remove_chunk(view.chunk);
536 group->add_chunk(view.chunk);
537 return;
538 }
539 if (scheduler)
540 {
541 if (srcGroup->archetype != group->archetype)
542 scheduler->sync_archetype(group->archetype);
543 }
544 cast_impl(view, group, callback, u);
545}
546
547void sugoi_storage_t::cast(sugoi_group_t* srcGroup, sugoi_group_t* group, sugoi_cast_callback_t callback, void* u)
548{

Callers 4

sugoiS_instantiate_deltaFunction · 0.45
sugoiS_cast_view_deltaFunction · 0.45
sugoiS_cast_view_groupFunction · 0.45
sugoiS_cast_group_deltaFunction · 0.45

Calls 10

destruct_viewFunction · 0.85
full_viewFunction · 0.85
is_main_threadMethod · 0.80
sync_archetypeMethod · 0.80
free_entitiesMethod · 0.80
remove_chunkMethod · 0.80
add_chunkMethod · 0.80
freeFunction · 0.50
mergeFunction · 0.50
clearMethod · 0.45

Tested by

no test coverage detected