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

Function destruct_chunk

modules/engine/runtime/src/ecs/chunk_view.cpp:400–414  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

398}
399
400void destruct_chunk(sugoi_chunk_t* chunk) noexcept
401{
402 archetype_t* type = chunk->type;
403 EIndex* offsets = type->offsets[(int)chunk->pt];
404 uint32_t* sizes = type->sizes;
405 uint32_t* elemSizes = type->elemSizes;
406 uint32_t* callbackFlags = type->callbackFlags;
407 for (SIndex i = type->firstChunkComponent; i < type->type.length; ++i)
408 {
409 decltype(type->callbacks[i].destructor) callback = nullptr;
410 if((callbackFlags[i] & SUGOI_CALLBACK_FLAG_CTOR) != 0) SUGOI_UNLIKELY
411 callback = type->callbacks[i].destructor;
412 destruct_impl(sugoi_chunk_view_t{chunk, 0, 1}, type->type.data[i], offsets[i], sizes[i], elemSizes[i], type->resourceFields[i], callback);
413 }
414}
415
416void move_view(const sugoi_chunk_view_t& view, EIndex srcStart) noexcept
417{

Callers 3

defragmentMethod · 0.85
resize_chunkMethod · 0.85
clearMethod · 0.85

Calls 1

destruct_implFunction · 0.70

Tested by

no test coverage detected