mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-29 16:25:42 +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)
|
if( Sim::findObject( emitterIDList[i], emitterList[i] ) == false)
|
||||||
{
|
{
|
||||||
Con::errorf( ConsoleLogEntry::General, "DebrisData::onAdd: Invalid packet, bad datablockId(emitter): 0x%x", emitterIDList[i]);
|
Con::errorf( ConsoleLogEntry::General, "DebrisData::onAdd: Invalid packet, bad datablockId(emitter): 0x%x", emitterIDList[i]);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!explosion && explosionId != 0)
|
if (!explosion && explosionId != 0)
|
||||||
{
|
{
|
||||||
if (!Sim::findObject( SimObjectId( explosionId ), explosion ))
|
if (!Sim::findObject(SimObjectId(explosionId), explosion))
|
||||||
Con::errorf( ConsoleLogEntry::General, "DebrisData::onAdd: Invalid packet, bad datablockId(particle emitter): 0x%x", explosionId);
|
{
|
||||||
|
Con::errorf(ConsoleLogEntry::General, "DebrisData::onAdd: Invalid packet, bad datablockId(particle emitter): 0x%x", explosionId);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// validate data
|
// validate data
|
||||||
|
|
|
||||||
|
|
@ -637,6 +637,7 @@ bool ExplosionData::onAdd()
|
||||||
if( !Sim::findObject( debrisIDList[i], debrisList[i] ) )
|
if( !Sim::findObject( debrisIDList[i], debrisList[i] ) )
|
||||||
{
|
{
|
||||||
Con::errorf( ConsoleLogEntry::General, "ExplosionData::onAdd: Invalid packet, bad datablockId(debris): 0x%x", debrisIDList[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)
|
if( Sim::findObject( emitterIDList[i], emitterList[i] ) == false)
|
||||||
{
|
{
|
||||||
Con::errorf( ConsoleLogEntry::General, "ExplosionData::onAdd: Invalid packet, bad datablockId(particle emitter): 0x%x", emitterIDList[i] );
|
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)
|
if( Sim::findObject( explosionIDList[k], explosionList[k] ) == false)
|
||||||
{
|
{
|
||||||
Con::errorf( ConsoleLogEntry::General, "ExplosionData::onAdd: Invalid packet, bad datablockId(explosion): 0x%x", explosionIDList[k] );
|
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)
|
if (Parent::preload(server, errorStr) == false)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( !server )
|
if (!server)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!isSoundValid())
|
if (!isSoundValid())
|
||||||
{
|
{
|
||||||
//return false; -TODO: trigger asset download
|
//return false; -TODO: trigger asset download
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!particleEmitter && particleEmitterId != 0)
|
if (!particleEmitter && particleEmitterId != 0)
|
||||||
|
{
|
||||||
if (Sim::findObject(particleEmitterId, particleEmitter) == false)
|
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;
|
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()) {
|
if (getExplosionShape()) {
|
||||||
|
|
|
||||||
|
|
@ -704,7 +704,10 @@ bool ParticleEmitterData::preload(bool server, String &errorStr)
|
||||||
{
|
{
|
||||||
ParticleData* pData = NULL;
|
ParticleData* pData = NULL;
|
||||||
if (Sim::findObject(dataBlockIds[i], pData) == false)
|
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
|
else
|
||||||
particleDataBlocks.push_back(pData);
|
particleDataBlocks.push_back(pData);
|
||||||
}
|
}
|
||||||
|
|
@ -749,6 +752,7 @@ bool ParticleEmitterData::preload(bool server, String &errorStr)
|
||||||
if (particleDataBlocks[i]->getTextureAsset()->getImageFile() != txr_name)
|
if (particleDataBlocks[i]->getTextureAsset()->getImageFile() != txr_name)
|
||||||
{
|
{
|
||||||
Con::warnf(ConsoleLogEntry::General, "ParticleEmitterData(%s) particles reference different textures.", getName());
|
Con::warnf(ConsoleLogEntry::General, "ParticleEmitterData(%s) particles reference different textures.", getName());
|
||||||
|
return false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -149,6 +149,18 @@ bool SplashData::onAdd()
|
||||||
if (Parent::onAdd() == false)
|
if (Parent::onAdd() == false)
|
||||||
return 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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -281,7 +293,8 @@ bool SplashData::preload(bool server, String &errorStr)
|
||||||
{
|
{
|
||||||
if( Sim::findObject( emitterIDList[i], emitterList[i] ) == false)
|
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) )
|
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())
|
if(!Parent::onAdd())
|
||||||
return false;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -297,6 +297,36 @@ bool RigidShapeData::onAdd()
|
||||||
if(!Parent::onAdd())
|
if(!Parent::onAdd())
|
||||||
return false;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -338,7 +368,8 @@ bool RigidShapeData::preload(bool server, String &errorStr)
|
||||||
{
|
{
|
||||||
if( !Sim::findObject( dustID, dustEmitter ) )
|
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] ) )
|
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 ) )
|
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)
|
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))),
|
AssertFatal(!(explosion && ((explosionID < DataBlockObjectIdFirst) || (explosionID > DataBlockObjectIdLast))),
|
||||||
"ShapeBaseData::preload: invalid explosion data");
|
"ShapeBaseData::preload: invalid explosion data");
|
||||||
|
|
@ -330,7 +331,8 @@ bool ShapeBaseData::preload(bool server, String &errorStr)
|
||||||
{
|
{
|
||||||
if( Sim::findObject( underwaterExplosionID, underwaterExplosion ) == false)
|
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))),
|
AssertFatal(!(underwaterExplosion && ((underwaterExplosionID < DataBlockObjectIdFirst) || (underwaterExplosionID > DataBlockObjectIdLast))),
|
||||||
"ShapeBaseData::preload: invalid underwaterExplosion data");
|
"ShapeBaseData::preload: invalid underwaterExplosion data");
|
||||||
|
|
@ -339,6 +341,11 @@ bool ShapeBaseData::preload(bool server, String &errorStr)
|
||||||
if( !debris && debrisID != 0 )
|
if( !debris && debrisID != 0 )
|
||||||
{
|
{
|
||||||
Sim::findObject( debrisID, debris );
|
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))),
|
AssertFatal(!(debris && ((debrisID < DataBlockObjectIdFirst) || (debrisID > DataBlockObjectIdLast))),
|
||||||
"ShapeBaseData::preload: invalid debris data");
|
"ShapeBaseData::preload: invalid debris data");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -553,7 +553,8 @@ bool ShapeBaseImageData::preload(bool server, String &errorStr)
|
||||||
{
|
{
|
||||||
if( !Sim::findObject( SimObjectId( casingID ), casing ) )
|
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))
|
if (stream->writeFlag(mask & UpdateCollisionMask))
|
||||||
{
|
{
|
||||||
stream->write(mCollisionLOD);
|
if (stream->writeFlag(mCollisionLOD>0))
|
||||||
stream->write((U32)mCollisionType);
|
stream->writeInt(mCollisionLOD,12);
|
||||||
|
stream->writeInt(mCollisionType,4);
|
||||||
}
|
}
|
||||||
if (stream->writeFlag(mask & SkinMask))
|
if (stream->writeFlag(mask & SkinMask))
|
||||||
con->packNetStringHandleU(stream, mSkinNameHandle);
|
con->packNetStringHandleU(stream, mSkinNameHandle);
|
||||||
|
|
@ -952,7 +953,7 @@ U32 TSStatic::packUpdate(NetConnection* con, U32 mask, BitStream* stream)
|
||||||
{
|
{
|
||||||
PACK_ASSET_REFACTOR(con, Shape);
|
PACK_ASSET_REFACTOR(con, Shape);
|
||||||
|
|
||||||
stream->write((U32)mDecalType);
|
stream->writeInt(mDecalType,4);
|
||||||
|
|
||||||
stream->writeFlag(mAllowPlayerStep);
|
stream->writeFlag(mAllowPlayerStep);
|
||||||
stream->writeFlag(mMeshCulling);
|
stream->writeFlag(mMeshCulling);
|
||||||
|
|
@ -998,17 +999,18 @@ U32 TSStatic::packUpdate(NetConnection* con, U32 mask, BitStream* stream)
|
||||||
|
|
||||||
if (stream->writeFlag(mask & MaterialMask))
|
if (stream->writeFlag(mask & MaterialMask))
|
||||||
{
|
{
|
||||||
stream->writeInt(mChangingMaterials.size(), 16);
|
if (stream->writeFlag(mChangingMaterials.size() > 0))
|
||||||
|
|
||||||
for (U32 i = 0; i < mChangingMaterials.size(); i++)
|
|
||||||
{
|
{
|
||||||
stream->writeInt(mChangingMaterials[i].slot, 16);
|
stream->writeInt(mChangingMaterials.size(), 16);
|
||||||
|
|
||||||
NetStringHandle matNameStr = mChangingMaterials[i].assetId.c_str();
|
for (U32 i = 0; i < mChangingMaterials.size(); i++)
|
||||||
con->packNetStringHandleU(stream, matNameStr);
|
{
|
||||||
|
stream->writeInt(mChangingMaterials[i].slot, 16);
|
||||||
|
|
||||||
|
NetStringHandle matNameStr = mChangingMaterials[i].assetId.c_str();
|
||||||
|
con->packNetStringHandleU(stream, matNameStr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//mChangingMaterials.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return retMask;
|
return retMask;
|
||||||
|
|
@ -1042,8 +1044,9 @@ void TSStatic::unpackUpdate(NetConnection* con, BitStream* stream)
|
||||||
{
|
{
|
||||||
U32 collisionType = CollisionMesh;
|
U32 collisionType = CollisionMesh;
|
||||||
|
|
||||||
stream->read(&mCollisionLOD);
|
if (stream->readFlag())
|
||||||
stream->read(&collisionType);
|
mCollisionLOD = stream->readInt(12);
|
||||||
|
collisionType = stream->readInt(4);
|
||||||
|
|
||||||
// Handle it if we have changed CollisionType's
|
// Handle it if we have changed CollisionType's
|
||||||
if ((MeshType)collisionType != mCollisionType)
|
if ((MeshType)collisionType != mCollisionType)
|
||||||
|
|
@ -1069,7 +1072,7 @@ void TSStatic::unpackUpdate(NetConnection* con, BitStream* stream)
|
||||||
{
|
{
|
||||||
UNPACK_ASSET_REFACTOR(con, Shape);
|
UNPACK_ASSET_REFACTOR(con, Shape);
|
||||||
|
|
||||||
stream->read((U32*)&mDecalType);
|
mDecalType = (MeshType)stream->readInt(4);
|
||||||
|
|
||||||
mAllowPlayerStep = stream->readFlag();
|
mAllowPlayerStep = stream->readFlag();
|
||||||
mMeshCulling = stream->readFlag();
|
mMeshCulling = stream->readFlag();
|
||||||
|
|
@ -1124,20 +1127,22 @@ void TSStatic::unpackUpdate(NetConnection* con, BitStream* stream)
|
||||||
if (stream->readFlag())
|
if (stream->readFlag())
|
||||||
{
|
{
|
||||||
mChangingMaterials.clear();
|
mChangingMaterials.clear();
|
||||||
U32 materialCount = stream->readInt(16);
|
if (stream->readFlag())
|
||||||
|
|
||||||
for (U32 i = 0; i < materialCount; i++)
|
|
||||||
{
|
{
|
||||||
matMap newMatMap;
|
U32 materialCount = stream->readInt(16);
|
||||||
newMatMap.slot = stream->readInt(16);
|
|
||||||
newMatMap.assetId = String(con->unpackNetStringHandleU(stream).getString());
|
|
||||||
|
|
||||||
//do the lookup, now
|
for (U32 i = 0; i < materialCount; i++)
|
||||||
newMatMap.matAsset = AssetDatabase.acquireAsset<MaterialAsset>(newMatMap.assetId);
|
{
|
||||||
|
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();
|
updateMaterials();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -327,7 +327,8 @@ bool HoverVehicleData::preload(bool server, String &errorStr)
|
||||||
{
|
{
|
||||||
if( !Sim::findObject( dustTrailID, dustTrailEmitter ) )
|
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
|
// Resolve jet nodes
|
||||||
|
|
|
||||||
|
|
@ -174,7 +174,8 @@ bool VehicleData::preload(bool server, String &errorStr)
|
||||||
{
|
{
|
||||||
if( !Sim::findObject( damageEmitterIDList[i], damageEmitterList[i] ) )
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -917,8 +917,7 @@ Con::EvalResult CodeBlock::exec(U32 ip, const char* functionName, Namespace* thi
|
||||||
{
|
{
|
||||||
if (Con::gObjectCopyFailures == -1)
|
if (Con::gObjectCopyFailures == -1)
|
||||||
Con::errorf(ConsoleLogEntry::General, "%s: Unable to find parent object %s for %s.", getFileLine(ip - 1), objParent, callArgv[1].getString());
|
Con::errorf(ConsoleLogEntry::General, "%s: Unable to find parent object %s for %s.", getFileLine(ip - 1), objParent, callArgv[1].getString());
|
||||||
else
|
++Con::gObjectCopyFailures;
|
||||||
++Con::gObjectCopyFailures;
|
|
||||||
|
|
||||||
delete object;
|
delete object;
|
||||||
currentNewObject = NULL;
|
currentNewObject = NULL;
|
||||||
|
|
@ -1033,6 +1032,7 @@ Con::EvalResult CodeBlock::exec(U32 ip, const char* functionName, Namespace* thi
|
||||||
{
|
{
|
||||||
// This error is usually caused by failing to call Parent::initPersistFields in the class' initPersistFields().
|
// This error is usually caused by failing to call Parent::initPersistFields in the class' initPersistFields().
|
||||||
Con::warnf(ConsoleLogEntry::General, "%s: Register object failed for object %s of class %s.", getFileLine(ip - 2), currentNewObject->getName(), currentNewObject->getClassName());
|
Con::warnf(ConsoleLogEntry::General, "%s: Register object failed for object %s of class %s.", getFileLine(ip - 2), currentNewObject->getName(), currentNewObject->getClassName());
|
||||||
|
++Con::gObjectCopyFailures;
|
||||||
delete currentNewObject;
|
delete currentNewObject;
|
||||||
currentNewObject = NULL;
|
currentNewObject = NULL;
|
||||||
ip = failJump;
|
ip = failJump;
|
||||||
|
|
@ -1049,6 +1049,7 @@ Con::EvalResult CodeBlock::exec(U32 ip, const char* functionName, Namespace* thi
|
||||||
{
|
{
|
||||||
Con::errorf(ConsoleLogEntry::General, "%s: preload failed for %s: %s.", getFileLine(ip - 2),
|
Con::errorf(ConsoleLogEntry::General, "%s: preload failed for %s: %s.", getFileLine(ip - 2),
|
||||||
currentNewObject->getName(), errorStr.c_str());
|
currentNewObject->getName(), errorStr.c_str());
|
||||||
|
++Con::gObjectCopyFailures;
|
||||||
dataBlock->deleteObject();
|
dataBlock->deleteObject();
|
||||||
currentNewObject = NULL;
|
currentNewObject = NULL;
|
||||||
ip = failJump;
|
ip = failJump;
|
||||||
|
|
|
||||||
|
|
@ -1122,15 +1122,19 @@ void GFXGLShader::setConstantsFromBuffer(U8* buffer)
|
||||||
// Set sampler number on our program.
|
// Set sampler number on our program.
|
||||||
glUniform1i(handle->mDesc.bindPoint, handle->mDesc.samplerReg);
|
glUniform1i(handle->mDesc.bindPoint, handle->mDesc.samplerReg);
|
||||||
break;
|
break;
|
||||||
|
case GFXSCT_Bool:
|
||||||
case GFXSCT_Int:
|
case GFXSCT_Int:
|
||||||
glUniform1iv(handle->mDesc.bindPoint, handle->mDesc.arraySize, (GLint*)(mGlobalConstBuffer + handle->mDesc.offset));
|
glUniform1iv(handle->mDesc.bindPoint, handle->mDesc.arraySize, (GLint*)(mGlobalConstBuffer + handle->mDesc.offset));
|
||||||
break;
|
break;
|
||||||
|
case GFXSCT_Bool2:
|
||||||
case GFXSCT_Int2:
|
case GFXSCT_Int2:
|
||||||
glUniform2iv(handle->mDesc.bindPoint, handle->mDesc.arraySize, (GLint*)(mGlobalConstBuffer + handle->mDesc.offset));
|
glUniform2iv(handle->mDesc.bindPoint, handle->mDesc.arraySize, (GLint*)(mGlobalConstBuffer + handle->mDesc.offset));
|
||||||
break;
|
break;
|
||||||
|
case GFXSCT_Bool3:
|
||||||
case GFXSCT_Int3:
|
case GFXSCT_Int3:
|
||||||
glUniform3iv(handle->mDesc.bindPoint, handle->mDesc.arraySize, (GLint*)(mGlobalConstBuffer + handle->mDesc.offset));
|
glUniform3iv(handle->mDesc.bindPoint, handle->mDesc.arraySize, (GLint*)(mGlobalConstBuffer + handle->mDesc.offset));
|
||||||
break;
|
break;
|
||||||
|
case GFXSCT_Bool4:
|
||||||
case GFXSCT_Int4:
|
case GFXSCT_Int4:
|
||||||
glUniform4iv(handle->mDesc.bindPoint, handle->mDesc.arraySize, (GLint*)(mGlobalConstBuffer + handle->mDesc.offset));
|
glUniform4iv(handle->mDesc.bindPoint, handle->mDesc.arraySize, (GLint*)(mGlobalConstBuffer + handle->mDesc.offset));
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -1427,7 +1427,7 @@ bool GuiPopUpMenuCtrlEx::onKeyDown(const GuiEvent &event)
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
void GuiPopUpMenuCtrlEx::onAction()
|
void GuiPopUpMenuCtrlEx::onAction()
|
||||||
{
|
{
|
||||||
if (!mActive)
|
if (!mActive || dynamic_cast<GuiPopupTextListCtrlEx*>(mTl) == NULL )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
GuiControl *canCtrl = getParent();
|
GuiControl *canCtrl = getParent();
|
||||||
|
|
|
||||||
|
|
@ -495,7 +495,8 @@ void RenderParticleMgr::renderParticle(ParticleRenderInst* ri, SceneRenderState*
|
||||||
|
|
||||||
mParticleShaderConsts.mShaderConsts->setSafe( mParticleShaderConsts.mAlphaFactorSC, alphaFactor );
|
mParticleShaderConsts.mShaderConsts->setSafe( mParticleShaderConsts.mAlphaFactorSC, alphaFactor );
|
||||||
mParticleShaderConsts.mShaderConsts->setSafe( mParticleShaderConsts.mAlphaScaleSC, alphaScale );
|
mParticleShaderConsts.mShaderConsts->setSafe( mParticleShaderConsts.mAlphaScaleSC, alphaScale );
|
||||||
|
mParticleShaderConsts.mShaderConsts->setSafe(mParticleShaderConsts.mGlowSC, ri->glow);
|
||||||
|
|
||||||
mParticleShaderConsts.mShaderConsts->setSafe( mParticleShaderConsts.mFSModelViewProjSC, *ri->modelViewProj );
|
mParticleShaderConsts.mShaderConsts->setSafe( mParticleShaderConsts.mFSModelViewProjSC, *ri->modelViewProj );
|
||||||
mParticleShaderConsts.mShaderConsts->setSafe( mParticleShaderConsts.mOneOverFarSC, 1.0f / state->getFarPlane() );
|
mParticleShaderConsts.mShaderConsts->setSafe( mParticleShaderConsts.mOneOverFarSC, 1.0f / state->getFarPlane() );
|
||||||
|
|
||||||
|
|
@ -556,6 +557,7 @@ bool RenderParticleMgr::_initShader()
|
||||||
mParticleShaderConsts.mOneOverSoftnessSC = mParticleShader->getShaderConstHandle( "$oneOverSoftness" );
|
mParticleShaderConsts.mOneOverSoftnessSC = mParticleShader->getShaderConstHandle( "$oneOverSoftness" );
|
||||||
mParticleShaderConsts.mAlphaFactorSC = mParticleShader->getShaderConstHandle( "$alphaFactor" );
|
mParticleShaderConsts.mAlphaFactorSC = mParticleShader->getShaderConstHandle( "$alphaFactor" );
|
||||||
mParticleShaderConsts.mAlphaScaleSC = mParticleShader->getShaderConstHandle( "$alphaScale" );
|
mParticleShaderConsts.mAlphaScaleSC = mParticleShader->getShaderConstHandle( "$alphaScale" );
|
||||||
|
mParticleShaderConsts.mGlowSC = mParticleShader->getShaderConstHandle("$glow");
|
||||||
mParticleShaderConsts.mFSModelViewProjSC = mParticleShader->getShaderConstHandle( "$fsModelViewProj" );
|
mParticleShaderConsts.mFSModelViewProjSC = mParticleShader->getShaderConstHandle( "$fsModelViewProj" );
|
||||||
mParticleShaderConsts.mDeferredTargetParamsSC = mParticleShader->getShaderConstHandle( "$deferredTargetParams" );
|
mParticleShaderConsts.mDeferredTargetParamsSC = mParticleShader->getShaderConstHandle( "$deferredTargetParams" );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -112,6 +112,7 @@ protected:
|
||||||
GFXShaderConstHandle *mDeferredTargetParamsSC;
|
GFXShaderConstHandle *mDeferredTargetParamsSC;
|
||||||
GFXShaderConstHandle *mAlphaFactorSC;
|
GFXShaderConstHandle *mAlphaFactorSC;
|
||||||
GFXShaderConstHandle *mAlphaScaleSC;
|
GFXShaderConstHandle *mAlphaScaleSC;
|
||||||
|
GFXShaderConstHandle* mGlowSC;
|
||||||
GFXShaderConstHandle *mSamplerDiffuse;
|
GFXShaderConstHandle *mSamplerDiffuse;
|
||||||
GFXShaderConstHandle *mSamplerDeferredTex;
|
GFXShaderConstHandle *mSamplerDeferredTex;
|
||||||
GFXShaderConstHandle *mSamplerParaboloidLightMap;
|
GFXShaderConstHandle *mSamplerParaboloidLightMap;
|
||||||
|
|
|
||||||
|
|
@ -905,62 +905,48 @@ U32 SceneObject::packUpdate( NetConnection* conn, U32 mask, BitStream* stream )
|
||||||
if ( stream->writeFlag( mask & FlagMask ) )
|
if ( stream->writeFlag( mask & FlagMask ) )
|
||||||
stream->writeRangedU32( (U32)mObjectFlags, 0, getObjectFlagMax() );
|
stream->writeRangedU32( (U32)mObjectFlags, 0, getObjectFlagMax() );
|
||||||
|
|
||||||
// PATHSHAPE
|
|
||||||
//Begin attachment
|
|
||||||
retMask = 0; //retry mask
|
retMask = 0; //retry mask
|
||||||
|
|
||||||
if (stream->writeFlag(getParent() != NULL)) {
|
|
||||||
stream->writeAffineTransform(mGraph.objToParent);
|
|
||||||
}
|
|
||||||
if (stream->writeFlag(mask & MountedMask))
|
if (stream->writeFlag(mask & MountedMask))
|
||||||
{
|
{
|
||||||
// Check to see if we need to write an object ID
|
// Check to see if we need to write an object ID
|
||||||
if (stream->writeFlag(mGraph.parent)) {
|
if (stream->writeFlag(mGraph.parent))
|
||||||
|
{
|
||||||
S32 t = conn->getGhostIndex(mGraph.parent);
|
S32 t = conn->getGhostIndex(mGraph.parent);
|
||||||
// Check to see if we can actually ghost this...
|
// Check to see if we can actually ghost this...
|
||||||
if (t == -1) {
|
if (stream->writeFlag(t != -1))
|
||||||
// Cant, try again later
|
{
|
||||||
retMask |= MountedMask;
|
// Can, write it.
|
||||||
stream->writeFlag(false);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// Can, write it.
|
|
||||||
stream->writeFlag(true);
|
|
||||||
stream->writeRangedU32(U32(t), 0, NetConnection::MaxGhostCount);
|
stream->writeRangedU32(U32(t), 0, NetConnection::MaxGhostCount);
|
||||||
stream->writeAffineTransform(mGraph.objToParent);
|
stream->writeAffineTransform(mGraph.objToParent);
|
||||||
//Con::errorf("%d: sent mounted on %d", getId(), mGraph.parent->getId());
|
//Con::errorf("%d: sent mounted on %d", getId(), mGraph.parent->getId());
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
}
|
|
||||||
// End of Attachment
|
|
||||||
// PATHSHAPE END
|
|
||||||
|
|
||||||
if ( mask & MountedMask )
|
|
||||||
{
|
|
||||||
if ( mMount.object )
|
|
||||||
{
|
|
||||||
S32 gIndex = conn->getGhostIndex( mMount.object );
|
|
||||||
|
|
||||||
if ( stream->writeFlag( gIndex != -1 ) )
|
|
||||||
{
|
{
|
||||||
stream->writeFlag( true );
|
// Cant, try again later
|
||||||
stream->writeInt( gIndex, NetConnection::GhostIdBitSize );
|
retMask |= MountedMask;
|
||||||
if ( stream->writeFlag( mMount.node != -1 ) )
|
}
|
||||||
stream->writeInt( mMount.node, NumMountPointBits );
|
}
|
||||||
mathWrite( *stream, mMount.xfm );
|
else if (stream->writeFlag(mMount.object))
|
||||||
|
{
|
||||||
|
S32 gIndex = conn->getGhostIndex(mMount.object);
|
||||||
|
|
||||||
|
if (stream->writeFlag(gIndex != -1))
|
||||||
|
{
|
||||||
|
stream->writeInt(gIndex, NetConnection::GhostIdBitSize);
|
||||||
|
if (stream->writeFlag(mMount.node != -1))
|
||||||
|
stream->writeInt(mMount.node, NumMountPointBits);
|
||||||
|
mathWrite(*stream, mMount.xfm);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
// Will have to try again later
|
// Will have to try again later
|
||||||
retMask |= MountedMask;
|
retMask |= MountedMask;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
// Unmount if this isn't the initial packet
|
|
||||||
if ( stream->writeFlag( !(mask & InitialUpdateMask) ) )
|
|
||||||
stream->writeFlag( false );
|
|
||||||
}
|
}
|
||||||
else
|
else if (stream->writeFlag(getParent() != NULL)) //parent xform sync
|
||||||
stream->writeFlag( false );
|
{
|
||||||
|
stream->writeAffineTransform(mGraph.objToParent);
|
||||||
|
}
|
||||||
|
|
||||||
return retMask;
|
return retMask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -974,15 +960,7 @@ void SceneObject::unpackUpdate( NetConnection* conn, BitStream* stream )
|
||||||
if ( stream->readFlag() )
|
if ( stream->readFlag() )
|
||||||
mObjectFlags = stream->readRangedU32( 0, getObjectFlagMax() );
|
mObjectFlags = stream->readRangedU32( 0, getObjectFlagMax() );
|
||||||
|
|
||||||
// PATHSHAPE
|
if (stream->readFlag())// MountedMask
|
||||||
// begin of attachment
|
|
||||||
if (stream->readFlag())
|
|
||||||
{
|
|
||||||
MatrixF m;
|
|
||||||
stream->readAffineTransform(&m);
|
|
||||||
mGraph.objToParent = m;
|
|
||||||
}
|
|
||||||
if (stream->readFlag())
|
|
||||||
{
|
{
|
||||||
// Check to see if we need to read an object ID
|
// Check to see if we need to read an object ID
|
||||||
if (stream->readFlag())
|
if (stream->readFlag())
|
||||||
|
|
@ -990,7 +968,7 @@ void SceneObject::unpackUpdate( NetConnection* conn, BitStream* stream )
|
||||||
// Check to see if we can actually ghost this...
|
// Check to see if we can actually ghost this...
|
||||||
if (stream->readFlag())
|
if (stream->readFlag())
|
||||||
{
|
{
|
||||||
GameBase *newParent = static_cast<GameBase*>(conn->resolveGhost(stream->readRangedU32(0, NetConnection::MaxGhostCount)));
|
GameBase* newParent = static_cast<GameBase*>(conn->resolveGhost(stream->readRangedU32(0, NetConnection::MaxGhostCount)));
|
||||||
MatrixF m;
|
MatrixF m;
|
||||||
stream->readAffineTransform(&m);
|
stream->readAffineTransform(&m);
|
||||||
|
|
||||||
|
|
@ -1000,40 +978,43 @@ void SceneObject::unpackUpdate( NetConnection* conn, BitStream* stream )
|
||||||
processAfter(newParent);
|
processAfter(newParent);
|
||||||
}
|
}
|
||||||
|
|
||||||
attachToParent(newParent, &m);
|
attachToParent(newParent, &m);
|
||||||
//Con::errorf("%d: got mounted on %d", getId(), mParentObject->getId());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
attachToParent(NULL);
|
attachToParent(NULL);
|
||||||
}
|
|
||||||
}
|
|
||||||
// End of attachment
|
|
||||||
// PATHSHAPE END
|
|
||||||
|
|
||||||
// MountedMask
|
if (stream->readFlag()) //mounted to an object
|
||||||
if ( stream->readFlag() )
|
|
||||||
{
|
|
||||||
if ( stream->readFlag() )
|
|
||||||
{
|
|
||||||
S32 gIndex = stream->readInt( NetConnection::GhostIdBitSize );
|
|
||||||
SceneObject* obj = dynamic_cast<SceneObject*>( conn->resolveGhost( gIndex ) );
|
|
||||||
S32 node = -1;
|
|
||||||
if ( stream->readFlag() ) // node != -1
|
|
||||||
node = stream->readInt( NumMountPointBits );
|
|
||||||
MatrixF xfm;
|
|
||||||
mathRead( *stream, &xfm );
|
|
||||||
if ( !obj )
|
|
||||||
{
|
{
|
||||||
conn->setLastError( "Invalid packet from server." );
|
if (stream->readFlag()) //object was ghosted
|
||||||
return;
|
{
|
||||||
|
S32 gIndex = stream->readInt(NetConnection::GhostIdBitSize);
|
||||||
|
SceneObject* obj = dynamic_cast<SceneObject*>(conn->resolveGhost(gIndex));
|
||||||
|
S32 node = -1;
|
||||||
|
if (stream->readFlag()) // node != -1
|
||||||
|
node = stream->readInt(NumMountPointBits);
|
||||||
|
MatrixF xfm;
|
||||||
|
mathRead(*stream, &xfm);
|
||||||
|
if (!obj)
|
||||||
|
{
|
||||||
|
conn->setLastError("Invalid packet from server.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
obj->mountObject(this, node, xfm);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
obj->mountObject( this, node, xfm );
|
else
|
||||||
|
unmount();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
unmount();
|
|
||||||
}
|
}
|
||||||
|
else if (stream->readFlag()) //parent xform sync
|
||||||
|
{
|
||||||
|
MatrixF m;
|
||||||
|
stream->readAffineTransform(&m);
|
||||||
|
mGraph.objToParent = m;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||||
// IN THE SOFTWARE.
|
// IN THE SOFTWARE.
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
#include "torque.glsl"
|
#include "torque.glsl"
|
||||||
#include "hlslCompat.glsl"
|
#include "hlslCompat.glsl"
|
||||||
|
|
||||||
|
|
@ -77,6 +76,7 @@ vec4 lmSample( vec3 nrm )
|
||||||
|
|
||||||
uniform float alphaFactor;
|
uniform float alphaFactor;
|
||||||
uniform float alphaScale;
|
uniform float alphaScale;
|
||||||
|
uniform bool glow;
|
||||||
|
|
||||||
out vec4 OUT_col;
|
out vec4 OUT_col;
|
||||||
|
|
||||||
|
|
@ -106,7 +106,12 @@ void main()
|
||||||
|
|
||||||
// Scale output color by the alpha factor (turn LerpAlpha into pre-multiplied alpha)
|
// Scale output color by the alpha factor (turn LerpAlpha into pre-multiplied alpha)
|
||||||
vec3 colorScale = ( alphaFactor < 0.0 ? IN_color.rgb * diffuse.rgb : vec3( alphaFactor > 0.0 ? IN_color.a * diffuse.a * alphaFactor * softBlend : softBlend ) );
|
vec3 colorScale = ( alphaFactor < 0.0 ? IN_color.rgb * diffuse.rgb : vec3( alphaFactor > 0.0 ? IN_color.a * diffuse.a * alphaFactor * softBlend : softBlend ) );
|
||||||
|
if (glow)
|
||||||
|
{
|
||||||
|
vec3 glowCol = (IN_color * diffuse).rgb*10;//pow((IN_color * diffuse).rgb*10,3.54406804435);
|
||||||
|
glowCol*=glowCol*glowCol*0.54406804435;
|
||||||
|
colorScale *= glowCol.rgb;
|
||||||
|
}
|
||||||
OUT_col = hdrEncode( vec4( IN_color.rgb * diffuse.rgb * colorScale,
|
OUT_col = hdrEncode( vec4( IN_color.rgb * diffuse.rgb * colorScale,
|
||||||
IN_color.a * diffuse.a * softBlend * alphaScale ) );
|
IN_color.a * diffuse.a * softBlend * alphaScale ) );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,7 @@ float4 lmSample( float3 nrm )
|
||||||
|
|
||||||
uniform float alphaFactor;
|
uniform float alphaFactor;
|
||||||
uniform float alphaScale;
|
uniform float alphaScale;
|
||||||
|
uniform bool glow;
|
||||||
|
|
||||||
float4 main( Conn IN ) : TORQUE_TARGET0
|
float4 main( Conn IN ) : TORQUE_TARGET0
|
||||||
{
|
{
|
||||||
|
|
@ -102,7 +103,11 @@ float4 main( Conn IN ) : TORQUE_TARGET0
|
||||||
|
|
||||||
// Scale output color by the alpha factor (turn LerpAlpha into pre-multiplied alpha)
|
// Scale output color by the alpha factor (turn LerpAlpha into pre-multiplied alpha)
|
||||||
float3 colorScale = ( alphaFactor < 0.0 ? IN.color.rgb * diffuse.rgb : ( alphaFactor > 0.0 ? IN.color.a * diffuse.a * alphaFactor * softBlend : softBlend ) );
|
float3 colorScale = ( alphaFactor < 0.0 ? IN.color.rgb * diffuse.rgb : ( alphaFactor > 0.0 ? IN.color.a * diffuse.a * alphaFactor * softBlend : softBlend ) );
|
||||||
|
if (glow)
|
||||||
|
{
|
||||||
|
float4 glowCol = float4(pow(max((IN.color * diffuse).rgb*10,0.0),3.54406804435),(IN.color * diffuse).a);
|
||||||
|
colorScale *= glowCol.rgb;
|
||||||
|
}
|
||||||
return hdrEncode( float4( IN.color.rgb * diffuse.rgb * colorScale,
|
return hdrEncode( float4( IN.color.rgb * diffuse.rgb * colorScale,
|
||||||
IN.color.a * diffuse.a * softBlend * alphaScale ) );
|
IN.color.a * diffuse.a * softBlend * alphaScale ) );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,17 +20,6 @@
|
||||||
// IN THE SOFTWARE.
|
// IN THE SOFTWARE.
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
// Check if a script file exists, compiled or not.
|
|
||||||
function isScriptFile(%path)
|
|
||||||
{
|
|
||||||
if( isFile(%path @ ".dso") || isFile(%path) )
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function loadMaterials()
|
function loadMaterials()
|
||||||
{
|
{
|
||||||
loadModuleMaterials();
|
loadModuleMaterials();
|
||||||
|
|
@ -77,7 +66,7 @@ function loadDatablockFiles( %datablockFiles, %recurse )
|
||||||
for ( %i=0; %i < %count; %i++ )
|
for ( %i=0; %i < %count; %i++ )
|
||||||
{
|
{
|
||||||
%file = %datablockFiles.getKey( %i );
|
%file = %datablockFiles.getKey( %i );
|
||||||
if (!isFile(%file) && !isFile(%file @ ".dso") && !isFile(%file @"."@ $TorqueScriptFileExtension @ ".dso") && !isFile(%file @"."@ $TorqueScriptFileExtension))
|
if (!isScriptFile(%file))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
exec( %file );
|
exec( %file );
|
||||||
|
|
@ -100,7 +89,7 @@ function recursiveLoadDatablockFiles( %datablockFiles, %previousErrors )
|
||||||
for ( %i=0; %i < %count; %i++ )
|
for ( %i=0; %i < %count; %i++ )
|
||||||
{
|
{
|
||||||
%file = %datablockFiles.getKey( %i );
|
%file = %datablockFiles.getKey( %i );
|
||||||
if (!isFile(%file) && !isFile(%file @ ".dso") && !isFile(%file @"."@ $TorqueScriptFileExtension @ ".dso") && !isFile(%file @"."@ $TorqueScriptFileExtension))
|
if (!isScriptFile(%file))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Start counting copy constructor creation errors.
|
// Start counting copy constructor creation errors.
|
||||||
|
|
|
||||||
|
|
@ -20,11 +20,11 @@ function @@::onCreateGameServer(%this)
|
||||||
//These are common managed data files. For any datablock-based stuff that gets generated by the editors
|
//These are common managed data files. For any datablock-based stuff that gets generated by the editors
|
||||||
//(that doesn't have a specific associated file, like data for a player class) will go into these.
|
//(that doesn't have a specific associated file, like data for a player class) will go into these.
|
||||||
//So we'll register them now if they exist.
|
//So we'll register them now if they exist.
|
||||||
%this.registerDatablock("./scripts/managedData/managedDatablocks");
|
|
||||||
%this.registerDatablock("./scripts/managedData/managedForestItemData");
|
%this.registerDatablock("./scripts/managedData/managedForestItemData");
|
||||||
%this.registerDatablock("./scripts/managedData/managedForestBrushData");
|
%this.registerDatablock("./scripts/managedData/managedForestBrushData");
|
||||||
%this.registerDatablock("./scripts/managedData/managedParticleData");
|
%this.registerDatablock("./scripts/managedData/managedParticleData");
|
||||||
%this.registerDatablock("./scripts/managedData/managedParticleEmitterData");
|
%this.registerDatablock("./scripts/managedData/managedParticleEmitterData");
|
||||||
|
%this.registerDatablock("./scripts/managedData/managedDatablocks");
|
||||||
//--DATABLOCK EXEC END--
|
//--DATABLOCK EXEC END--
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue