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

Function construct_view

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

Source from the content-addressed store, hash-verified

345}
346
347void construct_view(const sugoi_chunk_view_t& view) noexcept
348{
349 archetype_t* type = view.chunk->type;
350 EIndex* offsets = type->offsets[(int)view.chunk->pt];
351 uint32_t* sizes = type->sizes;
352 uint32_t* aligns = type->aligns;
353 uint32_t* elemSizes = type->elemSizes;
354 uint32_t* callbackFlags = type->callbackFlags;
355 auto maskValue = uint32_t(1 << type->type.length) - 1;
356 for (SIndex i = 0; i < type->firstChunkComponent; ++i)
357 {
358 decltype(type->callbacks[i].constructor) callback = nullptr;
359 if((callbackFlags[i] & SUGOI_CALLBACK_FLAG_CTOR) != 0) SUGOI_UNLIKELY
360 callback = type->callbacks[i].constructor;
361 construct_impl(view, type->type.data[i], offsets[i], sizes[i], aligns[i], elemSizes[i], maskValue, callback);
362 }
363}
364
365void destruct_view(const sugoi_chunk_view_t& view) noexcept
366{

Callers 1

allocateMethod · 0.85

Calls 1

construct_implFunction · 0.85

Tested by

no test coverage detected