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

Method GetOrAddComponentChanges

BG3Extender/GameDefinitions/EntitySystem.cpp:373–386  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

371}
372
373ImmediateWorldCache::ComponentChanges* ImmediateWorldCache::Changes::GetOrAddComponentChanges(ComponentTypeEntry const* type, FrameAllocator* allocator)
374{
375 auto typeIdx = (uint16_t)type->TypeId;
376 auto components = ComponentsByType + typeIdx;
377 if (!AvailableComponentTypes[typeIdx]) {
378 AvailableComponentTypes.AtomicSet(typeIdx);
379 new (components) ComponentChanges(allocator);
380 components->FrameStorage.ComponentTypeId = type->TypeId;
381 components->FrameStorage.ComponentSizeInBytes = type->InlineSize;
382 components->FrameStorage.DestructorProc = type->DtorProc;
383 }
384
385 return components;
386}
387
388ImmediateWorldCache::ComponentChanges* ImmediateWorldCache::GetOrAddComponentChanges(ComponentTypeIndex type)
389{

Callers

nothing calls this directly

Calls 2

AtomicSetMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected