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

Function sugoiS_query

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

Source from the content-addressed store, hash-verified

893}
894
895void sugoiS_query(sugoi_storage_t* storage, const sugoi_filter_t* filter, const sugoi_meta_filter_t* meta, sugoi_view_callback_t callback, void* u)
896{
897 SKR_ASSERT(sugoi::ordered(*filter));
898 SKR_ASSERT(sugoi::ordered(*meta));
899
900 if (storage->scheduler)
901 {
902 SKR_ASSERT(storage->scheduler->is_main_thread(storage));
903 auto filterChunk = [&](sugoi_group_t* group) {
904 for (EIndex i = 0; i < filter->all.length; ++i)
905 {
906 int idx = group->index(filter->all.data[i]);
907 if (idx != sugoi::kInvalidTypeIndex)
908 storage->scheduler->sync_entry(group->archetype, idx, false);
909 }
910 if (callback)
911 storage->query(group, *filter, *meta, nullptr, nullptr, callback, u);
912 };
913 storage->query_groups(*filter, *meta, SUGOI_LAMBDA(filterChunk));
914 }
915 else
916 {
917 if (callback)
918 storage->query(*filter, *meta, callback, u);
919 }
920}
921
922void sugoiS_merge(sugoi_storage_t* storage, sugoi_storage_t* source)
923{

Callers 6

async_attach_skin_meshFunction · 0.85
async_attach_render_meshFunction · 0.85
create_test_sceneFunction · 0.85
UpdateMethod · 0.85
RollBackMethod · 0.85
main.cppFile · 0.85

Calls 6

orderedFunction · 0.85
is_main_threadMethod · 0.80
sync_entryMethod · 0.80
query_groupsMethod · 0.80
indexMethod · 0.45
queryMethod · 0.45

Tested by

no test coverage detected