MCPcopy Create free account
hub / github.com/Norbyte/bg3se / CreateComponentRaw

Method CreateComponentRaw

BG3Extender/GameDefinitions/EntitySystem.cpp:586–597  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

584}
585
586void* EntityCommandBuffer::CreateComponentRaw(EntityHandle entity, ComponentTypeIndex type, uint16_t componentSize, ComponentFrameStorageIndex& index, void* dtor)
587{
588 auto storage = GetStorage(type, componentSize, dtor);
589
590 auto component = storage->Allocate(index);
591 auto changes = Data.GetOrAddEntityChange(entity);
592 auto change = changes->Store.add();
593 change->Index = index;
594 change->ComponentTypeId = type;
595
596 return component;
597}
598
599void EntityCommandBuffer::RemoveComponent(EntityHandle entity, ComponentTypeIndex type, uint16_t componentSize, void* dtor)
600{

Callers

nothing calls this directly

Calls 5

GetEntityWorldFunction · 0.85
GetOrAddEntityChangeMethod · 0.80
DeferredMethod · 0.80
AllocateMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected