| 196 | //----------------------------------------------------------------------------- |
| 197 | |
| 198 | StringTableEntry AssetBase::expandAssetFilePath(const char* pAssetFilePath) const |
| 199 | { |
| 200 | // Debug Profiling. |
| 201 | PROFILE_SCOPE(AssetBase_ExpandAssetFilePath); |
| 202 | |
| 203 | // Sanity! |
| 204 | AssertFatal(pAssetFilePath != NULL, "Cannot expand a NULL asset path."); |
| 205 | |
| 206 | // Fetch asset file-path length. |
| 207 | const U32 assetFilePathLength = dStrlen(pAssetFilePath); |
| 208 | |
| 209 | // Are there any characters in the path? |
| 210 | if (assetFilePathLength == 0) |
| 211 | { |
| 212 | // No, so return empty. |
| 213 | return StringTable->EmptyString(); |
| 214 | } |
| 215 | |
| 216 | // Fetch the asset base-path hint. |
| 217 | StringTableEntry assetBasePathHint; |
| 218 | if (getOwned() && !getAssetPrivate()) |
| 219 | { |
| 220 | assetBasePathHint = mpOwningAssetManager->getAssetPath(getAssetId()); |
| 221 | } |
| 222 | else |
| 223 | { |
| 224 | assetBasePathHint = NULL; |
| 225 | } |
| 226 | |
| 227 | // Expand the path with the asset base-path hint. |
| 228 | char assetFilePathBuffer[1024]; |
| 229 | Con::expandPath(assetFilePathBuffer, sizeof(assetFilePathBuffer), pAssetFilePath, assetBasePathHint); |
| 230 | return StringTable->insert(assetFilePathBuffer); |
| 231 | } |
| 232 | |
| 233 | //----------------------------------------------------------------------------- |
| 234 |
nothing calls this directly
no test coverage detected