| 581 | //----------------------------------------------------------------------------- |
| 582 | |
| 583 | StringTableEntry 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 |
no test coverage detected