mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-06 14:00:39 +00:00
tsforestitem and forestitem
This commit is contained in:
parent
08f52cfa16
commit
9208cdfcd6
3 changed files with 19 additions and 18 deletions
|
|
@ -99,13 +99,13 @@ void TSForestItemData::inspectPostApply()
|
|||
|
||||
void TSForestItemData::_onResourceChanged( const Torque::Path &path )
|
||||
{
|
||||
U32 assetStatus = ShapeAsset::getAssetErrCode(mShapeAsset);
|
||||
U32 assetStatus = ShapeAsset::getAssetErrCode(_getShapeAssetId());
|
||||
if (assetStatus != AssetBase::Ok && assetStatus != AssetBase::UsingFallback)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( path != Path(mShapeAsset->getShapeFilePath()) )
|
||||
if ( path != Path(getShapeFile()) )
|
||||
return;
|
||||
|
||||
SAFE_DELETE( mShapeInstance );
|
||||
|
|
@ -116,18 +116,18 @@ void TSForestItemData::_onResourceChanged( const Torque::Path &path )
|
|||
|
||||
void TSForestItemData::_loadShape()
|
||||
{
|
||||
U32 assetStatus = ShapeAsset::getAssetErrCode(mShapeAsset);
|
||||
mShape = getShape();
|
||||
U32 assetStatus = ShapeAsset::getAssetErrCode(_getShapeAssetId());
|
||||
if (assetStatus != AssetBase::Ok && assetStatus != AssetBase::UsingFallback)
|
||||
{
|
||||
return;
|
||||
}
|
||||
_setShape(mShapeAssetId);
|
||||
|
||||
if ( !(bool)mShape )
|
||||
return;
|
||||
|
||||
if ( mIsClientObject &&
|
||||
!mShape->preloadMaterialList(mShapeAsset->getShapeFilePath()) )
|
||||
!mShape->preloadMaterialList(mShape.getPath()) )
|
||||
return;
|
||||
|
||||
// Lets add an autobillboard detail if don't have one.
|
||||
|
|
@ -165,7 +165,7 @@ TSShapeInstance* TSForestItemData::_getShapeInstance() const
|
|||
|
||||
void TSForestItemData::_checkLastDetail()
|
||||
{
|
||||
U32 assetStatus = ShapeAsset::getAssetErrCode(mShapeAsset);
|
||||
U32 assetStatus = ShapeAsset::getAssetErrCode(_getShapeAssetId());
|
||||
if (assetStatus != AssetBase::Ok && assetStatus != AssetBase::UsingFallback)
|
||||
{
|
||||
return;
|
||||
|
|
@ -177,7 +177,7 @@ void TSForestItemData::_checkLastDetail()
|
|||
// TODO: Expose some real parameters to the datablock maybe?
|
||||
if ( detail->subShapeNum != -1 )
|
||||
{
|
||||
mShape->addImposter(mShapeAsset->getShapeFilePath(), 10, 4, 0, 0, 256, 0, 0 );
|
||||
mShape->addImposter(mShape.getPath(), 10, 4, 0, 0, 256, 0, 0);
|
||||
|
||||
// HACK: If i don't do this it crashes!
|
||||
while ( mShape->detailCollisionAccelerators.size() < mShape->details.size() )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue