mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Update ImageAsset.cpp
update getAssetIdByFilename to also check the imageFile of the asset This helps match filenames for assets created privately such as probe bakes and targets
This commit is contained in:
parent
b630442683
commit
7af992970a
1 changed files with 32 additions and 1 deletions
|
|
@ -297,7 +297,38 @@ StringTableEntry ImageAsset::getAssetIdByFilename(StringTableEntry fileName)
|
|||
}
|
||||
else
|
||||
{
|
||||
AssetPtr<ImageAsset> imageAsset = imageAssetId; //ensures the fallback is loaded
|
||||
foundAssetcount = AssetDatabase.findAssetType(&query, "ImageAsset");
|
||||
if (foundAssetcount != 0)
|
||||
{
|
||||
// loop all image assets and see if we can find one
|
||||
// using the same image file/named target.
|
||||
for (auto imgAsset : query.mAssetList)
|
||||
{
|
||||
AssetPtr<ImageAsset> temp = imgAsset;
|
||||
if (temp.notNull())
|
||||
{
|
||||
if (temp->getImageFile() == fileName)
|
||||
{
|
||||
return imgAsset;
|
||||
}
|
||||
else
|
||||
{
|
||||
Torque::Path temp1 = temp->getImageFile();
|
||||
Torque::Path temp2 = fileName;
|
||||
|
||||
if (temp1.getFileName() == temp2.getFileName())
|
||||
{
|
||||
return imgAsset;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AssetPtr<ImageAsset> imageAsset = imageAssetId; //ensures the fallback is loaded
|
||||
}
|
||||
}
|
||||
|
||||
return imageAssetId;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue