MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / isAssetDependedOn

Method isAssetDependedOn

Engine/source/assets/assetManager.cpp:739–769  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

737//-----------------------------------------------------------------------------
738
739bool AssetManager::isAssetDependedOn( const char* pAssetId, const char* pDependedOnByAssetId )
740{
741 // Debug Profiling.
742 PROFILE_SCOPE(AssetManager_IsAssetDependedOn);
743
744 // Sanity!
745 AssertFatal( pAssetId != NULL, "Cannot use NULL asset Id." );
746 AssertFatal( pDependedOnByAssetId != NULL, "Cannot use NULL depended-on-by asset Id." );
747
748 // Fetch asset Id.
749 StringTableEntry assetId = StringTable->insert( pAssetId );
750
751 // Fetch depended-on-by asset Id.
752 StringTableEntry dependedOnByAssetId = StringTable->insert( pDependedOnByAssetId );
753
754 // Find depended-on-by entry.
755 typeAssetDependsOnHash::Iterator dependedOnItr = mAssetIsDependedOn.find(assetId);
756
757 // Iterate all dependencies.
758 while( dependedOnItr != mAssetIsDependedOn.end() && dependedOnItr->key == assetId )
759 {
760 // Finish if depended-on.
761 if ( dependedOnItr->value == dependedOnByAssetId )
762 return true;
763
764 // Next dependency.
765 dependedOnItr++;
766 }
767
768 return false;
769}
770
771//-----------------------------------------------------------------------------
772

Callers

nothing calls this directly

Calls 3

insertMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected