mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-23 16:43:50 +00:00
asset load refactor
genral load method, now returns loadedstate across the board
This commit is contained in:
parent
11ad16583e
commit
1cf754dbca
13 changed files with 50 additions and 68 deletions
|
|
@ -206,7 +206,7 @@ void MaterialAsset::initializeAsset()
|
|||
}
|
||||
}
|
||||
|
||||
loadMaterial();
|
||||
load();
|
||||
}
|
||||
|
||||
void MaterialAsset::onAssetRefresh()
|
||||
|
|
@ -236,7 +236,7 @@ void MaterialAsset::onAssetRefresh()
|
|||
Con::setVariable("$Con::redefineBehavior", redefineBehaviorPrev.c_str());
|
||||
}
|
||||
|
||||
loadMaterial();
|
||||
load();
|
||||
}
|
||||
|
||||
void MaterialAsset::setScriptFile(const char* pScriptFile)
|
||||
|
|
@ -255,7 +255,7 @@ void MaterialAsset::setScriptFile(const char* pScriptFile)
|
|||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void MaterialAsset::loadMaterial()
|
||||
U32 MaterialAsset::load()
|
||||
{
|
||||
if (mMaterialDefinition)
|
||||
{
|
||||
|
|
@ -274,7 +274,7 @@ void MaterialAsset::loadMaterial()
|
|||
mLoadedState = Ok;
|
||||
mMaterialDefinition->setInternalName(getAssetId());
|
||||
mMaterialDefinition->reload();
|
||||
return;
|
||||
return mLoadedState;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -286,7 +286,7 @@ void MaterialAsset::loadMaterial()
|
|||
{
|
||||
Con::errorf("MaterialAsset: Unable to find the Material %s", mMatDefinitionName);
|
||||
mLoadedState = BadFileReference;
|
||||
return;
|
||||
return mLoadedState;
|
||||
}
|
||||
|
||||
mMaterialDefinition = matDef;
|
||||
|
|
@ -294,10 +294,11 @@ void MaterialAsset::loadMaterial()
|
|||
mLoadedState = Ok;
|
||||
mMaterialDefinition->setInternalName(getAssetId());
|
||||
mMaterialDefinition->reload();
|
||||
return;
|
||||
return mLoadedState;
|
||||
}
|
||||
|
||||
mLoadedState = Failed;
|
||||
return mLoadedState;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue