| 178 | //----------------------------------------------------------------------------- |
| 179 | |
| 180 | StringTableEntry AssetBase::expandAssetFilePath(const char* pAssetFilePath) const |
| 181 | { |
| 182 | // Debug Profiling. |
| 183 | PROFILE_SCOPE(AssetBase_ExpandAssetFilePath); |
| 184 | |
| 185 | // Sanity! |
| 186 | AssertFatal(pAssetFilePath != NULL, "Cannot expand a NULL asset path."); |
| 187 | |
| 188 | // Fetch asset file-path length. |
| 189 | const U32 assetFilePathLength = dStrlen(pAssetFilePath); |
| 190 | |
| 191 | // Are there any characters in the path? |
| 192 | if (assetFilePathLength == 0) |
| 193 | { |
| 194 | // No, so return empty. |
| 195 | return StringTable->EmptyString(); |
| 196 | } |
| 197 | |
| 198 | // Fetch the asset base-path hint. |
| 199 | StringTableEntry assetBasePathHint; |
| 200 | if (getOwned() && !getAssetPrivate()) |
| 201 | { |
| 202 | assetBasePathHint = mpOwningAssetManager->getAssetPath(getAssetId()); |
| 203 | } |
| 204 | else |
| 205 | { |
| 206 | assetBasePathHint = NULL; |
| 207 | } |
| 208 | |
| 209 | // Expand the path with the asset base-path hint. |
| 210 | char assetFilePathBuffer[1024]; |
| 211 | Con::expandPath(assetFilePathBuffer, sizeof(assetFilePathBuffer), pAssetFilePath, assetBasePathHint); |
| 212 | return StringTable->insert(assetFilePathBuffer); |
| 213 | } |
| 214 | |
| 215 | //----------------------------------------------------------------------------- |
| 216 |
nothing calls this directly
no test coverage detected