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

Method getAssetPath

Engine/source/assets/assetManager.cpp:583–603  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

581//-----------------------------------------------------------------------------
582
583StringTableEntry AssetManager::getAssetPath( const char* pAssetId )
584{
585 // Debug Profiling.
586 PROFILE_SCOPE(AssetManager_GetAssetPath);
587
588 // Fetch asset file-path.
589 StringTableEntry assetFilePath = getAssetFilePath( pAssetId );
590
591 // Finish if no file-path.
592 if ( assetFilePath == StringTable->EmptyString() )
593 return assetFilePath;
594
595 // Find the final slash which should be just before the file.
596 const char* pFinalSlash = dStrrchr( assetFilePath, '/' );
597
598 // Sanity!
599 AssertFatal( pFinalSlash != NULL, "Should always be able to find final slash in the asset file-path." );
600
601 // Fetch asset path.
602 return StringTable->insertn( assetFilePath, (U32)(pFinalSlash - assetFilePath) );
603}
604
605//-----------------------------------------------------------------------------
606

Callers 3

expandAssetFilePathMethod · 0.80
collapseAssetFilePathMethod · 0.80

Calls 3

EmptyStringMethod · 0.80
insertnMethod · 0.80
dStrrchrFunction · 0.50

Tested by

no test coverage detected