mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-29 16:25:42 +00:00
report shape file location that failed to load, set loaded status to badfilereference if getAssetById can't even find noshape
This commit is contained in:
parent
1fbf46fa90
commit
6495ee16c6
1 changed files with 9 additions and 5 deletions
|
|
@ -274,7 +274,7 @@ bool ShapeAsset::loadShape()
|
||||||
|
|
||||||
if (!mShape)
|
if (!mShape)
|
||||||
{
|
{
|
||||||
Con::errorf("ShapeAsset::loadShape : failed to load shape file!");
|
Con::errorf("ShapeAsset::loadShape : failed to load shape file %s!", mFilePath);
|
||||||
mLoadedState = BadFileReference;
|
mLoadedState = BadFileReference;
|
||||||
return false; //if it failed to load, bail out
|
return false; //if it failed to load, bail out
|
||||||
}
|
}
|
||||||
|
|
@ -437,12 +437,16 @@ U32 ShapeAsset::getAssetById(StringTableEntry assetId, AssetPtr<ShapeAsset>* sha
|
||||||
if ((*shapeAsset))
|
if ((*shapeAsset))
|
||||||
return (*shapeAsset)->mLoadedState;
|
return (*shapeAsset)->mLoadedState;
|
||||||
|
|
||||||
//Didn't work, so have us fall back to a placeholder asset
|
|
||||||
StringTableEntry noShapeId = StringTable->insert("Core_Rendering:noshape");
|
|
||||||
shapeAsset->setAssetId(noShapeId);
|
|
||||||
|
|
||||||
if (shapeAsset->notNull())
|
if (shapeAsset->notNull())
|
||||||
{
|
{
|
||||||
|
//Didn't work, so have us fall back to a placeholder asset
|
||||||
|
StringTableEntry noShapeId = StringTable->insert("Core_Rendering:noshape");
|
||||||
|
shapeAsset->setAssetId(noShapeId);
|
||||||
|
|
||||||
|
//handle noshape not being loaded itself
|
||||||
|
if ((*shapeAsset)->mLoadedState == BadFileReference)
|
||||||
|
return AssetErrCode::Failed;
|
||||||
|
|
||||||
(*shapeAsset)->mLoadedState = AssetErrCode::UsingFallback;
|
(*shapeAsset)->mLoadedState = AssetErrCode::UsingFallback;
|
||||||
return AssetErrCode::UsingFallback;
|
return AssetErrCode::UsingFallback;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue