mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
Merge pull request #1515 from Azaezel/alpha41/preLoad
try to load shapes during preload
This commit is contained in:
commit
5c9e34a90c
18 changed files with 63 additions and 71 deletions
|
|
@ -122,7 +122,7 @@ public:
|
||||||
|
|
||||||
U32 load() override;
|
U32 load() override;
|
||||||
|
|
||||||
TSShape* getShape() { return mShape; }
|
TSShape* getShape() { load(); return mShape; }
|
||||||
|
|
||||||
Resource<TSShape> getShapeResource() { load(); return mShape; }
|
Resource<TSShape> getShapeResource() { load(); return mShape; }
|
||||||
|
|
||||||
|
|
@ -295,7 +295,7 @@ public:
|
||||||
}; \
|
}; \
|
||||||
\
|
\
|
||||||
inline StringTableEntry _get##name##AssetId(void) const { return m##name##Asset.getAssetId(); } \
|
inline StringTableEntry _get##name##AssetId(void) const { return m##name##Asset.getAssetId(); } \
|
||||||
Resource<TSShape> get##name() { if (m##name##Asset.notNull()) return m##name##Asset->getShapeResource(); else return ResourceManager::get().load( "" ); } \
|
TSShape* get##name() { if (m##name##Asset.notNull()) return m##name##Asset->getShape(); else return NULL; } \
|
||||||
AssetPtr<ShapeAsset> get##name##Asset(void) { return m##name##Asset; } \
|
AssetPtr<ShapeAsset> get##name##Asset(void) { return m##name##Asset; } \
|
||||||
static bool _set##name##Data(void* obj, const char* index, const char* data) { static_cast<className*>(obj)->_set##name(_getStringTable()->insert(data)); return false; } \
|
static bool _set##name##Data(void* obj, const char* index, const char* data) { static_cast<className*>(obj)->_set##name(_getStringTable()->insert(data)); return false; } \
|
||||||
StringTableEntry get##name##File() { return m##name##Asset.notNull() ? m##name##Asset->getShapeFile() : ""; }
|
StringTableEntry get##name##File() { return m##name##Asset.notNull() ? m##name##Asset->getShapeFile() : ""; }
|
||||||
|
|
@ -353,12 +353,12 @@ public:
|
||||||
}; \
|
}; \
|
||||||
\
|
\
|
||||||
inline StringTableEntry _get##name##AssetId(void) const { return m##name##Asset.getAssetId(); } \
|
inline StringTableEntry _get##name##AssetId(void) const { return m##name##Asset.getAssetId(); } \
|
||||||
Resource<TSShape> get##name() { if (m##name##Asset.notNull()) return m##name##Asset->getShapeResource(); else return ResourceManager::get().load( "" ); } \
|
TSShape* get##name() { if (m##name##Asset.notNull()) return m##name##Asset->getShape(); else return NULL; } \
|
||||||
AssetPtr<ShapeAsset> get##name##Asset(void) { return m##name##Asset; } \
|
AssetPtr<ShapeAsset> get##name##Asset(void) { return m##name##Asset; } \
|
||||||
static bool _set##name##Data(void* obj, const char* index, const char* data) { static_cast<className*>(obj)->_set##name(_getStringTable()->insert(data)); return false; } \
|
static bool _set##name##Data(void* obj, const char* index, const char* data) { static_cast<className*>(obj)->_set##name(_getStringTable()->insert(data)); return false; } \
|
||||||
StringTableEntry get##name##File() { return m##name##Asset.notNull() ? m##name##Asset->getShapeFile() : ""; }
|
StringTableEntry get##name##File() { return m##name##Asset.notNull() ? m##name##Asset->getShapeFile() : ""; }
|
||||||
|
|
||||||
#define INITPERSISTFIELD_SHAPEASSET_REFACTOR(name, consoleClass, docs) \
|
#define INITPERSISTFIELD_SHAPEASSET_REFACTOR(name, consoleClass, docs) \
|
||||||
addProtectedField(assetText(name, Asset), TypeShapeAssetPtr, Offset(m##name##Asset, consoleClass), _set##name##Data, &defaultProtectedGetFn, assetDoc(name, asset docs.)); \
|
addProtectedField(assetText(name, Asset), TypeShapeAssetPtr, Offset(m##name##Asset, consoleClass), _set##name##Data, &defaultProtectedGetFn, assetDoc(name, asset docs.)); \
|
||||||
addProtectedField(assetText(name, File), TypeFilename, Offset(m##name##File, consoleClass), _set##name##Data, &defaultProtectedGetFn, assetDoc(name, file docs.));
|
addProtectedField(assetText(name, File), TypeFilename, Offset(m##name##File, consoleClass), _set##name##Data, &defaultProtectedGetFn, assetDoc(name, file docs.));
|
||||||
|
|
||||||
|
|
@ -414,7 +414,7 @@ public:
|
||||||
}; \
|
}; \
|
||||||
\
|
\
|
||||||
inline StringTableEntry _get##name##AssetId(const U32& index) const { return m##name##Asset[index].getAssetId(); } \
|
inline StringTableEntry _get##name##AssetId(const U32& index) const { return m##name##Asset[index].getAssetId(); } \
|
||||||
Resource<TSShape> get##name(const U32& index) { if (m##name##Asset[index].notNull()) return m##name##Asset[index]->getShapeResource(); else return ResourceManager::get().load( "" ); } \
|
TSShape* get##name(const U32& index) { if (m##name##Asset[index].notNull()) return m##name##Asset[index]->getShape(); else return NULL; } \
|
||||||
AssetPtr<ShapeAsset> get##name##Asset(const U32& index) { return m##name##Asset[index]; } \
|
AssetPtr<ShapeAsset> get##name##Asset(const U32& index) { return m##name##Asset[index]; } \
|
||||||
static bool _set##name##Data(void* obj, const char* index, const char* data) { static_cast<className*>(obj)->_set##name(_getStringTable()->insert(data), dAtoi(index)); return false;}\
|
static bool _set##name##Data(void* obj, const char* index, const char* data) { static_cast<className*>(obj)->_set##name(_getStringTable()->insert(data), dAtoi(index)); return false;}\
|
||||||
StringTableEntry get##name##File(const U32& idx) { return m##name##Asset[idx].notNull() ? m##name##Asset[idx]->getShapeFile() : ""; }
|
StringTableEntry get##name##File(const U32& idx) { return m##name##Asset[idx].notNull() ? m##name##Asset[idx]->getShapeFile() : ""; }
|
||||||
|
|
@ -472,7 +472,7 @@ public:
|
||||||
}; \
|
}; \
|
||||||
\
|
\
|
||||||
inline StringTableEntry _get##name##AssetId(const U32& index) const { return m##name##Asset[index].getAssetId(); } \
|
inline StringTableEntry _get##name##AssetId(const U32& index) const { return m##name##Asset[index].getAssetId(); } \
|
||||||
Resource<TSShape> get##name(const U32& index) { if (m##name##Asset[index].notNull()) return m##name##Asset[index]->getShapeResource(); else return ResourceManager::get().load( "" ); } \
|
TSShape* get##name(const U32& index) { if (m##name##Asset[index].notNull()) return m##name##Asset[index]->getShape(); else return NULL; } \
|
||||||
AssetPtr<ShapeAsset> get##name##Asset(const U32& index) { return m##name##Asset[index]; } \
|
AssetPtr<ShapeAsset> get##name##Asset(const U32& index) { return m##name##Asset[index]; } \
|
||||||
static bool _set##name##Data(void* obj, const char* index, const char* data) { static_cast<className*>(obj)->_set##name(_getStringTable()->insert(data), dAtoi(index)); return false;}\
|
static bool _set##name##Data(void* obj, const char* index, const char* data) { static_cast<className*>(obj)->_set##name(_getStringTable()->insert(data), dAtoi(index)); return false;}\
|
||||||
StringTableEntry get##name##File(const U32& idx) { return m##name##Asset[idx].notNull() ? m##name##Asset[idx]->getShapeFile() : ""; }
|
StringTableEntry get##name##File(const U32& idx) { return m##name##Asset[idx].notNull() ? m##name##Asset[idx]->getShapeFile() : ""; }
|
||||||
|
|
|
||||||
|
|
@ -274,21 +274,20 @@ bool DebrisData::preload(bool server, String &errorStr)
|
||||||
|
|
||||||
if( server ) return true;
|
if( server ) return true;
|
||||||
|
|
||||||
if (mShapeAsset.notNull())
|
if (getShape())
|
||||||
{
|
{
|
||||||
if (!getShape())
|
|
||||||
{
|
|
||||||
errorStr = String::ToString("DebrisData::load: Couldn't load shape \"%s\"", _getShapeAssetId());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
TSShapeInstance* pDummy = new TSShapeInstance(getShape(), !server);
|
TSShapeInstance* pDummy = new TSShapeInstance(getShape(), !server);
|
||||||
delete pDummy;
|
delete pDummy;
|
||||||
if (!server && !getShape()->preloadMaterialList(getShape().getPath()) && NetConnection::filesWereDownloaded())
|
if (!server && !getShape()->preloadMaterialList(getShapeFile()) && NetConnection::filesWereDownloaded())
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
errorStr = String::ToString("DebrisData::load: Couldn't load shape \"%s\"", _getShapeAssetId());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -191,7 +191,7 @@ void RenderShapeExample::createShape()
|
||||||
|
|
||||||
// Attempt to preload the Materials for this shape
|
// Attempt to preload the Materials for this shape
|
||||||
if ( isClientObject() &&
|
if ( isClientObject() &&
|
||||||
!getShape()->preloadMaterialList(getShape().getPath() ) &&
|
!getShape()->preloadMaterialList(getShapeFile()) &&
|
||||||
NetConnection::filesWereDownloaded() )
|
NetConnection::filesWereDownloaded() )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -896,7 +896,7 @@ bool ExplosionData::preload(bool server, String &errorStr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mExplosionShapeAsset.notNull()) {
|
if (getExplosionShape()) {
|
||||||
|
|
||||||
// Resolve animations
|
// Resolve animations
|
||||||
explosionAnimation = getExplosionShape()->findSequence("ambient");
|
explosionAnimation = getExplosionShape()->findSequence("ambient");
|
||||||
|
|
|
||||||
|
|
@ -889,7 +889,7 @@ void GroundCover::_initShapes()
|
||||||
if ( mShapeAsset[i].isNull() || getShape(i) == nullptr)
|
if ( mShapeAsset[i].isNull() || getShape(i) == nullptr)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if ( isClientObject() && !getShape(i)->preloadMaterialList(getShape(i).getPath()) && NetConnection::filesWereDownloaded() )
|
if ( isClientObject() && !getShape(i)->preloadMaterialList(getShapeFile(i)) && NetConnection::filesWereDownloaded() )
|
||||||
{
|
{
|
||||||
Con::warnf( "GroundCover::_initShapes() material preload failed for shape: %s", _getShapeAssetId(i));
|
Con::warnf( "GroundCover::_initShapes() material preload failed for shape: %s", _getShapeAssetId(i));
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
|
|
@ -345,7 +345,7 @@ bool GuiObjectView::setObjectModel( const String& modelName )
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!getModel()->preloadMaterialList(getModel().getPath())) return false;
|
if (!getModel()->preloadMaterialList(getModelFile())) return false;
|
||||||
|
|
||||||
// Instantiate it.
|
// Instantiate it.
|
||||||
|
|
||||||
|
|
@ -398,7 +398,7 @@ bool GuiObjectView::setMountedObject( const String& modelName )
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!getMountedModel()->preloadMaterialList(getMountedModel().getPath())) return false;
|
if (!getMountedModel()->preloadMaterialList(getMountedModelFile())) return false;
|
||||||
|
|
||||||
mMountedModelInstance = new TSShapeInstance(getMountedModel(), true);
|
mMountedModelInstance = new TSShapeInstance(getMountedModel(), true);
|
||||||
mMountedModelInstance->resetMaterialList();
|
mMountedModelInstance->resetMaterialList();
|
||||||
|
|
|
||||||
|
|
@ -274,10 +274,10 @@ class GuiObjectView : public GuiTSCtrl, protected AssetPtrCallback
|
||||||
protected:
|
protected:
|
||||||
void onAssetRefreshed(AssetPtrBase* pAssetPtrBase) override
|
void onAssetRefreshed(AssetPtrBase* pAssetPtrBase) override
|
||||||
{
|
{
|
||||||
if (mModelAsset.notNull())
|
if (getModel())
|
||||||
setObjectModel(_getModelAssetId());
|
setObjectModel(_getModelAssetId());
|
||||||
|
|
||||||
if (mMountedModelAsset.notNull())
|
if (getMountedModel())
|
||||||
setMountedObject(_getMountedModelAssetId());
|
setMountedObject(_getMountedModelAssetId());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ bool PhysicsDebrisData::preload( bool server, String &errorStr )
|
||||||
|
|
||||||
if ( server ) return true;
|
if ( server ) return true;
|
||||||
|
|
||||||
if ( mShapeAsset.notNull() )
|
if ( getShape() )
|
||||||
{
|
{
|
||||||
// Create a dummy shape to force the generation of shaders and materials
|
// Create a dummy shape to force the generation of shaders and materials
|
||||||
// during the level load and not during gameplay.
|
// during the level load and not during gameplay.
|
||||||
|
|
|
||||||
|
|
@ -285,16 +285,15 @@ bool PhysicsShapeData::preload( bool server, String &errorBuffer )
|
||||||
|
|
||||||
bool shapeError = false;
|
bool shapeError = false;
|
||||||
|
|
||||||
if (mShapeAsset.notNull())
|
if (getShape())
|
||||||
{
|
{
|
||||||
if (bool(getShape()) == false)
|
if (!server && !getShape()->preloadMaterialList(getShapeFile()) && NetConnection::filesWereDownloaded())
|
||||||
{
|
|
||||||
errorBuffer = String::ToString("PhysicsShapeData: Couldn't load shape \"%s\"", _getShapeAssetId());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (!server && !getShape()->preloadMaterialList(getShape().getPath()) && NetConnection::filesWereDownloaded())
|
|
||||||
shapeError = true;
|
shapeError = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
errorBuffer = String::ToString("PhysicsShapeData: Couldn't load shape \"%s\"", _getShapeAssetId());
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prepare the shared physics collision shape.
|
// Prepare the shared physics collision shape.
|
||||||
|
|
|
||||||
|
|
@ -615,18 +615,18 @@ bool PlayerData::preload(bool server, String &errorStr)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!server && !getShapeFP(i)->preloadMaterialList(getShapeFP(i).getPath()) && NetConnection::filesWereDownloaded())
|
if (!server && !getShapeFP(i)->preloadMaterialList(getShapeFPFile(i)) && NetConnection::filesWereDownloaded())
|
||||||
shapeError = true;
|
shapeError = true;
|
||||||
|
|
||||||
if (computeCRC)
|
if (computeCRC)
|
||||||
{
|
{
|
||||||
Con::printf("Validation required for mounted image %d shape: %s", i, _getShapeFPAssetId(i));
|
Con::printf("Validation required for mounted image %d shape: %s", i, _getShapeFPAssetId(i));
|
||||||
|
|
||||||
Torque::FS::FileNodeRef fileRef = Torque::FS::GetFileNode(getShapeFP(i).getPath());
|
Torque::FS::FileNodeRef fileRef = Torque::FS::GetFileNode(getShapeFPFile(i));
|
||||||
|
|
||||||
if (!fileRef)
|
if (!fileRef)
|
||||||
{
|
{
|
||||||
errorStr = String::ToString("PlayerData: Mounted image %d loading failed, shape \"%s\" is not found.", i, getShapeFP(i).getPath().getFullPath().c_str());
|
errorStr = String::ToString("PlayerData: Mounted image %d loading failed, shape \"%s\" is not found.", i, getShapeFPFile(i));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -381,22 +381,18 @@ bool ProjectileData::preload(bool server, String &errorStr)
|
||||||
Con::errorf(ConsoleLogEntry::General, "ProjectileData::preload: Invalid packet, bad datablockid(lightDesc): %d", lightDescId);
|
Con::errorf(ConsoleLogEntry::General, "ProjectileData::preload: Invalid packet, bad datablockid(lightDesc): %d", lightDescId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mProjectileShapeAsset.notNull())
|
if (getProjectileShape())
|
||||||
{
|
{
|
||||||
//If we've got a shapeAsset assigned for our projectile, but we failed to load the shape data itself, report the error
|
activateSeq = getProjectileShape()->findSequence("activate");
|
||||||
if (!getProjectileShape())
|
maintainSeq = getProjectileShape()->findSequence("maintain");
|
||||||
{
|
|
||||||
errorStr = String::ToString("ProjectileData::load: Couldn't load shape \"%s\"", _getProjectileShapeAssetId());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
activateSeq = getProjectileShape()->findSequence("activate");
|
|
||||||
maintainSeq = getProjectileShape()->findSequence("maintain");
|
|
||||||
|
|
||||||
TSShapeInstance* pDummy = new TSShapeInstance(getProjectileShape(), !server);
|
TSShapeInstance* pDummy = new TSShapeInstance(getProjectileShape(), !server);
|
||||||
delete pDummy;
|
delete pDummy;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
errorStr = String::ToString("ProjectileData::load: Couldn't load shape \"%s\"", _getProjectileShapeAssetId());
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -343,7 +343,7 @@ bool ShapeBaseData::preload(bool server, String &errorStr)
|
||||||
"ShapeBaseData::preload: invalid debris data");
|
"ShapeBaseData::preload: invalid debris data");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mDebrisShapeAsset.notNull())
|
if(getDebrisShape())
|
||||||
{
|
{
|
||||||
TSShapeInstance* pDummy = new TSShapeInstance(getDebrisShape(), !server);
|
TSShapeInstance* pDummy = new TSShapeInstance(getDebrisShape(), !server);
|
||||||
delete pDummy;
|
delete pDummy;
|
||||||
|
|
@ -351,12 +351,13 @@ bool ShapeBaseData::preload(bool server, String &errorStr)
|
||||||
}
|
}
|
||||||
|
|
||||||
S32 i;
|
S32 i;
|
||||||
if (mShapeAsset.notNull())
|
if (getShape())
|
||||||
{
|
{
|
||||||
|
//mShapeAsset->load();
|
||||||
U32 assetStatus = ShapeAsset::getAssetErrCode(mShapeAsset);
|
U32 assetStatus = ShapeAsset::getAssetErrCode(mShapeAsset);
|
||||||
if (assetStatus == AssetBase::Ok || assetStatus == AssetBase::UsingFallback)
|
if (assetStatus == AssetBase::Ok || assetStatus == AssetBase::UsingFallback)
|
||||||
{
|
{
|
||||||
if (!server && !getShape()->preloadMaterialList(getShape().getPath()) && NetConnection::filesWereDownloaded())
|
if (!server && !getShape()->preloadMaterialList(getShapeFile()) && NetConnection::filesWereDownloaded())
|
||||||
shapeError = true;
|
shapeError = true;
|
||||||
|
|
||||||
if (computeCRC)
|
if (computeCRC)
|
||||||
|
|
|
||||||
|
|
@ -461,7 +461,7 @@ bool ShapeBaseImageData::preload(bool server, String &errorStr)
|
||||||
{
|
{
|
||||||
Con::printf("Validation required for shape asset: %s", mShapeAsset[i]->getAssetId());
|
Con::printf("Validation required for shape asset: %s", mShapeAsset[i]->getAssetId());
|
||||||
|
|
||||||
Torque::FS::FileNodeRef fileRef = Torque::FS::GetFileNode(getShape(i).getPath());
|
Torque::FS::FileNodeRef fileRef = Torque::FS::GetFileNode(getShapeFile(i));
|
||||||
|
|
||||||
if (!fileRef)
|
if (!fileRef)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -390,16 +390,10 @@ bool TSStatic::_createShape()
|
||||||
mAmbientThread = NULL;
|
mAmbientThread = NULL;
|
||||||
//mShape = NULL;
|
//mShape = NULL;
|
||||||
|
|
||||||
if (mShapeAsset.notNull())
|
if (getShape())
|
||||||
{
|
{
|
||||||
if (!getShape())
|
|
||||||
{
|
|
||||||
Con::errorf("TSStatic::_createShape() - Shape Asset %s had no valid shape!", mShapeAsset.getAssetId());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isClientObject() &&
|
if (isClientObject() &&
|
||||||
!getShape()->preloadMaterialList(getShape().getPath()) &&
|
!getShape()->preloadMaterialList(getShapeFile()) &&
|
||||||
NetConnection::filesWereDownloaded())
|
NetConnection::filesWereDownloaded())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -440,6 +434,11 @@ bool TSStatic::_createShape()
|
||||||
Sim::findObject(cubeDescId, reflectorDesc);
|
Sim::findObject(cubeDescId, reflectorDesc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Con::errorf("TSStatic::_createShape() - Shape Asset %s had no valid shape!", mShapeAsset.getAssetId());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//Set up the material slot vars for easy manipulation
|
//Set up the material slot vars for easy manipulation
|
||||||
/*S32 materialCount = mShape->materialList->getMaterialNameList().size(); //mMeshAsset->getMaterialCount();
|
/*S32 materialCount = mShape->materialList->getMaterialNameList().size(); //mMeshAsset->getMaterialCount();
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,7 @@ public:
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// variables set on preload:
|
// variables set on preload:
|
||||||
Resource<TSShape> projectileShape;
|
TSShape* projectileShape;
|
||||||
/*
|
/*
|
||||||
S32 activateSeq;
|
S32 activateSeq;
|
||||||
S32 maintainSeq;
|
S32 maintainSeq;
|
||||||
|
|
|
||||||
|
|
@ -127,14 +127,8 @@ bool afxModelData::preload(bool server, String &errorStr)
|
||||||
if (server)
|
if (server)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (mShapeAsset.notNull())
|
if (getShape())
|
||||||
{
|
{
|
||||||
if (!getShape())
|
|
||||||
{
|
|
||||||
errorStr = String::ToString("afxModelData::load: Failed to load shape \"%s\"", _getShapeAssetId());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// just parse up the string and collect the remappings in txr_tag_remappings.
|
// just parse up the string and collect the remappings in txr_tag_remappings.
|
||||||
if (remap_txr_tags != ST_NULLSTRING)
|
if (remap_txr_tags != ST_NULLSTRING)
|
||||||
{
|
{
|
||||||
|
|
@ -167,7 +161,11 @@ bool afxModelData::preload(bool server, String &errorStr)
|
||||||
delete pDummy;
|
delete pDummy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
errorStr = String::ToString("afxModelData::load: Failed to load shape \"%s\"", _getShapeAssetId());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@ public:
|
||||||
return theSignal;
|
return theSignal;
|
||||||
}
|
}
|
||||||
|
|
||||||
Resource<TSShape> mShape;
|
TSShape* mShape;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void onAssetRefreshed(AssetPtrBase* pAssetPtrBase) override
|
void onAssetRefreshed(AssetPtrBase* pAssetPtrBase) override
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@ void TSForestItemData::_loadShape()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( mIsClientObject &&
|
if ( mIsClientObject &&
|
||||||
!mShape->preloadMaterialList(mShape.getPath()) )
|
!mShape->preloadMaterialList(getShapeFile()) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Lets add an autobillboard detail if don't have one.
|
// Lets add an autobillboard detail if don't have one.
|
||||||
|
|
@ -177,7 +177,7 @@ void TSForestItemData::_checkLastDetail()
|
||||||
// TODO: Expose some real parameters to the datablock maybe?
|
// TODO: Expose some real parameters to the datablock maybe?
|
||||||
if ( detail->subShapeNum != -1 )
|
if ( detail->subShapeNum != -1 )
|
||||||
{
|
{
|
||||||
mShape->addImposter(mShape.getPath(), 10, 4, 0, 0, 256, 0, 0);
|
mShape->addImposter(getShapeFile(), 10, 4, 0, 0, 256, 0, 0);
|
||||||
|
|
||||||
// HACK: If i don't do this it crashes!
|
// HACK: If i don't do this it crashes!
|
||||||
while ( mShape->detailCollisionAccelerators.size() < mShape->details.size() )
|
while ( mShape->detailCollisionAccelerators.size() < mShape->details.size() )
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue