Merge pull request #545 from Areloch/AssetFileCaseSensitivityFix

Enforces filename string case sensitivity for assets' internal filenames
This commit is contained in:
Brian Roberts 2021-08-23 19:22:22 -05:00 committed by GitHub
commit 0a150e342f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 109 additions and 102 deletions

View file

@ -188,10 +188,9 @@ void ShapeAsset::initializeAsset()
ResourceManager::get().getChangedSignal().notify(this, &ShapeAsset::_onResourceChanged);
//Ensure our path is expando'd if it isn't already
if (!Platform::isFullPath(mFilePath))
mFilePath = getOwned() ? expandAssetFilePath(mFileName) : mFilePath;
mFilePath = getOwned() ? expandAssetFilePath(mFileName) : mFilePath;
mConstructorFilePath = expandAssetFilePath(mConstructorFilePath);
mConstructorFilePath = getOwned() ? expandAssetFilePath(mConstructorFilePath) : mConstructorFilePath;
loadShape();
}
@ -202,13 +201,13 @@ void ShapeAsset::setShapeFile(const char* pShapeFile)
AssertFatal(pShapeFile != NULL, "Cannot use a NULL shape file.");
// Fetch image file.
pShapeFile = StringTable->insert(pShapeFile);
pShapeFile = StringTable->insert(pShapeFile, true);
// Ignore no change,
if (pShapeFile == mFileName)
return;
mFileName = pShapeFile;
mFileName = getOwned() ? expandAssetFilePath(pShapeFile) : pShapeFile;
// Refresh the asset.
refreshAsset();
@ -220,13 +219,13 @@ void ShapeAsset::setShapeConstructorFile(const char* pShapeConstructorFile)
AssertFatal(pShapeConstructorFile != NULL, "Cannot use a NULL shape constructor file.");
// Fetch image file.
pShapeConstructorFile = StringTable->insert(pShapeConstructorFile);
pShapeConstructorFile = StringTable->insert(pShapeConstructorFile, true);
// Ignore no change,
if (pShapeConstructorFile == mConstructorFileName)
return;
mConstructorFileName = pShapeConstructorFile;
mConstructorFileName = getOwned() ? expandAssetFilePath(pShapeConstructorFile) : pShapeConstructorFile;
// Refresh the asset.
refreshAsset();