mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-06 05:50:31 +00:00
Merge pull request #433 from Azaezel/alpha40/shapeAssetErrorFollowups
moar asset errorhandling
This commit is contained in:
commit
03e6b5b096
1 changed files with 9 additions and 5 deletions
|
|
@ -274,7 +274,7 @@ bool ShapeAsset::loadShape()
|
|||
|
||||
if (!mShape)
|
||||
{
|
||||
Con::errorf("ShapeAsset::loadShape : failed to load shape file!");
|
||||
Con::errorf("ShapeAsset::loadShape : failed to load shape file %s (%s)!", getAssetName(), mFilePath);
|
||||
mLoadedState = BadFileReference;
|
||||
return false; //if it failed to load, bail out
|
||||
}
|
||||
|
|
@ -437,12 +437,16 @@ U32 ShapeAsset::getAssetById(StringTableEntry assetId, AssetPtr<ShapeAsset>* sha
|
|||
if ((*shapeAsset))
|
||||
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())
|
||||
{
|
||||
//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;
|
||||
return AssetErrCode::UsingFallback;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue