| 513 | } |
| 514 | |
| 515 | void 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 | |
| 547 | void sugoi_storage_t::cast(sugoi_group_t* srcGroup, sugoi_group_t* group, sugoi_cast_callback_t callback, void* u) |
| 548 | { |
no test coverage detected