mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-24 05:45:40 +00:00
fix particle glow
multiple preloads were failing to return false or mesages on failure of mandatory entries. clear out redundant isScriptFile definition fix default order of /scripts/managedData script files
This commit is contained in:
parent
5d260bc58f
commit
cce40efd35
21 changed files with 250 additions and 134 deletions
|
|
@ -206,14 +206,18 @@ bool DebrisData::onAdd()
|
|||
if( Sim::findObject( emitterIDList[i], emitterList[i] ) == false)
|
||||
{
|
||||
Con::errorf( ConsoleLogEntry::General, "DebrisData::onAdd: Invalid packet, bad datablockId(emitter): 0x%x", emitterIDList[i]);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!explosion && explosionId != 0)
|
||||
{
|
||||
if (!Sim::findObject( SimObjectId( explosionId ), explosion ))
|
||||
Con::errorf( ConsoleLogEntry::General, "DebrisData::onAdd: Invalid packet, bad datablockId(particle emitter): 0x%x", explosionId);
|
||||
if (!Sim::findObject(SimObjectId(explosionId), explosion))
|
||||
{
|
||||
Con::errorf(ConsoleLogEntry::General, "DebrisData::onAdd: Invalid packet, bad datablockId(particle emitter): 0x%x", explosionId);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// validate data
|
||||
|
|
|
|||
|
|
@ -637,6 +637,7 @@ bool ExplosionData::onAdd()
|
|||
if( !Sim::findObject( debrisIDList[i], debrisList[i] ) )
|
||||
{
|
||||
Con::errorf( ConsoleLogEntry::General, "ExplosionData::onAdd: Invalid packet, bad datablockId(debris): 0x%x", debrisIDList[i] );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -648,6 +649,7 @@ bool ExplosionData::onAdd()
|
|||
if( Sim::findObject( emitterIDList[i], emitterList[i] ) == false)
|
||||
{
|
||||
Con::errorf( ConsoleLogEntry::General, "ExplosionData::onAdd: Invalid packet, bad datablockId(particle emitter): 0x%x", emitterIDList[i] );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -659,6 +661,7 @@ bool ExplosionData::onAdd()
|
|||
if( Sim::findObject( explosionIDList[k], explosionList[k] ) == false)
|
||||
{
|
||||
Con::errorf( ConsoleLogEntry::General, "ExplosionData::onAdd: Invalid packet, bad datablockId(explosion): 0x%x", explosionIDList[k] );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -880,20 +883,34 @@ bool ExplosionData::preload(bool server, String &errorStr)
|
|||
if (Parent::preload(server, errorStr) == false)
|
||||
return false;
|
||||
|
||||
if( !server )
|
||||
if (!server)
|
||||
{
|
||||
|
||||
if (!isSoundValid())
|
||||
{
|
||||
//return false; -TODO: trigger asset download
|
||||
}
|
||||
|
||||
if (!particleEmitter && particleEmitterId != 0)
|
||||
{
|
||||
if (Sim::findObject(particleEmitterId, particleEmitter) == false)
|
||||
{
|
||||
Con::errorf(ConsoleLogEntry::General, "Error, unable to load particle emitter for explosion datablock");
|
||||
errorStr = String::ToString("Error, unable to load particle emitter for explosion datablock");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
U32 i;
|
||||
for (i = 0; i < EC_NUM_EMITTERS; i++)
|
||||
{
|
||||
if (!emitterList[i] && emitterIDList[i] != 0)
|
||||
{
|
||||
if (Sim::findObject(emitterIDList[i], emitterList[i]) == false)
|
||||
{
|
||||
errorStr = String::ToString("Error, unable to load emitter[%i] for explosion datablock 0x%x", i, emitterIDList[i]);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (getExplosionShape()) {
|
||||
|
|
|
|||
|
|
@ -704,7 +704,10 @@ bool ParticleEmitterData::preload(bool server, String &errorStr)
|
|||
{
|
||||
ParticleData* pData = NULL;
|
||||
if (Sim::findObject(dataBlockIds[i], pData) == false)
|
||||
Con::warnf(ConsoleLogEntry::General, "ParticleEmitterData(%s) unable to find particle datablock: %d", getName(), dataBlockIds[i]);
|
||||
{
|
||||
errorStr = String::ToString("ParticleEmitterData(%s) unable to find particle datablock: %d", getName(), dataBlockIds[i]);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
particleDataBlocks.push_back(pData);
|
||||
}
|
||||
|
|
@ -749,6 +752,7 @@ bool ParticleEmitterData::preload(bool server, String &errorStr)
|
|||
if (particleDataBlocks[i]->getTextureAsset()->getImageFile() != txr_name)
|
||||
{
|
||||
Con::warnf(ConsoleLogEntry::General, "ParticleEmitterData(%s) particles reference different textures.", getName());
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -149,6 +149,18 @@ bool SplashData::onAdd()
|
|||
if (Parent::onAdd() == false)
|
||||
return false;
|
||||
|
||||
S32 i;
|
||||
for (i = 0; i < NUM_EMITTERS; i++)
|
||||
{
|
||||
if (!emitterList[i] && emitterIDList[i] != 0)
|
||||
{
|
||||
if (Sim::findObject(emitterIDList[i], emitterList[i]) == false)
|
||||
{
|
||||
Con::errorf(ConsoleLogEntry::General, "ExplosionData::onAdd: Invalid packet, bad datablockId(particle emitter): 0x%x", emitterIDList[i]);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -281,7 +293,8 @@ bool SplashData::preload(bool server, String &errorStr)
|
|||
{
|
||||
if( Sim::findObject( emitterIDList[i], emitterList[i] ) == false)
|
||||
{
|
||||
Con::errorf( ConsoleLogEntry::General, "SplashData::onAdd: Invalid packet, bad datablockId(particle emitter): 0x%x", emitterIDList[i] );
|
||||
errorStr = String::ToString("SplashData::onAdd: Invalid packet, bad datablockId(particle emitter): 0x%x", emitterIDList[i]);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -299,7 +312,8 @@ bool SplashData::preload(bool server, String &errorStr)
|
|||
{
|
||||
if( !Sim::findObject(explosionId, explosion) )
|
||||
{
|
||||
Con::errorf(ConsoleLogEntry::General, "SplashData::preload: Invalid packet, bad datablockId(explosion): %d", explosionId);
|
||||
errorStr = String::ToString("SplashData::preload: Invalid packet, bad datablockId(explosion): %d", explosionId);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -336,6 +336,47 @@ bool ProjectileData::onAdd()
|
|||
if(!Parent::onAdd())
|
||||
return false;
|
||||
|
||||
if (!particleEmitter && particleEmitterId != 0)
|
||||
{
|
||||
if (Sim::findObject(particleEmitterId, particleEmitter) == false)
|
||||
{
|
||||
Con::errorf(ConsoleLogEntry::General, "ProjectileData::onAdd: Invalid packet, bad datablockId(particleEmitter): 0x%x", particleEmitterId);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!explosion && explosionId != 0)
|
||||
{
|
||||
if (Sim::findObject(explosionId, explosion) == false)
|
||||
{
|
||||
Con::errorf(ConsoleLogEntry::General, "ProjectileData::onAdd: Invalid packet, bad datablockId(explosion): 0x%x", explosionId);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!waterExplosion && waterExplosionId != 0)
|
||||
{
|
||||
if (Sim::findObject(waterExplosionId, waterExplosion) == false)
|
||||
{
|
||||
Con::errorf(ConsoleLogEntry::General, "ProjectileData::onAdd: Invalid packet, bad datablockId(waterExplosion): 0x%x", waterExplosionId);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!splash && splashId != 0)
|
||||
{
|
||||
if (Sim::findObject(splashId, splash) == false)
|
||||
{
|
||||
Con::errorf(ConsoleLogEntry::General, "ProjectileData::onAdd: Invalid packet, bad datablockId(waterExplosion): 0x%x", splashId);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!decal && decalId != 0)
|
||||
{
|
||||
if (Sim::findObject(decalId, decal) == false)
|
||||
{
|
||||
Con::errorf(ConsoleLogEntry::General, "ProjectileData::onAdd: Invalid packet, bad datablockId(waterExplosion): 0x%x", decalId);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -297,6 +297,36 @@ bool RigidShapeData::onAdd()
|
|||
if(!Parent::onAdd())
|
||||
return false;
|
||||
|
||||
for (S32 i = 0; i < VC_NUM_SPLASH_EMITTERS; i++)
|
||||
{
|
||||
if (!splashEmitterList[i] && splashEmitterIDList[i] != 0)
|
||||
{
|
||||
if (Sim::findObject(splashEmitterIDList[i], splashEmitterList[i]) == false)
|
||||
{
|
||||
Con::errorf(ConsoleLogEntry::General, "ExplosionData::onAdd: Invalid packet, bad datablockId(explosion): 0x%x", splashEmitterIDList[i]);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!dustTrailEmitter && dustTrailID != 0)
|
||||
{
|
||||
if (Sim::findObject(dustID, dustEmitter) == false)
|
||||
{
|
||||
Con::errorf(ConsoleLogEntry::General, "RigidShapeData::onAdd: Invalid packet, bad datablockId(dustEmitter): 0x%x", dustID);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!dustTrailEmitter && dustTrailID != 0)
|
||||
{
|
||||
if (Sim::findObject(dustTrailID, dustTrailEmitter) == false)
|
||||
{
|
||||
Con::errorf(ConsoleLogEntry::General, "RigidShapeData::onAdd: Invalid packet, bad datablockId(dustTrailEmitter): 0x%x", dustTrailID);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -338,7 +368,8 @@ bool RigidShapeData::preload(bool server, String &errorStr)
|
|||
{
|
||||
if( !Sim::findObject( dustID, dustEmitter ) )
|
||||
{
|
||||
Con::errorf( ConsoleLogEntry::General, "RigidShapeData::preload Invalid packet, bad datablockId(dustEmitter): 0x%x", dustID );
|
||||
errorStr = String::ToString("RigidShapeData::preload Invalid packet, bad datablockId(dustEmitter): 0x%x", dustID);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -349,7 +380,8 @@ bool RigidShapeData::preload(bool server, String &errorStr)
|
|||
{
|
||||
if( !Sim::findObject( splashEmitterIDList[i], splashEmitterList[i] ) )
|
||||
{
|
||||
Con::errorf( ConsoleLogEntry::General, "RigidShapeData::preload Invalid packet, bad datablockId(splashEmitter): 0x%x", splashEmitterIDList[i] );
|
||||
errorStr = String::ToString("RigidShapeData::preload Invalid packet, bad datablockId(splashEmitter): 0x%x", splashEmitterIDList[i] );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -370,7 +402,8 @@ bool RigidShapeData::preload(bool server, String &errorStr)
|
|||
{
|
||||
if( !Sim::findObject( dustTrailID, dustTrailEmitter ) )
|
||||
{
|
||||
Con::errorf( ConsoleLogEntry::General, "RigidShapeData::preload Invalid packet, bad datablockId(dustTrailEmitter): 0x%x", dustTrailID );
|
||||
errorStr = String::ToString("RigidShapeData::preload Invalid packet, bad datablockId(dustTrailEmitter): 0x%x", dustTrailID );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -320,7 +320,8 @@ bool ShapeBaseData::preload(bool server, String &errorStr)
|
|||
{
|
||||
if( Sim::findObject( explosionID, explosion ) == false)
|
||||
{
|
||||
Con::errorf( ConsoleLogEntry::General, "ShapeBaseData::preload: Invalid packet, bad datablockId(explosion): 0x%x", explosionID );
|
||||
errorStr = String::ToString("ShapeBaseData::preload: Invalid packet, bad datablockId(explosion): 0x%x", explosionID );
|
||||
return false;
|
||||
}
|
||||
AssertFatal(!(explosion && ((explosionID < DataBlockObjectIdFirst) || (explosionID > DataBlockObjectIdLast))),
|
||||
"ShapeBaseData::preload: invalid explosion data");
|
||||
|
|
@ -330,7 +331,8 @@ bool ShapeBaseData::preload(bool server, String &errorStr)
|
|||
{
|
||||
if( Sim::findObject( underwaterExplosionID, underwaterExplosion ) == false)
|
||||
{
|
||||
Con::errorf( ConsoleLogEntry::General, "ShapeBaseData::preload: Invalid packet, bad datablockId(underwaterExplosion): 0x%x", underwaterExplosionID );
|
||||
errorStr = String::ToString("ShapeBaseData::preload: Invalid packet, bad datablockId(underwaterExplosion): 0x%x", underwaterExplosionID );
|
||||
return false;
|
||||
}
|
||||
AssertFatal(!(underwaterExplosion && ((underwaterExplosionID < DataBlockObjectIdFirst) || (underwaterExplosionID > DataBlockObjectIdLast))),
|
||||
"ShapeBaseData::preload: invalid underwaterExplosion data");
|
||||
|
|
@ -339,6 +341,11 @@ bool ShapeBaseData::preload(bool server, String &errorStr)
|
|||
if( !debris && debrisID != 0 )
|
||||
{
|
||||
Sim::findObject( debrisID, debris );
|
||||
if (Sim::findObject(debrisID, debris) == false)
|
||||
{
|
||||
errorStr = String::ToString("ShapeBaseData::preload: Invalid packet, bad datablockId(debris): 0x%x", debrisID);
|
||||
return false;
|
||||
}
|
||||
AssertFatal(!(debris && ((debrisID < DataBlockObjectIdFirst) || (debrisID > DataBlockObjectIdLast))),
|
||||
"ShapeBaseData::preload: invalid debris data");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -553,7 +553,8 @@ bool ShapeBaseImageData::preload(bool server, String &errorStr)
|
|||
{
|
||||
if( !Sim::findObject( SimObjectId( casingID ), casing ) )
|
||||
{
|
||||
Con::errorf( ConsoleLogEntry::General, "ShapeBaseImageData::preload: Invalid packet, bad datablockId(casing): 0x%x", casingID );
|
||||
errorStr = String::ToString("ShapeBaseImageData::preload: Invalid packet, bad datablockId(casing): 0x%x", casingID );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -942,8 +942,9 @@ U32 TSStatic::packUpdate(NetConnection* con, U32 mask, BitStream* stream)
|
|||
|
||||
if (stream->writeFlag(mask & UpdateCollisionMask))
|
||||
{
|
||||
stream->write(mCollisionLOD);
|
||||
stream->write((U32)mCollisionType);
|
||||
if (stream->writeFlag(mCollisionLOD>0))
|
||||
stream->writeInt(mCollisionLOD,12);
|
||||
stream->writeInt(mCollisionType,4);
|
||||
}
|
||||
if (stream->writeFlag(mask & SkinMask))
|
||||
con->packNetStringHandleU(stream, mSkinNameHandle);
|
||||
|
|
@ -952,7 +953,7 @@ U32 TSStatic::packUpdate(NetConnection* con, U32 mask, BitStream* stream)
|
|||
{
|
||||
PACK_ASSET_REFACTOR(con, Shape);
|
||||
|
||||
stream->write((U32)mDecalType);
|
||||
stream->writeInt(mDecalType,4);
|
||||
|
||||
stream->writeFlag(mAllowPlayerStep);
|
||||
stream->writeFlag(mMeshCulling);
|
||||
|
|
@ -998,17 +999,18 @@ U32 TSStatic::packUpdate(NetConnection* con, U32 mask, BitStream* stream)
|
|||
|
||||
if (stream->writeFlag(mask & MaterialMask))
|
||||
{
|
||||
stream->writeInt(mChangingMaterials.size(), 16);
|
||||
|
||||
for (U32 i = 0; i < mChangingMaterials.size(); i++)
|
||||
if (stream->writeFlag(mChangingMaterials.size() > 0))
|
||||
{
|
||||
stream->writeInt(mChangingMaterials[i].slot, 16);
|
||||
stream->writeInt(mChangingMaterials.size(), 16);
|
||||
|
||||
NetStringHandle matNameStr = mChangingMaterials[i].assetId.c_str();
|
||||
con->packNetStringHandleU(stream, matNameStr);
|
||||
for (U32 i = 0; i < mChangingMaterials.size(); i++)
|
||||
{
|
||||
stream->writeInt(mChangingMaterials[i].slot, 16);
|
||||
|
||||
NetStringHandle matNameStr = mChangingMaterials[i].assetId.c_str();
|
||||
con->packNetStringHandleU(stream, matNameStr);
|
||||
}
|
||||
}
|
||||
|
||||
//mChangingMaterials.clear();
|
||||
}
|
||||
|
||||
return retMask;
|
||||
|
|
@ -1042,8 +1044,9 @@ void TSStatic::unpackUpdate(NetConnection* con, BitStream* stream)
|
|||
{
|
||||
U32 collisionType = CollisionMesh;
|
||||
|
||||
stream->read(&mCollisionLOD);
|
||||
stream->read(&collisionType);
|
||||
if (stream->readFlag())
|
||||
mCollisionLOD = stream->readInt(12);
|
||||
collisionType = stream->readInt(4);
|
||||
|
||||
// Handle it if we have changed CollisionType's
|
||||
if ((MeshType)collisionType != mCollisionType)
|
||||
|
|
@ -1069,7 +1072,7 @@ void TSStatic::unpackUpdate(NetConnection* con, BitStream* stream)
|
|||
{
|
||||
UNPACK_ASSET_REFACTOR(con, Shape);
|
||||
|
||||
stream->read((U32*)&mDecalType);
|
||||
mDecalType = (MeshType)stream->readInt(4);
|
||||
|
||||
mAllowPlayerStep = stream->readFlag();
|
||||
mMeshCulling = stream->readFlag();
|
||||
|
|
@ -1124,20 +1127,22 @@ void TSStatic::unpackUpdate(NetConnection* con, BitStream* stream)
|
|||
if (stream->readFlag())
|
||||
{
|
||||
mChangingMaterials.clear();
|
||||
U32 materialCount = stream->readInt(16);
|
||||
|
||||
for (U32 i = 0; i < materialCount; i++)
|
||||
if (stream->readFlag())
|
||||
{
|
||||
matMap newMatMap;
|
||||
newMatMap.slot = stream->readInt(16);
|
||||
newMatMap.assetId = String(con->unpackNetStringHandleU(stream).getString());
|
||||
U32 materialCount = stream->readInt(16);
|
||||
|
||||
//do the lookup, now
|
||||
newMatMap.matAsset = AssetDatabase.acquireAsset<MaterialAsset>(newMatMap.assetId);
|
||||
for (U32 i = 0; i < materialCount; i++)
|
||||
{
|
||||
matMap newMatMap;
|
||||
newMatMap.slot = stream->readInt(16);
|
||||
newMatMap.assetId = String(con->unpackNetStringHandleU(stream).getString());
|
||||
|
||||
mChangingMaterials.push_back(newMatMap);
|
||||
//do the lookup, now
|
||||
newMatMap.matAsset = AssetDatabase.acquireAsset<MaterialAsset>(newMatMap.assetId);
|
||||
|
||||
mChangingMaterials.push_back(newMatMap);
|
||||
}
|
||||
}
|
||||
|
||||
updateMaterials();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -327,7 +327,8 @@ bool HoverVehicleData::preload(bool server, String &errorStr)
|
|||
{
|
||||
if( !Sim::findObject( dustTrailID, dustTrailEmitter ) )
|
||||
{
|
||||
Con::errorf( ConsoleLogEntry::General, "HoverVehicleData::preload Invalid packet, bad datablockId(dustTrailEmitter): 0x%x", dustTrailID );
|
||||
errorStr = String::ToString("HoverVehicleData::preload Invalid packet, bad datablockId(dustTrailEmitter): 0x%x", dustTrailID );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Resolve jet nodes
|
||||
|
|
|
|||
|
|
@ -174,7 +174,8 @@ bool VehicleData::preload(bool server, String &errorStr)
|
|||
{
|
||||
if( !Sim::findObject( damageEmitterIDList[i], damageEmitterList[i] ) )
|
||||
{
|
||||
Con::errorf( ConsoleLogEntry::General, "VehicleData::preload Invalid packet, bad datablockId(damageEmitter): 0x%x", damageEmitterIDList[i] );
|
||||
errorStr = String::ToString("VehicleData::preload Invalid packet, bad datablockId(damageEmitter): 0x%x", damageEmitterIDList[i] );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue