| 371 | } |
| 372 | |
| 373 | ImmediateWorldCache::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 | |
| 388 | ImmediateWorldCache::ComponentChanges* ImmediateWorldCache::GetOrAddComponentChanges(ComponentTypeIndex type) |
| 389 | { |