mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
crashfix work for hot-editing shape assets tied to tsstatics
This commit is contained in:
parent
cc6bf16d95
commit
3ace31c68c
|
|
@ -151,7 +151,7 @@ public:
|
|||
static U32 getAssetById(StringTableEntry assetId, AssetPtr<ImageAsset>* imageAsset);
|
||||
static U32 getAssetById(String assetId, AssetPtr<ImageAsset>* imageAsset) { return getAssetById(assetId.c_str(), imageAsset); };
|
||||
|
||||
U32 load();
|
||||
U32 load() override;
|
||||
|
||||
protected:
|
||||
void initializeAsset(void) override;
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ public:
|
|||
void setBakedSceneFile(const char* pBakedSceneFile);
|
||||
inline StringTableEntry getBakedSceneFile(void) const { return mBakedSceneFile; };
|
||||
|
||||
SimObjectId load();
|
||||
U32 load() override { return Ok; };
|
||||
|
||||
protected:
|
||||
static bool setLevelFile(void *obj, const char *index, const char *data) { static_cast<LevelAsset*>(obj)->setLevelFile(data); return false; }
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ public:
|
|||
static void initPersistFields();
|
||||
void copyTo(SimObject* object) override;
|
||||
|
||||
U32 load();
|
||||
U32 load() override;
|
||||
|
||||
StringTableEntry getMaterialDefinitionName() { return mMatDefinitionName; }
|
||||
SimObjectPtr<Material> getMaterialDefinition() { return mMaterialDefinition; }
|
||||
|
|
|
|||
|
|
@ -304,8 +304,6 @@ void ShapeAsset::_onResourceChanged(const Torque::Path &path)
|
|||
return;
|
||||
|
||||
refreshAsset();
|
||||
|
||||
onAssetRefresh();
|
||||
}
|
||||
|
||||
U32 ShapeAsset::load()
|
||||
|
|
@ -534,6 +532,9 @@ void ShapeAsset::onAssetRefresh(void)
|
|||
// Update.
|
||||
if(!Platform::isFullPath(mFileName))
|
||||
mFilePath = getOwned() ? expandAssetFilePath(mFileName) : mFilePath;
|
||||
|
||||
load();
|
||||
//onAssetRefresh();
|
||||
}
|
||||
|
||||
void ShapeAsset::SplitSequencePathAndName(String& srcPath, String& srcName)
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ public:
|
|||
/// Declare Console Object.
|
||||
DECLARE_CONOBJECT(ShapeAsset);
|
||||
|
||||
U32 load();
|
||||
U32 load() override;
|
||||
|
||||
TSShape* getShape() { return mShape; }
|
||||
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ public:
|
|||
DECLARE_CONOBJECT(SoundAsset);
|
||||
|
||||
static bool _setSoundFile(void* object, const char* index, const char* data);
|
||||
U32 load();
|
||||
U32 load() override;
|
||||
inline StringTableEntry getSoundPath(const U32 slotId = 0) const { return mSoundPath[slotId]; };
|
||||
SFXProfile* getSfxProfile(const U32 slotId = 0) { return &mSFXProfile[slotId]; }
|
||||
SFXPlayList* getSfxPlaylist() { return &mPlaylist; }
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ public:
|
|||
|
||||
inline Resource<TerrainFile> getTerrainResource(void) const { return mTerrainFile; };
|
||||
|
||||
U32 load();
|
||||
U32 load() override;
|
||||
|
||||
static bool getAssetByFilename(StringTableEntry fileName, AssetPtr<TerrainAsset>* shapeAsset);
|
||||
static StringTableEntry getAssetIdByFilename(StringTableEntry fileName);
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ public:
|
|||
static void initPersistFields();
|
||||
void copyTo(SimObject* object) override;
|
||||
|
||||
U32 load();
|
||||
U32 load() override;
|
||||
|
||||
StringTableEntry getMaterialDefinitionName() { return mMatDefinitionName; }
|
||||
SimObjectPtr<TerrainMaterial> getMaterialDefinition() { return mMaterialDefinition; }
|
||||
|
|
|
|||
|
|
@ -389,7 +389,7 @@ bool TSStatic::_createShape()
|
|||
SAFE_DELETE(mPhysicsRep);
|
||||
SAFE_DELETE(mShapeInstance);
|
||||
mAmbientThread = NULL;
|
||||
mShape = NULL;
|
||||
//mShape = NULL;
|
||||
|
||||
U32 assetStatus = ShapeAsset::getAssetErrCode(mShapeAsset);
|
||||
if (assetStatus == AssetBase::Ok || assetStatus == AssetBase::UsingFallback)
|
||||
|
|
@ -619,6 +619,9 @@ void TSStatic::onShapeChanged()
|
|||
{
|
||||
_createShape();
|
||||
_updateShouldTick();
|
||||
|
||||
if (isServerObject())
|
||||
setMaskBits(AdvancedStaticOptionsMask);
|
||||
}
|
||||
|
||||
void TSStatic::setSkinName(const char* name)
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ public:
|
|||
return mErrCodeStrings[errCode];
|
||||
};
|
||||
U32 getStatus() { return mLoadedState; };
|
||||
U32 load() { return NotLoaded; };
|
||||
virtual U32 load() { return NotLoaded; };
|
||||
AssetBase();
|
||||
virtual ~AssetBase();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue