tsforestitem and forestitem

This commit is contained in:
marauder2k7 2025-06-19 17:24:43 +01:00
parent 08f52cfa16
commit 9208cdfcd6
3 changed files with 19 additions and 18 deletions

View file

@ -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() )