| 764 | componentTypeMap[castableTypeID].erase_first_unsorted( pair.m_pComponent ); |
| 765 | } |
| 766 | #endif |
| 767 | } |
| 768 | |
| 769 | // Add to type tracking table |
| 770 | for ( auto const& pair : componentsToRegister ) |
| 771 | { |
| 772 | pair.m_pComponent->m_isRegisteredWithWorld = true; |
| 773 | |
| 774 | #if EE_DEVELOPMENT_TOOLS |
| 775 | EntityComponentTypeMap& componentTypeMap = *initializationContext.m_pComponentTypeMap; |
| 776 | auto const castableTypeIDs = initializationContext.m_pTypeRegistry->GetAllCastableTypes( pair.m_pComponent ); |
| 777 | for ( auto castableTypeID : castableTypeIDs ) |
| 778 | { |
| 779 | componentTypeMap[castableTypeID].emplace_back( pair.m_pComponent ); |
| 780 | } |
| 781 | #endif |
| 782 | } |
| 783 | } |
| 784 | } |
| 785 | |
| 786 | //------------------------------------------------------------------------- |
| 787 | |
| 788 | bool EntityMap::UpdateLoadingAndStateChanges( LoadingContext const& loadingContext, InitializationContext& initializationContext ) |
| 789 | { |
| 790 | EE_PROFILE_SCOPE_ENTITY( "Map State Update" ); |
| 791 | EE_ASSERT( Threading::IsMainThread() && loadingContext.IsValid() && initializationContext.IsValid() ); |
| 792 | |
| 793 | #if EE_DEVELOPMENT_TOOLS |
| 794 | EE_ASSERT( m_entitiesToHotReload.empty() ); |
| 795 | EE_ASSERT( m_editedEntities.empty() ); // You are missing a EndComponentEdit call somewhere! |
| 796 | #endif |
| 797 | |
| 798 | //------------------------------------------------------------------------- |
| 799 | |
| 800 | Threading::RecursiveScopeLock lock( m_mutex ); |
| 801 | |
| 802 | //------------------------------------------------------------------------- |
| 803 | |
| 804 | switch ( m_status ) |
| 805 | { |
| 806 | case Status::Unloading: |
| 807 | { |
| 808 | ProcessMapUnloading( loadingContext, initializationContext ); |
| 809 | } |
| 810 | break; |
| 811 | |
| 812 | case Status::Loading: |
| 813 | { |
| 814 | ProcessMapLoading( loadingContext ); |
| 815 | } |
| 816 | break; |
| 817 | |
| 818 | default: |
| 819 | break; |
| 820 | } |
| 821 | |
| 822 | // Process entity removal requests |
| 823 | //------------------------------------------------------------------------- |
no test coverage detected