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

Function construct_chunk

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

Source from the content-addressed store, hash-verified

379}
380
381void construct_chunk(sugoi_chunk_t* chunk) noexcept
382{
383 archetype_t* type = chunk->type;
384 EIndex* offsets = type->offsets[(int)chunk->pt];
385 uint32_t* sizes = type->sizes;
386 uint32_t* aligns = type->aligns;
387 uint32_t* elemSizes = type->elemSizes;
388 uint32_t* callbackFlags = type->callbackFlags;
389 auto maskValue = uint32_t(1 << type->type.length) - 1;
390
391 for (SIndex i = type->firstChunkComponent; i < type->type.length; ++i)
392 {
393 decltype(type->callbacks[i].constructor) callback = nullptr;
394 if((callbackFlags[i] & SUGOI_CALLBACK_FLAG_CTOR) != 0) SUGOI_UNLIKELY
395 callback = type->callbacks[i].constructor;
396 construct_impl(sugoi_chunk_view_t{chunk, 0, 1}, type->type.data[i], offsets[i], sizes[i], aligns[i], elemSizes[i], maskValue, callback);
397 }
398}
399
400void destruct_chunk(sugoi_chunk_t* chunk) noexcept
401{

Callers 1

new_chunkMethod · 0.85

Calls 1

construct_implFunction · 0.85

Tested by

no test coverage detected