Enforces filename string case sensitivity for assets' internal filenames, which avoids the stringtable messing with the case preventing file name case sensitivity issues.

This commit is contained in:
Areloch 2021-08-21 23:12:37 -05:00
parent c04f3ae166
commit cfe122f714
18 changed files with 109 additions and 102 deletions

View file

@ -296,21 +296,15 @@ void ImageAsset::loadImage()
void ImageAsset::initializeAsset()
{
if (mImageFileName == StringTable->insert("z.png"))
{
Con::printf("Loaded z");
}
ResourceManager::get().getChangedSignal().notify(this, &ImageAsset::_onResourceChanged);
mImagePath = expandAssetFilePath(mImageFileName);
mImagePath = getOwned() ? expandAssetFilePath(mImageFileName) : mImagePath;
loadImage();
}
void ImageAsset::onAssetRefresh()
{
mImagePath = expandAssetFilePath(mImageFileName);
mImagePath = getOwned() ? expandAssetFilePath(mImageFileName) : mImagePath;
loadImage();
}
@ -321,7 +315,7 @@ void ImageAsset::_onResourceChanged(const Torque::Path& path)
refreshAsset();
loadImage();
//loadImage();
}
void ImageAsset::setImageFileName(const char* pScriptFile)
@ -330,7 +324,10 @@ void ImageAsset::setImageFileName(const char* pScriptFile)
AssertFatal(pScriptFile != NULL, "Cannot use a NULL image file.");
// Update.
mImageFileName = StringTable->insert(pScriptFile);
mImageFileName = StringTable->insert(pScriptFile, true);
// Refresh the asset.
refreshAsset();
}
const GBitmap& ImageAsset::getImage()