mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Various fixes
This commit is contained in:
parent
60a29777fa
commit
3fa7a0d4fa
27 changed files with 171 additions and 177 deletions
|
|
@ -86,6 +86,7 @@ ConsoleSetType(TypeShapeAssetPtr)
|
|||
|
||||
ShapeAsset::ShapeAsset()
|
||||
{
|
||||
mFileName = StringTable->EmptyString();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -129,6 +130,10 @@ void ShapeAsset::initializeAsset()
|
|||
|
||||
ResourceManager::get().getChangedSignal().notify(this, &ShapeAsset::_onResourceChanged);
|
||||
|
||||
//Ensure our path is expando'd if it isn't already
|
||||
if (!Platform::isFullPath(mFileName))
|
||||
mFileName = getOwned() ? expandAssetFilePath(mFileName) : mFileName;
|
||||
|
||||
loadShape();
|
||||
}
|
||||
|
||||
|
|
@ -144,8 +149,7 @@ void ShapeAsset::setShapeFile(const char* pShapeFile)
|
|||
if (pShapeFile == mFileName)
|
||||
return;
|
||||
|
||||
// Update.
|
||||
mFileName = getOwned() ? expandAssetFilePath(pShapeFile) : StringTable->insert(pShapeFile);
|
||||
mFileName = pShapeFile;
|
||||
|
||||
// Refresh the asset.
|
||||
refreshAsset();
|
||||
|
|
@ -156,6 +160,8 @@ void ShapeAsset::_onResourceChanged(const Torque::Path &path)
|
|||
if (path != Torque::Path(mFileName) )
|
||||
return;
|
||||
|
||||
refreshAsset();
|
||||
|
||||
loadShape();
|
||||
}
|
||||
|
||||
|
|
@ -268,9 +274,13 @@ void ShapeAsset::copyTo(SimObject* object)
|
|||
|
||||
void ShapeAsset::onAssetRefresh(void)
|
||||
{
|
||||
if (dStrcmp(mFileName, "") == 0)
|
||||
if (mFileName == StringTable->EmptyString())
|
||||
return;
|
||||
|
||||
// Update.
|
||||
if(!Platform::isFullPath(mFileName))
|
||||
mFileName = getOwned() ? expandAssetFilePath(mFileName) : mFileName;
|
||||
|
||||
loadShape();
|
||||
}
|
||||
|
||||
|
|
@ -405,4 +415,4 @@ bool GuiInspectorTypeShapeAssetPtr::updateRects()
|
|||
}
|
||||
|
||||
return resized;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue