Browse Source

Merge pull request #1963 from elfprince13/exitingTypoFix

Exiting typo fix
Areloch 8 years ago
parent
commit
1867ae26c1
42 changed files with 2973 additions and 1632 deletions
  1. 5 0
      Engine/source/.gitattributes
  2. 23 23
      Engine/source/T3D/aiPlayer.cpp
  3. 1 1
      Engine/source/T3D/camera.cpp
  4. 21 21
      Engine/source/T3D/decal/decalManager.cpp
  5. 9 9
      Engine/source/T3D/fx/lightning.cpp
  6. 9 9
      Engine/source/T3D/physics/bullet/btBody.cpp
  7. 1 1
      Engine/source/T3D/physics/bullet/btWorld.cpp
  8. 4 4
      Engine/source/T3D/physics/physicsShape.cpp
  9. 41 41
      Engine/source/T3D/physics/physx3/px3Body.cpp
  10. 3 3
      Engine/source/T3D/physics/physx3/px3Body.h
  11. 137 137
      Engine/source/T3D/physics/physx3/px3World.cpp
  12. 45 45
      Engine/source/T3D/physics/physx3/px3World.h
  13. 3 3
      Engine/source/T3D/shapeImage.cpp
  14. 68 68
      Engine/source/T3D/staticShape.cpp
  15. 21 21
      Engine/source/T3D/tsStatic.cpp
  16. 1330 0
      Engine/source/T3D/tsStatic.cpp.orig
  17. 10 10
      Engine/source/T3D/vehicles/guiSpeedometer.cpp
  18. 17 17
      Engine/source/app/badWordFilter.cpp
  19. 499 499
      Engine/source/console/CMDscan.cpp
  20. 12 12
      Engine/source/console/SimXMLDocument.h
  21. 1 1
      Engine/source/console/arrayObject.h
  22. 195 195
      Engine/source/console/cmdgram.cpp
  23. 72 72
      Engine/source/console/cmdgram.h
  24. 8 8
      Engine/source/console/compiledEval.cpp
  25. 34 34
      Engine/source/console/console.cpp
  26. 2 2
      Engine/source/console/consoleDoc.cpp
  27. 65 65
      Engine/source/console/consoleFunctions.cpp
  28. 7 7
      Engine/source/console/consoleInternal.cpp
  29. 28 28
      Engine/source/console/consoleLogger.cpp
  30. 29 29
      Engine/source/console/consoleObject.cpp
  31. 25 25
      Engine/source/console/consoleParser.cpp
  32. 16 16
      Engine/source/console/consoleParser.h
  33. 1 1
      Engine/source/console/simManager.cpp
  34. 23 23
      Engine/source/gfx/bitmap/gBitmap.cpp
  35. 2 2
      Engine/source/module/moduleDefinition.cpp
  36. 3 3
      Engine/source/module/moduleDefinition.h
  37. 4 4
      Engine/source/platform/platformNet.cpp
  38. 6 0
      Engine/source/platform/platformNet.h
  39. 110 110
      Engine/source/platform/profiler.cpp
  40. 8 8
      Engine/source/platform/test/netTest.cpp
  41. 1 1
      Engine/source/windowManager/sdl/sdlSplashScreen.cpp
  42. 74 74
      Engine/source/windowManager/sdl/sdlWindow.cpp

+ 5 - 0
Engine/source/.gitattributes

@@ -0,0 +1,5 @@
+*.cpp filter=tabspace
+*.h filter=tabspace
+*.l filter=tabspace
+*.y filter=tabspace
+*.mm filter=tabspace

+ 23 - 23
Engine/source/T3D/aiPlayer.cpp

@@ -35,9 +35,9 @@ static U32 sAIPlayerLoSMask = TerrainObjectType | StaticShapeObjectType | Static
 IMPLEMENT_CO_NETOBJECT_V1(AIPlayer);
 IMPLEMENT_CO_NETOBJECT_V1(AIPlayer);
 
 
 ConsoleDocClass( AIPlayer,
 ConsoleDocClass( AIPlayer,
-	"@brief A Player object not controlled by conventional input, but by an AI engine.\n\n"
+   "@brief A Player object not controlled by conventional input, but by an AI engine.\n\n"
 
 
-	"The AIPlayer provides a Player object that may be controlled from script.  You control "
+   "The AIPlayer provides a Player object that may be controlled from script.  You control "
    "where the player moves and how fast.  You may also set where the AIPlayer is aiming at "
    "where the player moves and how fast.  You may also set where the AIPlayer is aiming at "
    "-- either a location or another game object.\n\n"
    "-- either a location or another game object.\n\n"
 
 
@@ -70,19 +70,19 @@ ConsoleDocClass( AIPlayer,
    "position to the center of the target's bounding box.  The LOS ray test only checks against interiors, "
    "position to the center of the target's bounding box.  The LOS ray test only checks against interiors, "
    "statis shapes, and terrain.\n\n"
    "statis shapes, and terrain.\n\n"
 
 
-	"@tsexample\n"
-	"// Create the demo player object\n"
-	"%player = new AiPlayer()\n"
-	"{\n"
-	"	dataBlock = DemoPlayer;\n"
-	"	path = \"\";\n"
-	"};\n"
-	"@endtsexample\n\n"
+   "@tsexample\n"
+   "// Create the demo player object\n"
+   "%player = new AiPlayer()\n"
+   "{\n"
+   "  dataBlock = DemoPlayer;\n"
+   "  path = \"\";\n"
+   "};\n"
+   "@endtsexample\n\n"
 
 
-	"@see Player for a list of all inherited functions, variables, and base description\n"
+   "@see Player for a list of all inherited functions, variables, and base description\n"
 
 
-	"@ingroup AI\n"
-	"@ingroup gameObjects\n");
+   "@ingroup AI\n"
+   "@ingroup gameObjects\n");
 /**
 /**
  * Constructor
  * Constructor
  */
  */
@@ -147,7 +147,7 @@ void AIPlayer::initPersistFields()
 
 
       addField( "AttackRadius", TypeF32, Offset( mAttackRadius, AIPlayer ), 
       addField( "AttackRadius", TypeF32, Offset( mAttackRadius, AIPlayer ), 
          "@brief Distance considered in firing range for callback purposes.");
          "@brief Distance considered in firing range for callback purposes.");
-      	  
+           
    endGroup( "AI" );
    endGroup( "AI" );
 
 
 #ifdef TORQUE_NAVIGATION_ENABLED
 #ifdef TORQUE_NAVIGATION_ENABLED
@@ -399,11 +399,11 @@ bool AIPlayer::getAIMove(Move *movePtr)
             {
             {
                clearPath();
                clearPath();
                mMoveState = ModeStop;
                mMoveState = ModeStop;
-			   throwCallback("onTargetInRange");
+            throwCallback("onTargetInRange");
             }
             }
             else if((getPosition() - mFollowData.object->getPosition()).len() < mAttackRadius)
             else if((getPosition() - mFollowData.object->getPosition()).len() < mAttackRadius)
             {
             {
-			   throwCallback("onTargetInFiringRange");
+            throwCallback("onTargetInFiringRange");
             }
             }
          }
          }
       }
       }
@@ -854,7 +854,7 @@ DefineEngineMethod(AIPlayer, getPathDestination, Point3F, (),,
 
 
    "@see setPathDestination()\n")
    "@see setPathDestination()\n")
 {
 {
-	return object->getPathDestination();
+   return object->getPathDestination();
 }
 }
 
 
 void AIPlayer::followNavPath(NavPath *path)
 void AIPlayer::followNavPath(NavPath *path)
@@ -1148,7 +1148,7 @@ DefineEngineMethod( AIPlayer, setMoveSpeed, void, ( F32 speed ),,
    
    
    "@see getMoveDestination()\n")
    "@see getMoveDestination()\n")
 {
 {
-	object->setMoveSpeed(speed);
+   object->setMoveSpeed(speed);
 }
 }
 
 
 DefineEngineMethod( AIPlayer, getMoveSpeed, F32, ( ),,
 DefineEngineMethod( AIPlayer, getMoveSpeed, F32, ( ),,
@@ -1186,7 +1186,7 @@ DefineEngineMethod( AIPlayer, getMoveDestination, Point3F, (),,
    
    
    "@see setMoveDestination()\n")
    "@see setMoveDestination()\n")
 {
 {
-	return object->getMoveDestination();
+   return object->getMoveDestination();
 }
 }
 
 
 DefineEngineMethod( AIPlayer, setAimLocation, void, ( Point3F target ),,
 DefineEngineMethod( AIPlayer, setAimLocation, void, ( Point3F target ),,
@@ -1196,7 +1196,7 @@ DefineEngineMethod( AIPlayer, setAimLocation, void, ( Point3F target ),,
    
    
    "@see getAimLocation()\n")
    "@see getAimLocation()\n")
 {
 {
-	object->setAimLocation(target);
+   object->setAimLocation(target);
 }
 }
 
 
 DefineEngineMethod( AIPlayer, getAimLocation, Point3F, (),,
 DefineEngineMethod( AIPlayer, getAimLocation, Point3F, (),,
@@ -1212,7 +1212,7 @@ DefineEngineMethod( AIPlayer, getAimLocation, Point3F, (),,
    "@see setAimLocation()\n"
    "@see setAimLocation()\n"
    "@see setAimObject()\n")
    "@see setAimObject()\n")
 {
 {
-	return object->getAimLocation();
+   return object->getAimLocation();
 }
 }
 
 
 ConsoleDocFragment _setAimObject(
 ConsoleDocFragment _setAimObject(
@@ -1240,7 +1240,7 @@ ConsoleDocFragment _setAimObject(
 
 
 DefineConsoleMethod( AIPlayer, setAimObject, void, ( const char * objName, Point3F offset ), (Point3F::Zero), "( GameBase obj, [Point3F offset] )"
 DefineConsoleMethod( AIPlayer, setAimObject, void, ( const char * objName, Point3F offset ), (Point3F::Zero), "( GameBase obj, [Point3F offset] )"
               "Sets the bot's target object. Optionally set an offset from target location."
               "Sets the bot's target object. Optionally set an offset from target location."
-			  "@hide")
+           "@hide")
 {
 {
 
 
    // Find the target
    // Find the target
@@ -1262,7 +1262,7 @@ DefineEngineMethod( AIPlayer, getAimObject, S32, (),,
    
    
    "@see setAimObject()\n")
    "@see setAimObject()\n")
 {
 {
-	GameBase* obj = object->getAimObject();
+   GameBase* obj = object->getAimObject();
    return obj? obj->getId(): -1;
    return obj? obj->getId(): -1;
 }
 }
 
 

+ 1 - 1
Engine/source/T3D/camera.cpp

@@ -1351,7 +1351,7 @@ void Camera::consoleInit()
    // ExtendedMove support
    // ExtendedMove support
    Con::addVariable("$camera::extendedMovePosRotIndex", TypeS32, &smExtendedMovePosRotIndex, 
    Con::addVariable("$camera::extendedMovePosRotIndex", TypeS32, &smExtendedMovePosRotIndex, 
       "@brief The ExtendedMove position/rotation index used for camera movements.\n\n"
       "@brief The ExtendedMove position/rotation index used for camera movements.\n\n"
-	   "@ingroup BaseCamera\n");
+      "@ingroup BaseCamera\n");
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------

+ 21 - 21
Engine/source/T3D/decal/decalManager.cpp

@@ -546,7 +546,7 @@ void DecalManager::removeDecal( DecalInstance *inst )
 
 
    // Remove the decal from the instance vector.
    // Remove the decal from the instance vector.
    
    
-	if( inst->mId != -1 && inst->mId < mDecalInstanceVec.size() )
+   if( inst->mId != -1 && inst->mId < mDecalInstanceVec.size() )
       mDecalInstanceVec[ inst->mId ] = NULL;
       mDecalInstanceVec[ inst->mId ] = NULL;
    
    
    // Release its geometry (if it has any).
    // Release its geometry (if it has any).
@@ -674,23 +674,23 @@ DecalInstance* DecalManager::raycast( const Point3F &start, const Point3F &end,
 
 
          if ( !worldSphere.intersectsRay( start, end ) )
          if ( !worldSphere.intersectsRay( start, end ) )
             continue;
             continue;
-			
-			RayInfo ri;
-			bool containsPoint = false;
-			if ( gServerContainer.castRayRendered( start, end, STATIC_COLLISION_TYPEMASK, &ri ) )
-			{        
-				Point2F poly[4];
-				poly[0].set( inst->mPosition.x - (inst->mSize / 2), inst->mPosition.y + (inst->mSize / 2));
-				poly[1].set( inst->mPosition.x - (inst->mSize / 2), inst->mPosition.y - (inst->mSize / 2));
-				poly[2].set( inst->mPosition.x + (inst->mSize / 2), inst->mPosition.y - (inst->mSize / 2));
-				poly[3].set( inst->mPosition.x + (inst->mSize / 2), inst->mPosition.y + (inst->mSize / 2));
-				
-				if ( MathUtils::pointInPolygon( poly, 4, Point2F(ri.point.x, ri.point.y) ) )
-					containsPoint = true;
-			}
-
-			if( !containsPoint )
-				continue;
+         
+         RayInfo ri;
+         bool containsPoint = false;
+         if ( gServerContainer.castRayRendered( start, end, STATIC_COLLISION_TYPEMASK, &ri ) )
+         {        
+            Point2F poly[4];
+            poly[0].set( inst->mPosition.x - (inst->mSize / 2), inst->mPosition.y + (inst->mSize / 2));
+            poly[1].set( inst->mPosition.x - (inst->mSize / 2), inst->mPosition.y - (inst->mSize / 2));
+            poly[2].set( inst->mPosition.x + (inst->mSize / 2), inst->mPosition.y - (inst->mSize / 2));
+            poly[3].set( inst->mPosition.x + (inst->mSize / 2), inst->mPosition.y + (inst->mSize / 2));
+            
+            if ( MathUtils::pointInPolygon( poly, 4, Point2F(ri.point.x, ri.point.y) ) )
+               containsPoint = true;
+         }
+
+         if( !containsPoint )
+            continue;
 
 
          hitDecals.push_back( inst );
          hitDecals.push_back( inst );
       }
       }
@@ -1406,7 +1406,7 @@ void DecalManager::prepRenderImage( SceneRenderState* state )
          query.init( rootFrustum.getPosition(),
          query.init( rootFrustum.getPosition(),
                      rootFrustum.getTransform().getForwardVector(),
                      rootFrustum.getTransform().getForwardVector(),
                      rootFrustum.getFarDist() );
                      rootFrustum.getFarDist() );
-		   query.getLights( baseRenderInst.lights, 8 );
+         query.getLights( baseRenderInst.lights, 8 );
       }
       }
 
 
       // Submit render inst...
       // Submit render inst...
@@ -1575,7 +1575,7 @@ void DecalManager::clearData()
    }
    }
    
    
    mData = NULL;
    mData = NULL;
-	mDecalInstanceVec.clear();
+   mDecalInstanceVec.clear();
 
 
    _freePools();   
    _freePools();   
 }
 }
@@ -1758,7 +1758,7 @@ DefineEngineFunction( decalManagerEditDecal, bool, ( S32 decalID, Point3F pos, P
 {
 {
    DecalInstance *decalInstance = gDecalManager->getDecal( decalID );
    DecalInstance *decalInstance = gDecalManager->getDecal( decalID );
    if( !decalInstance )
    if( !decalInstance )
-		return false;
+      return false;
 
 
    //Internally we need Point3F tangent instead of the user friendly F32 rotAroundNormal
    //Internally we need Point3F tangent instead of the user friendly F32 rotAroundNormal
    MatrixF mat( true );
    MatrixF mat( true );

+ 9 - 9
Engine/source/T3D/fx/lightning.cpp

@@ -540,8 +540,8 @@ void Lightning::renderObject(ObjectRenderInst *ri, SceneRenderState *state, Base
    }
    }
 
 
    //GFX->setZWriteEnable(true);
    //GFX->setZWriteEnable(true);
-	//GFX->setAlphaTestEnable(false);
-	//GFX->setAlphaBlendEnable(false);
+   //GFX->setAlphaTestEnable(false);
+   //GFX->setAlphaBlendEnable(false);
 }
 }
 
 
 void Lightning::scheduleThunder(Strike* newStrike)
 void Lightning::scheduleThunder(Strike* newStrike)
@@ -743,9 +743,9 @@ void Lightning::warningFlashes()
       {
       {
          LightningStrikeEvent* pEvent = new LightningStrikeEvent;
          LightningStrikeEvent* pEvent = new LightningStrikeEvent;
          pEvent->mLightning = this;
          pEvent->mLightning = this;
-		 
-		 pEvent->mStart.x = strikePoint.x;
-		 pEvent->mStart.y = strikePoint.y;
+       
+       pEvent->mStart.x = strikePoint.x;
+       pEvent->mStart.y = strikePoint.y;
 
 
          nc->postNetEvent(pEvent);
          nc->postNetEvent(pEvent);
       }
       }
@@ -905,7 +905,7 @@ void Lightning::strikeObject(ShapeBase* targetObj)
       {
       {
          LightningStrikeEvent* pEvent = new LightningStrikeEvent;
          LightningStrikeEvent* pEvent = new LightningStrikeEvent;
          pEvent->mLightning = this;
          pEvent->mLightning = this;
-		 
+       
          pEvent->mStart.x = strikePoint.x;
          pEvent->mStart.x = strikePoint.x;
          pEvent->mStart.y = strikePoint.y;
          pEvent->mStart.y = strikePoint.y;
          pEvent->mTarget = targetObj;
          pEvent->mTarget = targetObj;
@@ -1100,7 +1100,7 @@ void LightningBolt::render( const Point3F &camPos )
          renderSegment(mMinorNodes[i], camPos, false);
          renderSegment(mMinorNodes[i], camPos, false);
    }
    }
 
 
-	PrimBuild::end();
+   PrimBuild::end();
 
 
    for(LightingBoltList::Iterator i = splitList.begin(); i != splitList.end(); ++i)
    for(LightingBoltList::Iterator i = splitList.begin(); i != splitList.end(); ++i)
    {
    {
@@ -1230,7 +1230,7 @@ void LightningBolt::createSplit( const Point3F &startingPoint, const Point3F &en
 {
 {
    if( depth == 0 )
    if( depth == 0 )
       return;
       return;
-	  
+     
    F32 chanceToEnd = gRandGen.randF();
    F32 chanceToEnd = gRandGen.randF();
    if( chanceToEnd > 0.70f )
    if( chanceToEnd > 0.70f )
       return;
       return;
@@ -1275,7 +1275,7 @@ void LightningBolt::startSplits()
    for( U32 i=0; i<mMajorNodes.numNodes-1; i++ )
    for( U32 i=0; i<mMajorNodes.numNodes-1; i++ )
    {
    {
       if( gRandGen.randF() > 0.3f )
       if( gRandGen.randF() > 0.3f )
-	     continue;
+        continue;
 
 
       Node node = mMajorNodes.nodeList[i];
       Node node = mMajorNodes.nodeList[i];
       Node node2 = mMajorNodes.nodeList[i+1];
       Node node2 = mMajorNodes.nodeList[i+1];

+ 9 - 9
Engine/source/T3D/physics/bullet/btBody.cpp

@@ -76,7 +76,7 @@ bool BtBody::init(   PhysicsCollision *shape,
    AssertFatal( shape, "BtBody::init - Got a null collision shape!" );
    AssertFatal( shape, "BtBody::init - Got a null collision shape!" );
    AssertFatal( dynamic_cast<BtCollision*>( shape ), "BtBody::init - The collision shape is the wrong type!" );
    AssertFatal( dynamic_cast<BtCollision*>( shape ), "BtBody::init - The collision shape is the wrong type!" );
    AssertFatal( ((BtCollision*)shape)->getShape(), "BtBody::init - Got empty collision shape!" );
    AssertFatal( ((BtCollision*)shape)->getShape(), "BtBody::init - Got empty collision shape!" );
-	 
+    
    // Cleanup any previous actor.
    // Cleanup any previous actor.
    _releaseActor();
    _releaseActor();
 
 
@@ -97,20 +97,20 @@ bool BtBody::init(   PhysicsCollision *shape,
 
 
          btScalar *masses = new btScalar[ btCompound->getNumChildShapes() ];
          btScalar *masses = new btScalar[ btCompound->getNumChildShapes() ];
          for ( U32 j=0; j < btCompound->getNumChildShapes(); j++ )
          for ( U32 j=0; j < btCompound->getNumChildShapes(); j++ )
-	         masses[j] = mass / btCompound->getNumChildShapes();
+            masses[j] = mass / btCompound->getNumChildShapes();
 
 
          btVector3 principalInertia;
          btVector3 principalInertia;
          btTransform principal;
          btTransform principal;
          btCompound->calculatePrincipalAxisTransform( masses, principal, principalInertia );
          btCompound->calculatePrincipalAxisTransform( masses, principal, principalInertia );
          delete [] masses;
          delete [] masses;
 
 
-	      // Create a new compound with the shifted children.
-	      btColShape = mCompound = new btCompoundShape();
-	      for ( U32 i=0; i < btCompound->getNumChildShapes(); i++ )
-	      {
-		      btTransform newChildTransform = principal.inverse() * btCompound->getChildTransform(i);
-		      mCompound->addChildShape( newChildTransform, btCompound->getChildShape(i) );
-	      }
+         // Create a new compound with the shifted children.
+         btColShape = mCompound = new btCompoundShape();
+         for ( U32 i=0; i < btCompound->getNumChildShapes(); i++ )
+         {
+            btTransform newChildTransform = principal.inverse() * btCompound->getChildTransform(i);
+            mCompound->addChildShape( newChildTransform, btCompound->getChildShape(i) );
+         }
 
 
          localXfm = btCast<MatrixF>( principal );
          localXfm = btCast<MatrixF>( principal );
       }
       }

+ 1 - 1
Engine/source/T3D/physics/bullet/btWorld.cpp

@@ -53,7 +53,7 @@ bool BtWorld::initWorld( bool isServer, ProcessList *processList )
 {
 {
    // Collision configuration contains default setup for memory, collision setup.
    // Collision configuration contains default setup for memory, collision setup.
    mCollisionConfiguration = new btDefaultCollisionConfiguration();
    mCollisionConfiguration = new btDefaultCollisionConfiguration();
-   mDispatcher = new	btCollisionDispatcher( mCollisionConfiguration );
+   mDispatcher = new btCollisionDispatcher( mCollisionConfiguration );
   
   
    btVector3 worldMin( -2000, -2000, -1000 );
    btVector3 worldMin( -2000, -2000, -1000 );
    btVector3 worldMax( 2000, 2000, 1000 );
    btVector3 worldMax( 2000, 2000, 1000 );

+ 4 - 4
Engine/source/T3D/physics/physicsShape.cpp

@@ -242,7 +242,7 @@ void PhysicsShapeData::onRemove()
 
 
 void PhysicsShapeData::_onResourceChanged( const Torque::Path &path )
 void PhysicsShapeData::_onResourceChanged( const Torque::Path &path )
 {
 {
-	if ( path != Path( shapeName ) )
+   if ( path != Path( shapeName ) )
       return;
       return;
 
 
    // Reload the changed shape.
    // Reload the changed shape.
@@ -360,8 +360,8 @@ bool PhysicsShapeData::preload( bool server, String &errorBuffer )
       Vector<FConvexResult*> mHulls;
       Vector<FConvexResult*> mHulls;
    };
    };
 
 
- 	DecompDesc d;
-   d.mVcount       =	polyList.mVertexList.size();
+   DecompDesc d;
+   d.mVcount       = polyList.mVertexList.size();
    d.mVertices     = doubleVerts.address();
    d.mVertices     = doubleVerts.address();
    d.mTcount       = polyList.mIndexList.size() / 3;
    d.mTcount       = polyList.mIndexList.size() / 3;
    d.mIndices      = polyList.mIndexList.address();
    d.mIndices      = polyList.mIndexList.address();
@@ -659,7 +659,7 @@ void PhysicsShape::onRemove()
       PhysicsPlugin::getPhysicsResetSignal().remove( this, &PhysicsShape::_onPhysicsReset );
       PhysicsPlugin::getPhysicsResetSignal().remove( this, &PhysicsShape::_onPhysicsReset );
 
 
       if ( mDestroyedShape )
       if ( mDestroyedShape )
-		  mDestroyedShape->deleteObject();
+        mDestroyedShape->deleteObject();
    }
    }
 
 
    // Remove the resource change signal.
    // Remove the resource change signal.

+ 41 - 41
Engine/source/T3D/physics/physx3/px3Body.cpp

@@ -80,7 +80,7 @@ bool Px3Body::init(   PhysicsCollision *shape,
    AssertFatal( shape, "Px3Body::init - Got a null collision shape!" );
    AssertFatal( shape, "Px3Body::init - Got a null collision shape!" );
    AssertFatal( dynamic_cast<Px3Collision*>( shape ), "Px3Body::init - The collision shape is the wrong type!" );
    AssertFatal( dynamic_cast<Px3Collision*>( shape ), "Px3Body::init - The collision shape is the wrong type!" );
    AssertFatal( !((Px3Collision*)shape)->getShapes().empty(), "Px3Body::init - Got empty collision shape!" );
    AssertFatal( !((Px3Collision*)shape)->getShapes().empty(), "Px3Body::init - Got empty collision shape!" );
-	 
+    
    // Cleanup any previous actor.
    // Cleanup any previous actor.
    _releaseActor();
    _releaseActor();
 
 
@@ -94,10 +94,10 @@ bool Px3Body::init(   PhysicsCollision *shape,
 
 
    if ( isKinematic )
    if ( isKinematic )
    {
    {
-		mActor = gPhysics3SDK->createRigidDynamic(physx::PxTransform(physx::PxIDENTITY()));
-		physx::PxRigidDynamic *actor = mActor->is<physx::PxRigidDynamic>();
-		actor->setRigidDynamicFlag(physx::PxRigidDynamicFlag::eKINEMATIC, true);
-		actor->setMass(getMax( mass, 1.0f ));
+      mActor = gPhysics3SDK->createRigidDynamic(physx::PxTransform(physx::PxIDENTITY()));
+      physx::PxRigidDynamic *actor = mActor->is<physx::PxRigidDynamic>();
+      actor->setRigidDynamicFlag(physx::PxRigidDynamicFlag::eKINEMATIC, true);
+      actor->setMass(getMax( mass, 1.0f ));
    }
    }
    else if ( mass > 0.0f )
    else if ( mass > 0.0f )
    {
    {
@@ -107,7 +107,7 @@ bool Px3Body::init(   PhysicsCollision *shape,
    {
    {
       mActor = gPhysics3SDK->createRigidStatic(physx::PxTransform(physx::PxIDENTITY()));
       mActor = gPhysics3SDK->createRigidStatic(physx::PxTransform(physx::PxIDENTITY()));
       mIsStatic = true;
       mIsStatic = true;
-	}
+   }
 
 
    mMaterial = gPhysics3SDK->createMaterial(0.6f,0.4f,0.1f);
    mMaterial = gPhysics3SDK->createMaterial(0.6f,0.4f,0.1f);
   
   
@@ -115,22 +115,22 @@ bool Px3Body::init(   PhysicsCollision *shape,
    const Vector<Px3CollisionDesc*> &shapes = mColShape->getShapes();
    const Vector<Px3CollisionDesc*> &shapes = mColShape->getShapes();
    for ( U32 i=0; i < shapes.size(); i++ )
    for ( U32 i=0; i < shapes.size(); i++ )
    {
    {
-	   Px3CollisionDesc* desc = shapes[i];
-	   if( mass > 0.0f )
-	   {
-			if(desc->pGeometry->getType() == physx::PxGeometryType::eTRIANGLEMESH)
-			{
-				Con::errorf("PhysX3 Dynamic Triangle Mesh is not supported.");
-			}
-	   }
-	   physx::PxShape * pShape = mActor->createShape(*desc->pGeometry,*mMaterial);
-	   physx::PxFilterData colData;
-	   if(isDebris)
-			colData.word0 = PX3_DEBRIS;
-	   else if(isTrigger)
+      Px3CollisionDesc* desc = shapes[i];
+      if( mass > 0.0f )
+      {
+         if(desc->pGeometry->getType() == physx::PxGeometryType::eTRIANGLEMESH)
+         {
+            Con::errorf("PhysX3 Dynamic Triangle Mesh is not supported.");
+         }
+      }
+      physx::PxShape * pShape = mActor->createShape(*desc->pGeometry,*mMaterial);
+      physx::PxFilterData colData;
+      if(isDebris)
+         colData.word0 = PX3_DEBRIS;
+      else if(isTrigger)
         colData.word0 = PX3_TRIGGER;
         colData.word0 = PX3_TRIGGER;
-	   else
-		   colData.word0 = PX3_DEFAULT;
+      else
+         colData.word0 = PX3_DEFAULT;
 
 
       //set local pose - actor->createShape with a local pose is deprecated in physx 3.3
       //set local pose - actor->createShape with a local pose is deprecated in physx 3.3
       pShape->setLocalPose(desc->pose);
       pShape->setLocalPose(desc->pose);
@@ -145,8 +145,8 @@ bool Px3Body::init(   PhysicsCollision *shape,
    //mass & intertia has to be set after creating the shape
    //mass & intertia has to be set after creating the shape
    if ( mass > 0.0f )
    if ( mass > 0.0f )
    {
    {
-		physx::PxRigidDynamic *actor = mActor->is<physx::PxRigidDynamic>();
-		physx::PxRigidBodyExt::setMassAndUpdateInertia(*actor,mass);
+      physx::PxRigidDynamic *actor = mActor->is<physx::PxRigidDynamic>();
+      physx::PxRigidBodyExt::setMassAndUpdateInertia(*actor,mass);
    }
    }
 
 
     // This sucks, but it has to happen if we want
     // This sucks, but it has to happen if we want
@@ -178,9 +178,9 @@ void Px3Body::setMaterial(  F32 restitution,
       actor->wakeUp();
       actor->wakeUp();
    }
    }
 
 
-	 mMaterial->setRestitution(restitution);
-	 mMaterial->setStaticFriction(staticFriction);
-	 mMaterial->setDynamicFriction(friction);
+    mMaterial->setRestitution(restitution);
+    mMaterial->setStaticFriction(staticFriction);
+    mMaterial->setDynamicFriction(friction);
 
 
 }
 }
 
 
@@ -189,7 +189,7 @@ void Px3Body::setSleepThreshold( F32 linear, F32 angular )
    AssertFatal( mActor, "Px3Body::setSleepThreshold - The actor is null!" );
    AssertFatal( mActor, "Px3Body::setSleepThreshold - The actor is null!" );
 
 
    if(mIsStatic)
    if(mIsStatic)
-	   return;
+      return;
 
 
    physx::PxRigidDynamic *actor = mActor->is<physx::PxRigidDynamic>();
    physx::PxRigidDynamic *actor = mActor->is<physx::PxRigidDynamic>();
    physx::PxF32 massNormalized= (linear*linear+angular*angular)/2.0f;
    physx::PxF32 massNormalized= (linear*linear+angular*angular)/2.0f;
@@ -200,7 +200,7 @@ void Px3Body::setDamping( F32 linear, F32 angular )
 {
 {
    AssertFatal( mActor, "Px3Body::setDamping - The actor is null!" );
    AssertFatal( mActor, "Px3Body::setDamping - The actor is null!" );
    if(mIsStatic)
    if(mIsStatic)
-	   return;
+      return;
 
 
    physx::PxRigidDynamic *actor = mActor->is<physx::PxRigidDynamic>();
    physx::PxRigidDynamic *actor = mActor->is<physx::PxRigidDynamic>();
    actor->setLinearDamping( linear );
    actor->setLinearDamping( linear );
@@ -227,7 +227,7 @@ F32 Px3Body::getMass() const
 {
 {
    AssertFatal( mActor, "PxBody::getCMassPosition - The actor is null!" );
    AssertFatal( mActor, "PxBody::getCMassPosition - The actor is null!" );
    if(mIsStatic)
    if(mIsStatic)
-	   return 0;
+      return 0;
 
 
    const physx::PxRigidDynamic *actor = mActor->is<physx::PxRigidDynamic>();
    const physx::PxRigidDynamic *actor = mActor->is<physx::PxRigidDynamic>();
    return actor->getMass();
    return actor->getMass();
@@ -237,7 +237,7 @@ Point3F Px3Body::getCMassPosition() const
 {
 {
    AssertFatal( mActor, "Px3Body::getCMassPosition - The actor is null!" );
    AssertFatal( mActor, "Px3Body::getCMassPosition - The actor is null!" );
    if(mIsStatic)
    if(mIsStatic)
-	   return px3Cast<Point3F>(mActor->getGlobalPose().p);
+      return px3Cast<Point3F>(mActor->getGlobalPose().p);
 
 
    physx::PxRigidDynamic *actor = mActor->is<physx::PxRigidDynamic>();
    physx::PxRigidDynamic *actor = mActor->is<physx::PxRigidDynamic>();
    physx::PxTransform pose = actor->getGlobalPose() * actor->getCMassLocalPose();
    physx::PxTransform pose = actor->getGlobalPose() * actor->getCMassLocalPose();
@@ -326,11 +326,11 @@ Box3F Px3Body::getWorldBounds()
  
  
   
   
    U32 shapeCount = mActor->getNbShapes();
    U32 shapeCount = mActor->getNbShapes();
-	physx::PxShape **shapes = new physx::PxShape*[shapeCount];
-	mActor->getShapes(shapes, shapeCount);
+   physx::PxShape **shapes = new physx::PxShape*[shapeCount];
+   mActor->getShapes(shapes, shapeCount);
    for ( U32 i = 0; i < shapeCount; i++ )
    for ( U32 i = 0; i < shapeCount; i++ )
    {
    {
-      // Get the shape's bounds.	   
+      // Get the shape's bounds.    
       shapeBounds = physx::PxShapeExt::getWorldBounds(*shapes[i],*mActor);
       shapeBounds = physx::PxShapeExt::getWorldBounds(*shapes[i],*mActor);
       // Combine them into the total bounds.
       // Combine them into the total bounds.
       bounds.include( shapeBounds ); 
       bounds.include( shapeBounds ); 
@@ -355,11 +355,11 @@ void Px3Body::setSimulationEnabled( bool enabled )
    mWorld->releaseWriteLock();
    mWorld->releaseWriteLock();
 
 
    U32 shapeCount = mActor->getNbShapes();
    U32 shapeCount = mActor->getNbShapes();
-	physx::PxShape **shapes = new physx::PxShape*[shapeCount];
-	mActor->getShapes(shapes, shapeCount);
+   physx::PxShape **shapes = new physx::PxShape*[shapeCount];
+   mActor->getShapes(shapes, shapeCount);
    for ( S32 i = 0; i < mActor->getNbShapes(); i++ )
    for ( S32 i = 0; i < mActor->getNbShapes(); i++ )
    {
    {
-	   shapes[i]->setFlag(physx::PxShapeFlag::eSIMULATION_SHAPE,!mIsEnabled);//?????
+      shapes[i]->setFlag(physx::PxShapeFlag::eSIMULATION_SHAPE,!mIsEnabled);//?????
    }
    }
 
 
    delete [] shapes;
    delete [] shapes;
@@ -377,10 +377,10 @@ void Px3Body::setTransform( const MatrixF &transform )
    mActor->setGlobalPose(px3Cast<physx::PxTransform>(transform),false);
    mActor->setGlobalPose(px3Cast<physx::PxTransform>(transform),false);
 
 
    if(mIsStatic)
    if(mIsStatic)
-	   return;
+      return;
 
 
-	physx::PxRigidDynamic *actor = mActor->is<physx::PxRigidDynamic>();
-	bool kinematic = actor->getRigidDynamicFlags() & physx::PxRigidDynamicFlag::eKINEMATIC;
+   physx::PxRigidDynamic *actor = mActor->is<physx::PxRigidDynamic>();
+   bool kinematic = actor->getRigidDynamicFlags() & physx::PxRigidDynamicFlag::eKINEMATIC;
    // If its dynamic we have more to do.
    // If its dynamic we have more to do.
    if ( isDynamic() && !kinematic )
    if ( isDynamic() && !kinematic )
    {
    {
@@ -412,8 +412,8 @@ void Px3Body::applyImpulse( const Point3F &origin, const Point3F &force )
    physx::PxRigidDynamic *actor = mActor->is<physx::PxRigidDynamic>();
    physx::PxRigidDynamic *actor = mActor->is<physx::PxRigidDynamic>();
    if ( mIsEnabled && isDynamic() )
    if ( mIsEnabled && isDynamic() )
    physx::PxRigidBodyExt::addForceAtPos(*actor,px3Cast<physx::PxVec3>(force),
    physx::PxRigidBodyExt::addForceAtPos(*actor,px3Cast<physx::PxVec3>(force),
-												px3Cast<physx::PxVec3>(origin),
-												physx::PxForceMode::eIMPULSE);
+                                    px3Cast<physx::PxVec3>(origin),
+                                    physx::PxForceMode::eIMPULSE);
 
 
 }
 }
 
 

+ 3 - 3
Engine/source/T3D/physics/physx3/px3Body.h

@@ -41,9 +41,9 @@ class Px3Collision;
 struct Px3CollisionDesc;
 struct Px3CollisionDesc;
 
 
 namespace physx{
 namespace physx{
-	class PxRigidActor;
-	class PxMaterial;
-	class PxShape;
+   class PxRigidActor;
+   class PxMaterial;
+   class PxShape;
 }
 }
 
 
 
 

+ 137 - 137
Engine/source/T3D/physics/physx3/px3World.cpp

@@ -71,113 +71,113 @@ Px3World::~Px3World()
 
 
 physx::PxCooking *Px3World::getCooking()
 physx::PxCooking *Px3World::getCooking()
 {
 {
-	return smCooking;
+   return smCooking;
 }
 }
 
 
 bool Px3World::restartSDK( bool destroyOnly, Px3World *clientWorld, Px3World *serverWorld)
 bool Px3World::restartSDK( bool destroyOnly, Px3World *clientWorld, Px3World *serverWorld)
 {
 {
-	// If either the client or the server still exist
-	// then we cannot reset the SDK.
-	if ( clientWorld || serverWorld )
-		return false;
+   // If either the client or the server still exist
+   // then we cannot reset the SDK.
+   if ( clientWorld || serverWorld )
+      return false;
 
 
-	if(smPvdConnection)
-		smPvdConnection->release();
+   if(smPvdConnection)
+      smPvdConnection->release();
 
 
-	if(smCooking)
-		smCooking->release();
+   if(smCooking)
+      smCooking->release();
 
 
-	if(smCpuDispatcher)
-		smCpuDispatcher->release();
+   if(smCpuDispatcher)
+      smCpuDispatcher->release();
 
 
    // Destroy the existing SDK.
    // Destroy the existing SDK.
-	if ( gPhysics3SDK )
-	{
-		PxCloseExtensions();
-		gPhysics3SDK->release();
-	}
+   if ( gPhysics3SDK )
+   {
+      PxCloseExtensions();
+      gPhysics3SDK->release();
+   }
 
 
    if(smErrorCallback)
    if(smErrorCallback)
    {
    {
       SAFE_DELETE(smErrorCallback);
       SAFE_DELETE(smErrorCallback);
    }
    }
 
 
-	if(smFoundation)
-	{
-		smFoundation->release();
-		SAFE_DELETE(smErrorCallback);
-	}
+   if(smFoundation)
+   {
+      smFoundation->release();
+      SAFE_DELETE(smErrorCallback);
+   }
 
 
-	// If we're not supposed to restart... return.
-	if ( destroyOnly )
+   // If we're not supposed to restart... return.
+   if ( destroyOnly )
       return true;
       return true;
 
 
-	bool memTrack = false;
+   bool memTrack = false;
  #ifdef TORQUE_DEBUG
  #ifdef TORQUE_DEBUG
-	memTrack = true;
+   memTrack = true;
  #endif
  #endif
 
 
-	smErrorCallback  = new Px3ConsoleStream;
-	smFoundation = PxCreateFoundation(PX_PHYSICS_VERSION, smMemoryAlloc, *smErrorCallback);
-	smProfileZoneManager = &physx::PxProfileZoneManager::createProfileZoneManager(smFoundation);
-	gPhysics3SDK = PxCreatePhysics(PX_PHYSICS_VERSION, *smFoundation, physx::PxTolerancesScale(),memTrack,smProfileZoneManager);
+   smErrorCallback  = new Px3ConsoleStream;
+   smFoundation = PxCreateFoundation(PX_PHYSICS_VERSION, smMemoryAlloc, *smErrorCallback);
+   smProfileZoneManager = &physx::PxProfileZoneManager::createProfileZoneManager(smFoundation);
+   gPhysics3SDK = PxCreatePhysics(PX_PHYSICS_VERSION, *smFoundation, physx::PxTolerancesScale(),memTrack,smProfileZoneManager);
 
 
-	if ( !gPhysics3SDK )
-	{
-		Con::errorf( "PhysX3 failed to initialize!" );
-		Platform::messageBox(   Con::getVariable( "$appName" ),
+   if ( !gPhysics3SDK )
+   {
+      Con::errorf( "PhysX3 failed to initialize!" );
+      Platform::messageBox(   Con::getVariable( "$appName" ),
                               avar("PhysX3 could not be started!\r\n"),
                               avar("PhysX3 could not be started!\r\n"),
                               MBOk, MIStop );
                               MBOk, MIStop );
-		Platform::forceShutdown( -1 );
+      Platform::forceShutdown( -1 );
       
       
-		// We shouldn't get here, but this shuts up
-		// source diagnostic tools.
-		return false;
-	}
-
-	if(!PxInitExtensions(*gPhysics3SDK))
-	{
-		Con::errorf( "PhysX3 failed to initialize extensions!" );
-		Platform::messageBox(   Con::getVariable( "$appName" ),
+      // We shouldn't get here, but this shuts up
+      // source diagnostic tools.
+      return false;
+   }
+
+   if(!PxInitExtensions(*gPhysics3SDK))
+   {
+      Con::errorf( "PhysX3 failed to initialize extensions!" );
+      Platform::messageBox(   Con::getVariable( "$appName" ),
                               avar("PhysX3 could not be started!\r\n"),
                               avar("PhysX3 could not be started!\r\n"),
                               MBOk, MIStop );
                               MBOk, MIStop );
-		Platform::forceShutdown( -1 );
-		return false;
-	}
-
-	smCooking = PxCreateCooking(PX_PHYSICS_VERSION, *smFoundation, physx::PxCookingParams(physx::PxTolerancesScale()));
-	if(!smCooking)
-	{
-		Con::errorf( "PhysX3 failed to initialize cooking!" );
-		Platform::messageBox(   Con::getVariable( "$appName" ),
+      Platform::forceShutdown( -1 );
+      return false;
+   }
+
+   smCooking = PxCreateCooking(PX_PHYSICS_VERSION, *smFoundation, physx::PxCookingParams(physx::PxTolerancesScale()));
+   if(!smCooking)
+   {
+      Con::errorf( "PhysX3 failed to initialize cooking!" );
+      Platform::messageBox(   Con::getVariable( "$appName" ),
                               avar("PhysX3 could not be started!\r\n"),
                               avar("PhysX3 could not be started!\r\n"),
                               MBOk, MIStop );
                               MBOk, MIStop );
-		Platform::forceShutdown( -1 );      
-		return false;
-	}
+      Platform::forceShutdown( -1 );      
+      return false;
+   }
 
 
 #ifdef TORQUE_DEBUG
 #ifdef TORQUE_DEBUG
-	physx::PxVisualDebuggerConnectionFlags connectionFlags(physx::PxVisualDebuggerExt::getAllConnectionFlags());
-	smPvdConnection = physx::PxVisualDebuggerExt::createConnection(gPhysics3SDK->getPvdConnectionManager(), 
-				"localhost", 5425, 100, connectionFlags);	
+   physx::PxVisualDebuggerConnectionFlags connectionFlags(physx::PxVisualDebuggerExt::getAllConnectionFlags());
+   smPvdConnection = physx::PxVisualDebuggerExt::createConnection(gPhysics3SDK->getPvdConnectionManager(), 
+            "localhost", 5425, 100, connectionFlags); 
 #endif
 #endif
 
 
-	return true;
+   return true;
 }
 }
 
 
 void Px3World::destroyWorld()
 void Px3World::destroyWorld()
 {
 {
-	getPhysicsResults();
+   getPhysicsResults();
 
 
    mRenderBuffer = NULL;
    mRenderBuffer = NULL;
 
 
-	// Release the tick processing signals.
-	if ( mProcessList )
-	{
-		mProcessList->preTickSignal().remove( this, &Px3World::getPhysicsResults );
-		mProcessList->postTickSignal().remove( this, &Px3World::tickPhysics );
-		mProcessList = NULL;
-	}
+   // Release the tick processing signals.
+   if ( mProcessList )
+   {
+      mProcessList->preTickSignal().remove( this, &Px3World::getPhysicsResults );
+      mProcessList->postTickSignal().remove( this, &Px3World::tickPhysics );
+      mProcessList = NULL;
+   }
 
 
    if(mControllerManager)
    if(mControllerManager)
    {
    {
@@ -185,13 +185,13 @@ void Px3World::destroyWorld()
       mControllerManager = NULL;
       mControllerManager = NULL;
    }
    }
    
    
-	// Destroy the scene.
-	if ( mScene )
-	{
-		// Release the scene.
-		mScene->release();
-		mScene = NULL;
-	}
+   // Destroy the scene.
+   if ( mScene )
+   {
+      // Release the scene.
+      mScene->release();
+      mScene = NULL;
+   }
 }
 }
 
 
 bool Px3World::initWorld( bool isServer, ProcessList *processList )
 bool Px3World::initWorld( bool isServer, ProcessList *processList )
@@ -203,7 +203,7 @@ bool Px3World::initWorld( bool isServer, ProcessList *processList )
    }
    }
 
 
    mIsServer = isServer;
    mIsServer = isServer;
-	
+   
    physx::PxSceneDesc sceneDesc(gPhysics3SDK->getTolerancesScale());
    physx::PxSceneDesc sceneDesc(gPhysics3SDK->getTolerancesScale());
 
 
    sceneDesc.gravity = px3Cast<physx::PxVec3>(mGravity);
    sceneDesc.gravity = px3Cast<physx::PxVec3>(mGravity);
@@ -217,26 +217,26 @@ bool Px3World::initWorld( bool isServer, ProcessList *processList )
       sceneDesc.cpuDispatcher = smCpuDispatcher;
       sceneDesc.cpuDispatcher = smCpuDispatcher;
       Con::printf("PhysX3 using Cpu: %d workers", smCpuDispatcher->getWorkerCount());
       Con::printf("PhysX3 using Cpu: %d workers", smCpuDispatcher->getWorkerCount());
    }
    }
- 	
+   
    sceneDesc.flags |= physx::PxSceneFlag::eENABLE_CCD;
    sceneDesc.flags |= physx::PxSceneFlag::eENABLE_CCD;
    sceneDesc.flags |= physx::PxSceneFlag::eENABLE_ACTIVETRANSFORMS;
    sceneDesc.flags |= physx::PxSceneFlag::eENABLE_ACTIVETRANSFORMS;
    sceneDesc.filterShader  = physx::PxDefaultSimulationFilterShader;
    sceneDesc.filterShader  = physx::PxDefaultSimulationFilterShader;
 
 
-	mScene = gPhysics3SDK->createScene(sceneDesc);
+   mScene = gPhysics3SDK->createScene(sceneDesc);
    //cache renderbuffer for use with debug drawing
    //cache renderbuffer for use with debug drawing
    mRenderBuffer = const_cast<physx::PxRenderBuffer*>(&mScene->getRenderBuffer());
    mRenderBuffer = const_cast<physx::PxRenderBuffer*>(&mScene->getRenderBuffer());
 
 
-	physx::PxDominanceGroupPair debrisDominance( 0.0f, 1.0f );
-	mScene->setDominanceGroupPair(0,31,debrisDominance);
+   physx::PxDominanceGroupPair debrisDominance( 0.0f, 1.0f );
+   mScene->setDominanceGroupPair(0,31,debrisDominance);
 
 
    mControllerManager = PxCreateControllerManager(*mScene);
    mControllerManager = PxCreateControllerManager(*mScene);
 
 
-	AssertFatal( processList, "Px3World::init() - We need a process list to create the world!" );
-	mProcessList = processList;
-	mProcessList->preTickSignal().notify( this, &Px3World::getPhysicsResults );
-	mProcessList->postTickSignal().notify( this, &Px3World::tickPhysics, 1000.0f );
+   AssertFatal( processList, "Px3World::init() - We need a process list to create the world!" );
+   mProcessList = processList;
+   mProcessList->preTickSignal().notify( this, &Px3World::getPhysicsResults );
+   mProcessList->postTickSignal().notify( this, &Px3World::tickPhysics, 1000.0f );
 
 
-	return true;
+   return true;
 }
 }
 // Most of this borrowed from bullet physics library, see btDiscreteDynamicsWorld.cpp
 // Most of this borrowed from bullet physics library, see btDiscreteDynamicsWorld.cpp
 bool Px3World::_simulate(const F32 dt)
 bool Px3World::_simulate(const F32 dt)
@@ -249,21 +249,21 @@ bool Px3World::_simulate(const F32 dt)
       numSimulationSubSteps = S32(mAccumulator / smPhysicsStepTime);
       numSimulationSubSteps = S32(mAccumulator / smPhysicsStepTime);
       mAccumulator -= numSimulationSubSteps * smPhysicsStepTime;
       mAccumulator -= numSimulationSubSteps * smPhysicsStepTime;
    }
    }
-	if (numSimulationSubSteps)
-	{
-		//clamp the number of substeps, to prevent simulation grinding spiralling down to a halt
-		S32 clampedSimulationSteps = (numSimulationSubSteps > smPhysicsMaxSubSteps)? smPhysicsMaxSubSteps : numSimulationSubSteps;
-		
-		for (S32 i=0;i<clampedSimulationSteps;i++)
-		{
-			mScene->fetchResults(true);
-			mScene->simulate(smPhysicsStepTime);
-		}
-	}
-	
-	mIsSimulating = true;
-
-	return true;
+   if (numSimulationSubSteps)
+   {
+      //clamp the number of substeps, to prevent simulation grinding spiralling down to a halt
+      S32 clampedSimulationSteps = (numSimulationSubSteps > smPhysicsMaxSubSteps)? smPhysicsMaxSubSteps : numSimulationSubSteps;
+      
+      for (S32 i=0;i<clampedSimulationSteps;i++)
+      {
+         mScene->fetchResults(true);
+         mScene->simulate(smPhysicsStepTime);
+      }
+   }
+   
+   mIsSimulating = true;
+
+   return true;
 }
 }
 
 
 void Px3World::tickPhysics( U32 elapsedMs )
 void Px3World::tickPhysics( U32 elapsedMs )
@@ -290,45 +290,45 @@ void Px3World::tickPhysics( U32 elapsedMs )
 
 
 void Px3World::getPhysicsResults()
 void Px3World::getPhysicsResults()
 {
 {
-	if ( !mScene || !mIsSimulating ) 
-		return;
+   if ( !mScene || !mIsSimulating ) 
+      return;
 
 
-	PROFILE_SCOPE(Px3World_GetPhysicsResults);
+   PROFILE_SCOPE(Px3World_GetPhysicsResults);
 
 
-	// Get results from scene.
-	mScene->fetchResults(true);
-	mIsSimulating = false;
-	mTickCount++;
+   // Get results from scene.
+   mScene->fetchResults(true);
+   mIsSimulating = false;
+   mTickCount++;
 
 
   // Con::printf( "%s PhysXWorld::getPhysicsResults!", this == smClientWorld ? "Client" : "Server" );
   // Con::printf( "%s PhysXWorld::getPhysicsResults!", this == smClientWorld ? "Client" : "Server" );
 }
 }
 
 
 void Px3World::releaseWriteLocks()
 void Px3World::releaseWriteLocks()
 {
 {
-	Px3World *world = dynamic_cast<Px3World*>( PHYSICSMGR->getWorld( "server" ) );
+   Px3World *world = dynamic_cast<Px3World*>( PHYSICSMGR->getWorld( "server" ) );
 
 
-	if ( world )
-		world->releaseWriteLock();
+   if ( world )
+      world->releaseWriteLock();
 
 
-	world = dynamic_cast<Px3World*>( PHYSICSMGR->getWorld( "client" ) );
+   world = dynamic_cast<Px3World*>( PHYSICSMGR->getWorld( "client" ) );
 
 
-	if ( world )
-		world->releaseWriteLock();
+   if ( world )
+      world->releaseWriteLock();
 }
 }
 
 
 void Px3World::releaseWriteLock()
 void Px3World::releaseWriteLock()
 {
 {
-	if ( !mScene || !mIsSimulating ) 
-		return;
+   if ( !mScene || !mIsSimulating ) 
+      return;
 
 
-	PROFILE_SCOPE(PxWorld_ReleaseWriteLock);
+   PROFILE_SCOPE(PxWorld_ReleaseWriteLock);
 
 
-	// We use checkResults here to release the write lock
-	// but we do not change the simulation flag or increment
-	// the tick count... we may have gotten results, but the
-	// simulation hasn't really ticked!
-	mScene->checkResults( true );
-	//AssertFatal( mScene->isWritable(), "PhysX3World::releaseWriteLock() - We should have been writable now!" );
+   // We use checkResults here to release the write lock
+   // but we do not change the simulation flag or increment
+   // the tick count... we may have gotten results, but the
+   // simulation hasn't really ticked!
+   mScene->checkResults( true );
+   //AssertFatal( mScene->isWritable(), "PhysX3World::releaseWriteLock() - We should have been writable now!" );
 }
 }
 
 
 void Px3World::lockScenes()
 void Px3World::lockScenes()
@@ -390,7 +390,7 @@ void Px3World::unlockScene()
 bool Px3World::castRay( const Point3F &startPnt, const Point3F &endPnt, RayInfo *ri, const Point3F &impulse )
 bool Px3World::castRay( const Point3F &startPnt, const Point3F &endPnt, RayInfo *ri, const Point3F &impulse )
 {
 {
     
     
-	physx::PxVec3 orig = px3Cast<physx::PxVec3>( startPnt );
+   physx::PxVec3 orig = px3Cast<physx::PxVec3>( startPnt );
    physx::PxVec3 dir = px3Cast<physx::PxVec3>( endPnt - startPnt );
    physx::PxVec3 dir = px3Cast<physx::PxVec3>( endPnt - startPnt );
    physx::PxF32 maxDist = dir.magnitude();
    physx::PxF32 maxDist = dir.magnitude();
    dir.normalize();
    dir.normalize();
@@ -404,11 +404,11 @@ bool Px3World::castRay( const Point3F &startPnt, const Point3F &endPnt, RayInfo
    physx::PxRaycastBuffer buf;
    physx::PxRaycastBuffer buf;
 
 
    if(!mScene->raycast(orig,dir,maxDist,buf,outFlags,filterData))
    if(!mScene->raycast(orig,dir,maxDist,buf,outFlags,filterData))
-	  return false;
+     return false;
    if(!buf.hasBlock)
    if(!buf.hasBlock)
-	 return false;
+    return false;
 
 
-	const physx::PxRaycastHit hit = buf.block;
+   const physx::PxRaycastHit hit = buf.block;
    physx::PxRigidActor *actor = hit.actor;
    physx::PxRigidActor *actor = hit.actor;
    PhysicsUserData *userData = PhysicsUserData::cast( actor->userData );
    PhysicsUserData *userData = PhysicsUserData::cast( actor->userData );
 
 
@@ -456,15 +456,15 @@ PhysicsBody* Px3World::castRay( const Point3F &start, const Point3F &end, U32 bo
    physx::PxHitFlags outFlags(physx::PxHitFlag::eDISTANCE | physx::PxHitFlag::eIMPACT | physx::PxHitFlag::eNORMAL);
    physx::PxHitFlags outFlags(physx::PxHitFlag::eDISTANCE | physx::PxHitFlag::eIMPACT | physx::PxHitFlag::eNORMAL);
    physx::PxQueryFilterData filterData;
    physx::PxQueryFilterData filterData;
    if(bodyTypes & BT_Static)
    if(bodyTypes & BT_Static)
-	   filterData.flags |= physx::PxQueryFlag::eSTATIC;
+      filterData.flags |= physx::PxQueryFlag::eSTATIC;
    if(bodyTypes & BT_Dynamic)
    if(bodyTypes & BT_Dynamic)
-	   filterData.flags |= physx::PxQueryFlag::eDYNAMIC;
+      filterData.flags |= physx::PxQueryFlag::eDYNAMIC;
 
 
    filterData.data.word0 = groups;
    filterData.data.word0 = groups;
    physx::PxRaycastBuffer buf;  
    physx::PxRaycastBuffer buf;  
 
 
    if( !mScene->raycast(orig,dir,maxDist,buf,outFlags,filterData) )
    if( !mScene->raycast(orig,dir,maxDist,buf,outFlags,filterData) )
-	   return NULL;
+      return NULL;
    if(!buf.hasBlock)
    if(!buf.hasBlock)
       return NULL;
       return NULL;
 
 
@@ -478,7 +478,7 @@ PhysicsBody* Px3World::castRay( const Point3F &start, const Point3F &end, U32 bo
 
 
 void Px3World::explosion( const Point3F &pos, F32 radius, F32 forceMagnitude )
 void Px3World::explosion( const Point3F &pos, F32 radius, F32 forceMagnitude )
 {
 {
-	physx::PxVec3 nxPos = px3Cast<physx::PxVec3>( pos );
+   physx::PxVec3 nxPos = px3Cast<physx::PxVec3>( pos );
    const physx::PxU32 bufferSize = 10;
    const physx::PxU32 bufferSize = 10;
    physx::PxSphereGeometry worldSphere(radius);
    physx::PxSphereGeometry worldSphere(radius);
    physx::PxTransform pose(nxPos);
    physx::PxTransform pose(nxPos);
@@ -520,14 +520,14 @@ void Px3World::setEnabled( bool enabled )
 
 
 physx::PxController* Px3World::createController( physx::PxControllerDesc &desc )
 physx::PxController* Px3World::createController( physx::PxControllerDesc &desc )
 {
 {
-	if ( !mScene )
-		return NULL;
-
-	// We need the writelock!
-	releaseWriteLock();
-	physx::PxController* pController = mControllerManager->createController(desc);
-	AssertFatal( pController, "Px3World::createController - Got a null!" );
-	return pController;
+   if ( !mScene )
+      return NULL;
+
+   // We need the writelock!
+   releaseWriteLock();
+   physx::PxController* pController = mControllerManager->createController(desc);
+   AssertFatal( pController, "Px3World::createController - Got a null!" );
+   return pController;
 }
 }
 
 
 static ColorI getDebugColor( physx::PxU32 packed )
 static ColorI getDebugColor( physx::PxU32 packed )

+ 45 - 45
Engine/source/T3D/physics/physx3/px3World.h

@@ -42,66 +42,66 @@ class FixedStepper;
 
 
 enum Px3CollisionGroup
 enum Px3CollisionGroup
 {
 {
-	PX3_DEFAULT = BIT(0),
-	PX3_PLAYER = BIT(1),
-	PX3_DEBRIS = BIT(2),
-	PX3_TRIGGER = BIT(3),
+   PX3_DEFAULT = BIT(0),
+   PX3_PLAYER = BIT(1),
+   PX3_DEBRIS = BIT(2),
+   PX3_TRIGGER = BIT(3),
 };
 };
 
 
 class Px3World : public PhysicsWorld
 class Px3World : public PhysicsWorld
 {
 {
 protected:
 protected:
 
 
-	physx::PxScene* mScene;
-	bool mIsEnabled;
-	bool mIsSimulating;
-	bool mIsServer;
+   physx::PxScene* mScene;
+   bool mIsEnabled;
+   bool mIsSimulating;
+   bool mIsServer;
    bool mIsSceneLocked;
    bool mIsSceneLocked;
-	U32 mTickCount;
-	ProcessList *mProcessList;
-	F32 mEditorTimeScale;
-	bool mErrorReport;
+   U32 mTickCount;
+   ProcessList *mProcessList;
+   F32 mEditorTimeScale;
+   bool mErrorReport;
    physx::PxRenderBuffer *mRenderBuffer;
    physx::PxRenderBuffer *mRenderBuffer;
-	physx::PxControllerManager* mControllerManager;
-	static Px3ConsoleStream *smErrorCallback;
-	static physx::PxDefaultAllocator smMemoryAlloc;
-	static physx::PxFoundation* smFoundation;
-	static physx::PxCooking *smCooking;
-	static physx::PxProfileZoneManager* smProfileZoneManager;
-	static physx::PxDefaultCpuDispatcher* smCpuDispatcher;
-	static physx::PxVisualDebuggerConnection* smPvdConnection;
-	F32 mAccumulator;
-	bool _simulate(const F32 dt);
+   physx::PxControllerManager* mControllerManager;
+   static Px3ConsoleStream *smErrorCallback;
+   static physx::PxDefaultAllocator smMemoryAlloc;
+   static physx::PxFoundation* smFoundation;
+   static physx::PxCooking *smCooking;
+   static physx::PxProfileZoneManager* smProfileZoneManager;
+   static physx::PxDefaultCpuDispatcher* smCpuDispatcher;
+   static physx::PxVisualDebuggerConnection* smPvdConnection;
+   F32 mAccumulator;
+   bool _simulate(const F32 dt);
 
 
 public:
 public:
 
 
-	Px3World();
-	virtual ~Px3World();
+   Px3World();
+   virtual ~Px3World();
 
 
-	virtual bool initWorld( bool isServer, ProcessList *processList );
-	virtual void destroyWorld();
-	virtual void onDebugDraw( const SceneRenderState *state );
-	virtual void reset() {}
-	virtual bool castRay( const Point3F &startPnt, const Point3F &endPnt, RayInfo *ri, const Point3F &impulse );
-	virtual PhysicsBody* castRay( const Point3F &start, const Point3F &end, U32 bodyTypes = BT_All );
-	virtual void explosion( const Point3F &pos, F32 radius, F32 forceMagnitude ); 
-	virtual bool isEnabled() const { return mIsEnabled; }
-	physx::PxScene* getScene(){ return mScene;}
-	void setEnabled( bool enabled );
-	U32 getTick() { return mTickCount; }
+   virtual bool initWorld( bool isServer, ProcessList *processList );
+   virtual void destroyWorld();
+   virtual void onDebugDraw( const SceneRenderState *state );
+   virtual void reset() {}
+   virtual bool castRay( const Point3F &startPnt, const Point3F &endPnt, RayInfo *ri, const Point3F &impulse );
+   virtual PhysicsBody* castRay( const Point3F &start, const Point3F &end, U32 bodyTypes = BT_All );
+   virtual void explosion( const Point3F &pos, F32 radius, F32 forceMagnitude ); 
+   virtual bool isEnabled() const { return mIsEnabled; }
+   physx::PxScene* getScene(){ return mScene;}
+   void setEnabled( bool enabled );
+   U32 getTick() { return mTickCount; }
    void tickPhysics( U32 elapsedMs );
    void tickPhysics( U32 elapsedMs );
-	void getPhysicsResults();
-	void setEditorTimeScale( F32 timeScale ) { mEditorTimeScale = timeScale; }
-	const F32 getEditorTimeScale() const { return mEditorTimeScale; }
-	void releaseWriteLock();
-	bool isServer(){return mIsServer;}
-	physx::PxController* createController( physx::PxControllerDesc &desc );
+   void getPhysicsResults();
+   void setEditorTimeScale( F32 timeScale ) { mEditorTimeScale = timeScale; }
+   const F32 getEditorTimeScale() const { return mEditorTimeScale; }
+   void releaseWriteLock();
+   bool isServer(){return mIsServer;}
+   physx::PxController* createController( physx::PxControllerDesc &desc );
    void lockScene();
    void lockScene();
    void unlockScene();
    void unlockScene();
-	//static
-	static bool restartSDK( bool destroyOnly = false, Px3World *clientWorld = NULL, Px3World *serverWorld = NULL );
-	static void releaseWriteLocks();
-	static physx::PxCooking *getCooking();
+   //static
+   static bool restartSDK( bool destroyOnly = false, Px3World *clientWorld = NULL, Px3World *serverWorld = NULL );
+   static void releaseWriteLocks();
+   static physx::PxCooking *getCooking();
    static void lockScenes();
    static void lockScenes();
    static void unlockScenes();
    static void unlockScenes();
 };
 };

+ 3 - 3
Engine/source/T3D/shapeImage.cpp

@@ -80,7 +80,7 @@ EndImplementEnumType;
 ImplementEnumType( ShapeBaseImageLightType,
 ImplementEnumType( ShapeBaseImageLightType,
    "@brief The type of light to attach to this ShapeBaseImage.\n\n"
    "@brief The type of light to attach to this ShapeBaseImage.\n\n"
    "@ingroup gameObjects\n\n")
    "@ingroup gameObjects\n\n")
-	{ ShapeBaseImageData::NoLight,           "NoLight", "No light is attached.\n" },
+   { ShapeBaseImageData::NoLight,           "NoLight", "No light is attached.\n" },
    { ShapeBaseImageData::ConstantLight,     "ConstantLight", "A constant emitting light is attached.\n" },
    { ShapeBaseImageData::ConstantLight,     "ConstantLight", "A constant emitting light is attached.\n" },
    { ShapeBaseImageData::SpotLight,         "SpotLight", "A spotlight is attached.\n" },
    { ShapeBaseImageData::SpotLight,         "SpotLight", "A spotlight is attached.\n" },
    { ShapeBaseImageData::PulsingLight,      "PulsingLight", "A pusling light is attached.\n" },
    { ShapeBaseImageData::PulsingLight,      "PulsingLight", "A pusling light is attached.\n" },
@@ -1532,7 +1532,7 @@ bool ShapeBase::unmountImage(U32 imageSlot)
 {
 {
    AssertFatal(imageSlot<MaxMountedImages,"Out of range image slot");
    AssertFatal(imageSlot<MaxMountedImages,"Out of range image slot");
 
 
-	bool returnValue = false;
+   bool returnValue = false;
    MountedImage& image = mMountedImageList[imageSlot];
    MountedImage& image = mMountedImageList[imageSlot];
    if (image.dataBlock)
    if (image.dataBlock)
    {
    {
@@ -2772,7 +2772,7 @@ void ShapeBase::setImageState(U32 imageSlot, U32 newState,bool force)
    if( stateData.sound && isGhost() )
    if( stateData.sound && isGhost() )
    {
    {
       const Point3F& velocity         = getVelocity();
       const Point3F& velocity         = getVelocity();
-	   image.addSoundSource(SFX->createSource( stateData.sound, &getRenderTransform(), &velocity )); 
+      image.addSoundSource(SFX->createSource( stateData.sound, &getRenderTransform(), &velocity )); 
    }
    }
 
 
    // Play animation
    // Play animation

+ 68 - 68
Engine/source/T3D/staticShape.cpp

@@ -45,48 +45,48 @@ static const U32 sgAllowedDynamicTypes = 0xffffff;
 IMPLEMENT_CO_DATABLOCK_V1(StaticShapeData);
 IMPLEMENT_CO_DATABLOCK_V1(StaticShapeData);
 
 
 ConsoleDocClass( StaticShapeData,
 ConsoleDocClass( StaticShapeData,
-	"@brief The most basic ShapeBaseData derrived shape datablock available in Torque 3D.\n\n"
+   "@brief The most basic ShapeBaseData derrived shape datablock available in Torque 3D.\n\n"
 
 
-	"When it comes to placing 3D objects in the scene, you effectively have two options:\n\n"
-	"1. TSStatic objects\n\n"
-	"2. ShapeBase derived objects\n\n"
+   "When it comes to placing 3D objects in the scene, you effectively have two options:\n\n"
+   "1. TSStatic objects\n\n"
+   "2. ShapeBase derived objects\n\n"
 
 
-	"Since ShapeBase and ShapeBaseData are not meant to be instantiated in script, you "
-	"will use one of its child classes instead. Several game related objects are derived "
-	"from ShapeBase: Player, Vehicle, Item, and so on.\n\n"
+   "Since ShapeBase and ShapeBaseData are not meant to be instantiated in script, you "
+   "will use one of its child classes instead. Several game related objects are derived "
+   "from ShapeBase: Player, Vehicle, Item, and so on.\n\n"
 
 
-	"When you need a 3D object with datablock capabilities, you will use an object derived "
-	"from ShapeBase. When you need an object with extremely low overhead, and with no other "
-	"purpose than to be a 3D object in the scene, you will use TSStatic.\n\n"
+   "When you need a 3D object with datablock capabilities, you will use an object derived "
+   "from ShapeBase. When you need an object with extremely low overhead, and with no other "
+   "purpose than to be a 3D object in the scene, you will use TSStatic.\n\n"
 
 
-	"The most basic child of ShapeBase is StaticShape. It does not introduce any of the "
-	"additional functionality you see in Player, Item, Vehicle or the other game play "
-	"heavy classes. At its core, it is comparable to a TSStatic, but with a datbalock.  Having "
+   "The most basic child of ShapeBase is StaticShape. It does not introduce any of the "
+   "additional functionality you see in Player, Item, Vehicle or the other game play "
+   "heavy classes. At its core, it is comparable to a TSStatic, but with a datbalock.  Having "
    "a datablock provides a location for common variables as well as having access to "
    "a datablock provides a location for common variables as well as having access to "
    "various ShapeBaseData, GameBaseData and SimDataBlock callbacks.\n\n"
    "various ShapeBaseData, GameBaseData and SimDataBlock callbacks.\n\n"
 
 
-	"@tsexample\n"
-	   "// Create a StaticShape using a datablock\n"
-	   "datablock StaticShapeData(BasicShapeData)\n" 
-	   "{\n"
-	   "	shapeFile = \"art/shapes/items/kit/healthkit.dts\";\n"
-	   "	testVar = \"Simple string, not a stock variable\";\n"
-	   "};\n\n"
-	   "new StaticShape()\n"
-	   "{\n"
-	   "	dataBlock = \"BasicShapeData\";\n"
-	   "	position = \"0.0 0.0 0.0\";\n"
-	   "	rotation = \"1 0 0 0\";\n"
-	   "	scale = \"1 1 1\";\n"
-	   "};\n"
-	"@endtsexample\n\n"
-
-	"@see StaticShape\n"
+   "@tsexample\n"
+      "// Create a StaticShape using a datablock\n"
+      "datablock StaticShapeData(BasicShapeData)\n" 
+      "{\n"
+      "  shapeFile = \"art/shapes/items/kit/healthkit.dts\";\n"
+      "  testVar = \"Simple string, not a stock variable\";\n"
+      "};\n\n"
+      "new StaticShape()\n"
+      "{\n"
+      "  dataBlock = \"BasicShapeData\";\n"
+      "  position = \"0.0 0.0 0.0\";\n"
+      "  rotation = \"1 0 0 0\";\n"
+      "  scale = \"1 1 1\";\n"
+      "};\n"
+   "@endtsexample\n\n"
+
+   "@see StaticShape\n"
    "@see ShapeBaseData\n"
    "@see ShapeBaseData\n"
-	"@see TSStatic\n\n"
+   "@see TSStatic\n\n"
 
 
-	"@ingroup gameObjects\n"
-	"@ingroup Datablocks");
+   "@ingroup gameObjects\n"
+   "@ingroup Datablocks");
 
 
 StaticShapeData::StaticShapeData()
 StaticShapeData::StaticShapeData()
 {
 {
@@ -128,47 +128,47 @@ void StaticShapeData::unpackData(BitStream* stream)
 IMPLEMENT_CO_NETOBJECT_V1(StaticShape);
 IMPLEMENT_CO_NETOBJECT_V1(StaticShape);
 
 
 ConsoleDocClass( StaticShape,
 ConsoleDocClass( StaticShape,
-	"@brief The most basic 3D shape with a datablock available in Torque 3D.\n\n"
+   "@brief The most basic 3D shape with a datablock available in Torque 3D.\n\n"
 
 
-	"When it comes to placing 3D objects in the scene, you technically have two options:\n\n"
-	"1. TSStatic objects\n\n"
-	"2. ShapeBase derived objects\n\n"
+   "When it comes to placing 3D objects in the scene, you technically have two options:\n\n"
+   "1. TSStatic objects\n\n"
+   "2. ShapeBase derived objects\n\n"
 
 
-	"Since ShapeBase and ShapeBaseData are not meant to be instantiated in script, you "
-	"will use one of its child classes instead. Several game related objects are derived "
-	"from ShapeBase: Player, Vehicle, Item, and so on.\n\n"
+   "Since ShapeBase and ShapeBaseData are not meant to be instantiated in script, you "
+   "will use one of its child classes instead. Several game related objects are derived "
+   "from ShapeBase: Player, Vehicle, Item, and so on.\n\n"
 
 
-	"When you need a 3D object with datablock capabilities, you will use an object derived "
-	"from ShapeBase. When you need an object with extremely low overhead, and with no other "
-	"purpose than to be a 3D object in the scene, you will use TSStatic.\n\n"
+   "When you need a 3D object with datablock capabilities, you will use an object derived "
+   "from ShapeBase. When you need an object with extremely low overhead, and with no other "
+   "purpose than to be a 3D object in the scene, you will use TSStatic.\n\n"
 
 
-	"The most basic child of ShapeBase is StaticShape. It does not introduce any of the "
-	"additional functionality you see in Player, Item, Vehicle or the other game play "
-	"heavy classes. At its core, it is comparable to a TSStatic, but with a datbalock.  Having "
+   "The most basic child of ShapeBase is StaticShape. It does not introduce any of the "
+   "additional functionality you see in Player, Item, Vehicle or the other game play "
+   "heavy classes. At its core, it is comparable to a TSStatic, but with a datbalock.  Having "
    "a datablock provides a location for common variables as well as having access to "
    "a datablock provides a location for common variables as well as having access to "
    "various ShapeBaseData, GameBaseData and SimDataBlock callbacks.\n\n"
    "various ShapeBaseData, GameBaseData and SimDataBlock callbacks.\n\n"
 
 
-	"@tsexample\n"
-	   "// Create a StaticShape using a datablock\n"
-	   "datablock StaticShapeData(BasicShapeData)\n" 
-	   "{\n"
-	   "	shapeFile = \"art/shapes/items/kit/healthkit.dts\";\n"
-	   "	testVar = \"Simple string, not a stock variable\";\n"
-	   "};\n\n"
-	   "new StaticShape()\n"
-	   "{\n"
-	   "	dataBlock = \"BasicShapeData\";\n"
-	   "	position = \"0.0 0.0 0.0\";\n"
-	   "	rotation = \"1 0 0 0\";\n"
-	   "	scale = \"1 1 1\";\n"
-	   "};\n"
-	"@endtsexample\n\n"
-
-	"@see StaticShapeData\n"
-	"@see ShapeBase\n"
-	"@see TSStatic\n\n"
-
-	"@ingroup gameObjects\n");
+   "@tsexample\n"
+      "// Create a StaticShape using a datablock\n"
+      "datablock StaticShapeData(BasicShapeData)\n" 
+      "{\n"
+      "  shapeFile = \"art/shapes/items/kit/healthkit.dts\";\n"
+      "  testVar = \"Simple string, not a stock variable\";\n"
+      "};\n\n"
+      "new StaticShape()\n"
+      "{\n"
+      "  dataBlock = \"BasicShapeData\";\n"
+      "  position = \"0.0 0.0 0.0\";\n"
+      "  rotation = \"1 0 0 0\";\n"
+      "  scale = \"1 1 1\";\n"
+      "};\n"
+   "@endtsexample\n\n"
+
+   "@see StaticShapeData\n"
+   "@see ShapeBase\n"
+   "@see TSStatic\n\n"
+
+   "@ingroup gameObjects\n");
 
 
 StaticShape::StaticShape()
 StaticShape::StaticShape()
 {
 {
@@ -303,7 +303,7 @@ void StaticShape::unpackUpdate(NetConnection *connection, BitStream *bstream)
 // Marked internal, as this is flagged to be deleted
 // Marked internal, as this is flagged to be deleted
 // [8/1/2010 mperry]
 // [8/1/2010 mperry]
 DefineConsoleMethod( StaticShape, setPoweredState, void, (bool isPowered), , "(bool isPowered)"
 DefineConsoleMethod( StaticShape, setPoweredState, void, (bool isPowered), , "(bool isPowered)"
-			  "@internal")
+           "@internal")
 {
 {
    if(!object->isServerObject())
    if(!object->isServerObject())
       return;
       return;

+ 21 - 21
Engine/source/T3D/tsStatic.cpp

@@ -1222,17 +1222,17 @@ DefineEngineMethod( TSStatic, getTargetName, const char*, ( S32 index ),(0),
    "@return the name of the indexed material.\n"
    "@return the name of the indexed material.\n"
    "@see getTargetCount()\n")
    "@see getTargetCount()\n")
 {
 {
-	TSStatic *obj = dynamic_cast< TSStatic* > ( object );
-	if(obj)
-	{
-		// Try to use the client object (so we get the reskinned targets in the Material Editor)
-		if ((TSStatic*)obj->getClientObject())
-			obj = (TSStatic*)obj->getClientObject();
+   TSStatic *obj = dynamic_cast< TSStatic* > ( object );
+   if(obj)
+   {
+      // Try to use the client object (so we get the reskinned targets in the Material Editor)
+      if ((TSStatic*)obj->getClientObject())
+         obj = (TSStatic*)obj->getClientObject();
 
 
-		return obj->getShapeInstance()->getTargetName(index);
-	}
+      return obj->getShapeInstance()->getTargetName(index);
+   }
 
 
-	return "";
+   return "";
 }
 }
 
 
 DefineEngineMethod( TSStatic, getTargetCount, S32,(),,
 DefineEngineMethod( TSStatic, getTargetCount, S32,(),,
@@ -1240,17 +1240,17 @@ DefineEngineMethod( TSStatic, getTargetCount, S32,(),,
    "@return the number of materials in the shape.\n"
    "@return the number of materials in the shape.\n"
    "@see getTargetName()\n")
    "@see getTargetName()\n")
 {
 {
-	TSStatic *obj = dynamic_cast< TSStatic* > ( object );
-	if(obj)
-	{
-		// Try to use the client object (so we get the reskinned targets in the Material Editor)
-		if ((TSStatic*)obj->getClientObject())
-			obj = (TSStatic*)obj->getClientObject();
+   TSStatic *obj = dynamic_cast< TSStatic* > ( object );
+   if(obj)
+   {
+      // Try to use the client object (so we get the reskinned targets in the Material Editor)
+      if ((TSStatic*)obj->getClientObject())
+         obj = (TSStatic*)obj->getClientObject();
 
 
-		return obj->getShapeInstance()->getTargetCount();
-	}
+      return obj->getShapeInstance()->getTargetCount();
+   }
 
 
-	return -1;
+   return -1;
 }
 }
 
 
 // This method is able to change materials per map to with others. The material that is being replaced is being mapped to
 // This method is able to change materials per map to with others. The material that is being replaced is being mapped to
@@ -1317,10 +1317,10 @@ DefineEngineMethod( TSStatic, getModelFile, const char *, (),,
 
 
    "@return the shape filename\n\n"
    "@return the shape filename\n\n"
    "@tsexample\n"
    "@tsexample\n"
-		"// Acquire the model filename used on this shape.\n"
-		"%modelFilename = %obj.getModelFile();\n"
+      "// Acquire the model filename used on this shape.\n"
+      "%modelFilename = %obj.getModelFile();\n"
    "@endtsexample\n"
    "@endtsexample\n"
    )
    )
 {
 {
-	return object->getShapeFileName();
+   return object->getShapeFileName();
 }
 }

+ 1330 - 0
Engine/source/T3D/tsStatic.cpp.orig

@@ -0,0 +1,1330 @@
+//-----------------------------------------------------------------------------
+// Copyright (c) 2012 GarageGames, LLC
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+
+#include "platform/platform.h"
+#include "T3D/tsStatic.h"
+
+#include "core/resourceManager.h"
+#include "core/stream/bitStream.h"
+#include "scene/sceneRenderState.h"
+#include "scene/sceneManager.h"
+#include "scene/sceneObjectLightingPlugin.h"
+#include "lighting/lightManager.h"
+#include "math/mathIO.h"
+#include "ts/tsShapeInstance.h"
+#include "ts/tsMaterialList.h"
+#include "console/consoleTypes.h"
+#include "T3D/shapeBase.h"
+#include "sim/netConnection.h"
+#include "gfx/gfxDevice.h"
+#include "gfx/gfxTransformSaver.h"
+#include "ts/tsRenderState.h"
+#include "collision/boxConvex.h"
+#include "T3D/physics/physicsPlugin.h"
+#include "T3D/physics/physicsBody.h"
+#include "T3D/physics/physicsCollision.h"
+#include "materials/materialDefinition.h"
+#include "materials/materialManager.h"
+#include "materials/matInstance.h"
+#include "materials/materialFeatureData.h"
+#include "materials/materialFeatureTypes.h"
+#include "console/engineAPI.h"
+#include "T3D/accumulationVolume.h"
+
+using namespace Torque;
+
+extern bool gEditingMission;
+
+IMPLEMENT_CO_NETOBJECT_V1(TSStatic);
+
+ConsoleDocClass( TSStatic,
+	"@brief A static object derived from a 3D model file and placed within the game world.\n\n"
+
+	"TSStatic is the most basic 3D shape in Torque.	 Unlike StaticShape it doesn't make use of "
+	"a datablock.	It derrives directly from SceneObject.	 This makes TSStatic extremely light "
+	"weight, which is why the Tools use this class when you want to drop in a DTS or DAE object.\n\n"
+
+	"While a TSStatic doesn't provide any motion -- it stays were you initally put it -- it does allow for "
+	"a single ambient animation sequence to play when the object is first added to the scene.\n\n"
+
+	"@tsexample\n"
+			"new TSStatic(Team1Base) {\n"
+			"	 shapeName = \"art/shapes/desertStructures/station01.dts\";\n"
+			"	 playAmbient = \"1\";\n"
+			"	 receiveSunLight = \"1\";\n"
+			"	 receiveLMLighting = \"1\";\n"
+			"	 useCustomAmbientLighting = \"0\";\n"
+			"	 customAmbientLighting = \"0 0 0 1\";\n"
+			"	 collisionType = \"Visible Mesh\";\n"
+			"	 decalType = \"Collision Mesh\";\n"
+			"	 allowPlayerStep = \"1\";\n"
+			"	 renderNormals = \"0\";\n"
+			"	 forceDetail = \"-1\";\n"
+			"	 position = \"315.18 -180.418 244.313\";\n"
+			"	 rotation = \"0 0 1 195.952\";\n"
+			"	 scale = \"1 1 1\";\n"
+			"	 isRenderEnabled = \"true\";\n"
+			"	 canSaveDynamicFields = \"1\";\n"
+			"};\n"
+	"@endtsexample\n"
+
+	"@ingroup gameObjects\n"
+);
+
+TSStatic::TSStatic()
+:
+	cubeDescId( 0 ),
+	reflectorDesc( NULL )
+{
+	mNetFlags.set(Ghostable | ScopeAlways);
+
+	mTypeMask |= StaticObjectType | StaticShapeObjectType;
+
+	mShapeName			= "";
+	mShapeInstance		= NULL;
+
+	mPlayAmbient		= true;
+	mAmbientThread		= NULL;
+
+	mAllowPlayerStep = false;
+
+	mConvexList = new Convex;
+
+	mRenderNormalScalar = 0;
+	mForceDetail = -1;
+
+	mMeshCulling = false;
+	mUseOriginSort = false;
+
+	mUseAlphaFade		= false;
+	mAlphaFadeStart	= 100.0f;
+	mAlphaFadeEnd		= 150.0f;
+	mInvertAlphaFade	= false;
+	mAlphaFade = 1.0f;
+	mPhysicsRep = NULL;
+
+	mCollisionType = CollisionMesh;
+	mDecalType = CollisionMesh;
+}
+
+TSStatic::~TSStatic()
+{
+	delete mConvexList;
+	mConvexList = NULL;
+}
+
+ImplementEnumType( TSMeshType,
+	"Type of mesh data available in a shape.\n"
+	"@ingroup gameObjects" )
+	{ TSStatic::None,				"None",				"No mesh data." },
+	{ TSStatic::Bounds,			"Bounds",			"Bounding box of the shape." },
+	{ TSStatic::CollisionMesh, "Collision Mesh", "Specifically desingated \"collision\" meshes." },
+	{ TSStatic::VisibleMesh,	"Visible Mesh",	"Rendered mesh polygons." },
+EndImplementEnumType;
+
+
+void TSStatic::initPersistFields()
+{
+	addGroup("Media");
+
+		addField("shapeName",	TypeShapeFilename,  Offset( mShapeName, TSStatic ),
+			"%Path and filename of the model file (.DTS, .DAE) to use for this TSStatic." );
+
+		addProtectedField( "skin", TypeRealString, Offset( mAppliedSkinName, TSStatic ), &_setFieldSkin, &_getFieldSkin,
+		"@brief The skin applied to the shape.\n\n"
+
+		"'Skinning' the shape effectively renames the material targets, allowing "
+		"different materials to be used on different instances of the same model.\n\n"
+
+		"Any material targets that start with the old skin name have that part "
+		"of the name replaced with the new skin name. The initial old skin name is "
+		"\"base\". For example, if a new skin of \"blue\" was applied to a model "
+		"that had material targets <i>base_body</i> and <i>face</i>, the new targets "
+		"would be <i>blue_body</i> and <i>face</i>. Note that <i>face</i> was not "
+		"renamed since it did not start with the old skin name of \"base\".\n\n"
+
+		"To support models that do not use the default \"base\" naming convention, "
+		"you can also specify the part of the name to replace in the skin field "
+		"itself. For example, if a model had a material target called <i>shapemat</i>, "
+		"we could apply a new skin \"shape=blue\", and the material target would be "
+		"renamed to <i>bluemat</i> (note \"shape\" has been replaced with \"blue\").\n\n"
+
+		"Multiple skin updates can also be applied at the same time by separating "
+		"them with a semicolon. For example: \"base=blue;face=happy_face\".\n\n"
+
+		"Material targets are only renamed if an existing Material maps to that "
+		"name, or if there is a diffuse texture in the model folder with the same "
+		"name as the new target.\n\n" );
+
+	endGroup("Media");
+
+	addGroup("Rendering");
+
+		addField( "playAmbient",	TypeBool,	Offset( mPlayAmbient, TSStatic ),
+			"Enables automatic playing of the animation sequence named \"ambient\" (if it exists) when the TSStatic is loaded.");
+		addField( "meshCulling",	TypeBool,	Offset( mMeshCulling, TSStatic ), 
+			"Enables detailed culling of meshes within the TSStatic. Should only be used "
+			"with large complex shapes like buildings which contain many submeshes." );
+		addField( "originSort",		TypeBool,	Offset( mUseOriginSort, TSStatic ), 
+			"Enables translucent sorting of the TSStatic by its origin instead of the bounds." );
+
+	endGroup("Rendering");
+
+	addGroup( "Reflection" );
+		addField( "cubeReflectorDesc", TypeRealString, Offset( cubeDescName, TSStatic ), 
+			"References a ReflectorDesc datablock that defines performance and quality properties for dynamic reflections.\n");
+	endGroup( "Reflection" );
+
+	addGroup("Collision");
+
+		addField( "collisionType",		TypeTSMeshType,	Offset( mCollisionType,	  TSStatic ),
+			"The type of mesh data to use for collision queries." );
+		addField( "decalType",			TypeTSMeshType,	Offset( mDecalType,	 TSStatic ),
+			"The type of mesh data used to clip decal polygons against." );
+		addField( "allowPlayerStep",	TypeBool,			Offset( mAllowPlayerStep, TSStatic ), 
+			"@brief Allow a Player to walk up sloping polygons in the TSStatic (based on the collisionType).\n\n"
+			"When set to false, the slightest bump will stop the player from walking on top of the object.\n");
+	
+	endGroup("Collision");
+
+	addGroup( "AlphaFade" );  
+		addField( "alphaFadeEnable",	 TypeBool,	 Offset(mUseAlphaFade,	  TSStatic), "Turn on/off Alpha Fade" );	
+		addField( "alphaFadeStart",	 TypeF32,	 Offset(mAlphaFadeStart,  TSStatic), "Distance of start Alpha Fade" );	
+		addField( "alphaFadeEnd",		 TypeF32,	 Offset(mAlphaFadeEnd,	  TSStatic), "Distance of end Alpha Fade" );	 
+		addField( "alphaFadeInverse", TypeBool,	 Offset(mInvertAlphaFade, TSStatic), "Invert Alpha Fade's Start & End Distance" );	
+	endGroup( "AlphaFade" );
+
+	addGroup("Debug");
+
+		addField( "renderNormals", TypeF32, Offset( mRenderNormalScalar, TSStatic ),
+			"Debug rendering mode shows the normals for each point in the TSStatic's mesh." );
+		addField( "forceDetail",	TypeS32, Offset( mForceDetail, TSStatic ),
+			"Forces rendering to a particular detail level." );
+
+	endGroup("Debug");
+
+	Parent::initPersistFields();
+}
+
+bool TSStatic::_setFieldSkin( void *object, const char *index, const char *data )
+{
+	TSStatic *ts = static_cast<TSStatic*>( object );
+	if ( ts )
+		ts->setSkinName( data );
+	return false;
+}
+
+const char *TSStatic::_getFieldSkin( void *object, const char *data )
+{
+	TSStatic *ts = static_cast<TSStatic*>( object );
+	return ts ? ts->mSkinNameHandle.getString() : "";
+}
+
+void TSStatic::inspectPostApply()
+{
+	// Apply any transformations set in the editor
+	Parent::inspectPostApply();
+
+	if(isServerObject()) 
+	{
+		setMaskBits(AdvancedStaticOptionsMask);
+		prepCollision();
+	}
+
+	_updateShouldTick();
+}
+
+bool TSStatic::onAdd()
+{
+	PROFILE_SCOPE(TSStatic_onAdd);
+
+	if ( isServerObject() )
+	{
+		// Handle the old "usePolysoup" field
+		SimFieldDictionary* fieldDict = getFieldDictionary();
+
+		if ( fieldDict )
+		{
+			StringTableEntry slotName = StringTable->insert( "usePolysoup" );
+
+			SimFieldDictionary::Entry * entry = fieldDict->findDynamicField( slotName );
+
+			if ( entry )
+			{
+				// Was "usePolysoup" set?
+				bool usePolysoup = dAtob( entry->value );
+
+				// "usePolysoup" maps to the new VisibleMesh type
+				if ( usePolysoup )
+					mCollisionType = VisibleMesh;
+
+				// Remove the field in favor on the new "collisionType" field
+				fieldDict->setFieldValue( slotName, "" );
+			}
+		}
+	}
+
+	if ( !Parent::onAdd() )
+		return false;
+
+	// Setup the shape.
+	if ( !_createShape() )
+	{
+		Con::errorf( "TSStatic::onAdd() - Shape creation failed!" );
+		return false;
+	}
+
+	setRenderTransform(mObjToWorld);
+
+	// Register for the resource change signal.
+	ResourceManager::get().getChangedSignal().notify( this, &TSStatic::_onResourceChanged );
+
+	addToScene();
+
+	if ( isClientObject() )
+	{		 
+		mCubeReflector.unregisterReflector();
+
+		if ( reflectorDesc )
+			mCubeReflector.registerReflector( this, reflectorDesc );		  
+	}
+
+	_updateShouldTick();
+
+	// Accumulation and environment mapping
+	if (isClientObject() && mShapeInstance)
+	{
+		AccumulationVolume::addObject(this);
+	}
+
+	return true;
+}
+
+bool TSStatic::_createShape()
+{
+	// Cleanup before we create.
+	mCollisionDetails.clear();
+	mLOSDetails.clear();
+	SAFE_DELETE( mPhysicsRep );
+	SAFE_DELETE( mShapeInstance );
+	mAmbientThread = NULL;
+	mShape = NULL;
+
+	if (!mShapeName || mShapeName[0] == '\0') 
+	{
+		Con::errorf( "TSStatic::_createShape() - No shape name!" );
+		return false;
+	}
+
+	mShapeHash = _StringTable::hashString(mShapeName);
+
+	mShape = ResourceManager::get().load(mShapeName);
+	if ( bool(mShape) == false )
+	{
+		Con::errorf( "TSStatic::_createShape() - Unable to load shape: %s", mShapeName );
+		return false;
+	}
+
+	if (	isClientObject() && 
+			!mShape->preloadMaterialList(mShape.getPath()) && 
+			NetConnection::filesWereDownloaded() )
+		return false;
+
+	mObjBox = mShape->bounds;
+	resetWorldBox();
+
+	mShapeInstance = new TSShapeInstance( mShape, isClientObject() );
+
+	if( isGhost() )
+	{
+		// Reapply the current skin
+		mAppliedSkinName = "";
+		reSkin();
+	}
+
+	prepCollision();
+
+	// Find the "ambient" animation if it exists
+	S32 ambientSeq = mShape->findSequence("ambient");
+
+	if ( ambientSeq > -1 && !mAmbientThread )
+		mAmbientThread = mShapeInstance->addThread();
+
+	if ( mAmbientThread )
+		mShapeInstance->setSequence( mAmbientThread, ambientSeq, 0);
+
+	// Resolve CubeReflectorDesc.
+	if ( cubeDescName.isNotEmpty() )
+	{
+		Sim::findObject( cubeDescName, reflectorDesc );
+	}
+	else if( cubeDescId > 0 )
+	{
+		Sim::findObject( cubeDescId, reflectorDesc );
+	}
+
+	return true;
+}
+
+void TSStatic::prepCollision()
+{
+	// Let the client know that the collision was updated
+	setMaskBits( UpdateCollisionMask );
+
+	// Allow the ShapeInstance to prep its collision if it hasn't already
+	if ( mShapeInstance )
+		mShapeInstance->prepCollision();
+
+	// Cleanup any old collision data
+	mCollisionDetails.clear();
+	mLOSDetails.clear();
+	mConvexList->nukeList();
+
+	if ( mCollisionType == CollisionMesh || mCollisionType == VisibleMesh )
+		mShape->findColDetails( mCollisionType == VisibleMesh, &mCollisionDetails, &mLOSDetails );
+
+	_updatePhysics();
+}
+
+void TSStatic::_updatePhysics()
+{
+	SAFE_DELETE( mPhysicsRep );
+
+	if ( !PHYSICSMGR || mCollisionType == None )
+		return;
+
+	PhysicsCollision *colShape = NULL;
+	if ( mCollisionType == Bounds )
+	{
+		MatrixF offset( true );
+		offset.setPosition( mShape->center );
+		colShape = PHYSICSMGR->createCollision();
+		colShape->addBox( getObjBox().getExtents() * 0.5f * mObjScale, offset );			
+	}
+	else
+		colShape = mShape->buildColShape( mCollisionType == VisibleMesh, getScale() );
+
+	if ( colShape )
+	{
+		PhysicsWorld *world = PHYSICSMGR->getWorld( isServerObject() ? "server" : "client" );
+		mPhysicsRep = PHYSICSMGR->createBody();
+		mPhysicsRep->init( colShape, 0, 0, this, world );
+		mPhysicsRep->setTransform( getTransform() );
+	}
+}
+
+void TSStatic::onRemove()
+{
+	SAFE_DELETE( mPhysicsRep );
+
+	// Accumulation
+	if ( isClientObject() && mShapeInstance )
+	{
+		if ( mShapeInstance->hasAccumulation() ) 
+			AccumulationVolume::removeObject(this);
+	}
+
+	mConvexList->nukeList();
+
+	removeFromScene();
+
+	// Remove the resource change signal.
+	ResourceManager::get().getChangedSignal().remove( this, &TSStatic::_onResourceChanged );
+
+	delete mShapeInstance;
+	mShapeInstance = NULL;
+
+	mAmbientThread = NULL;
+	if ( isClientObject() )
+		 mCubeReflector.unregisterReflector();
+
+	Parent::onRemove();
+}
+
+void TSStatic::_onResourceChanged( const Torque::Path &path )
+{
+	if ( path != Path( mShapeName ) )
+		return;
+	
+	_createShape();
+	_updateShouldTick();
+}
+
+void TSStatic::setSkinName( const char *name )
+{
+	if ( !isGhost() )
+	{
+		if ( name[0] != '\0' )
+		{
+			// Use tags for better network performance
+			// Should be a tag, but we'll convert to one if it isn't.
+			if ( name[0] == StringTagPrefixByte )
+				mSkinNameHandle = NetStringHandle( U32(dAtoi(name + 1)) );
+			else
+				mSkinNameHandle = NetStringHandle( name );
+		}
+		else
+			mSkinNameHandle = NetStringHandle();
+
+		setMaskBits( SkinMask );
+	}
+}
+
+void TSStatic::reSkin()
+{
+	if ( isGhost() && mShapeInstance && mSkinNameHandle.isValidString() )
+	{
+		Vector<String> skins;
+		String(mSkinNameHandle.getString()).split( ";", skins );
+
+		for (S32 i = 0; i < skins.size(); i++)
+		{
+			String oldSkin( mAppliedSkinName.c_str() );
+			String newSkin( skins[i] );
+
+			// Check if the skin handle contains an explicit "old" base string. This
+			// allows all models to support skinning, even if they don't follow the 
+			// "base_xxx" material naming convention.
+			S32 split = newSkin.find( '=' );		// "old=new" format skin?
+			if ( split != String::NPos )
+			{
+				oldSkin = newSkin.substr( 0, split );
+				newSkin = newSkin.erase( 0, split+1 );
+			}
+
+			mShapeInstance->reSkin( newSkin, oldSkin );
+			mAppliedSkinName = newSkin;
+		}
+	}
+}
+
+void TSStatic::processTick( const Move *move )
+{
+	if ( isServerObject() && mPlayAmbient && mAmbientThread )
+		mShapeInstance->advanceTime( TickSec, mAmbientThread );
+
+	if ( isMounted() )
+	{
+		MatrixF mat( true );
+		mMount.object->getMountTransform(mMount.node, mMount.xfm, &mat );
+		setTransform( mat );
+	}
+}
+
+void TSStatic::interpolateTick( F32 delta )
+{
+}
+
+void TSStatic::advanceTime( F32 dt )
+{
+	if ( mPlayAmbient && mAmbientThread )
+		mShapeInstance->advanceTime( dt, mAmbientThread );
+
+	if ( isMounted() )
+	{
+		MatrixF mat( true );
+		mMount.object->getRenderMountTransform( dt, mMount.node, mMount.xfm, &mat );
+		setRenderTransform( mat );
+	}
+}
+
+void TSStatic::_updateShouldTick()
+{
+	bool shouldTick = (mPlayAmbient && mAmbientThread) || isMounted();
+
+	if ( isTicking() != shouldTick )
+		setProcessTick( shouldTick );
+}
+
+void TSStatic::prepRenderImage( SceneRenderState* state )
+{
+	if( !mShapeInstance )
+		return;
+
+	Point3F cameraOffset;
+	getRenderTransform().getColumn(3,&cameraOffset);
+	cameraOffset -= state->getDiffuseCameraPosition();
+	F32 dist = cameraOffset.len();
+	if (dist < 0.01f)
+		dist = 0.01f;
+
+	if (mUseAlphaFade)
+	{
+		mAlphaFade = 1.0f;
+		if ((mAlphaFadeStart < mAlphaFadeEnd) && mAlphaFadeStart > 0.1f)
+		{
+			if (mInvertAlphaFade)
+			{
+				if (dist <= mAlphaFadeStart)
+				{
+					return;
+				}
+				if (dist < mAlphaFadeEnd)
+				{
+					mAlphaFade = ((dist - mAlphaFadeStart) / (mAlphaFadeEnd - mAlphaFadeStart));
+				}
+			}
+			else
+			{
+				if (dist >= mAlphaFadeEnd)
+				{
+					return;
+				}
+				if (dist > mAlphaFadeStart)
+				{
+					mAlphaFade -= ((dist - mAlphaFadeStart) / (mAlphaFadeEnd - mAlphaFadeStart));
+				}
+			}
+		}
+	}
+
+	F32 invScale = (1.0f/getMax(getMax(mObjScale.x,mObjScale.y),mObjScale.z));	  
+
+	// If we're currently rendering our own reflection we
+	// don't want to render ourselves into it.
+	if ( mCubeReflector.isRendering() )
+		return;
+
+
+	if ( mForceDetail == -1 )
+		mShapeInstance->setDetailFromDistance( state, dist * invScale );
+	else
+		mShapeInstance->setCurrentDetail( mForceDetail );
+
+	if ( mShapeInstance->getCurrentDetail() < 0 )
+		return;
+
+	GFXTransformSaver saver;
+	
+	// Set up our TS render state.
+	TSRenderState rdata;
+	rdata.setSceneState( state );
+	rdata.setFadeOverride( 1.0f );
+	rdata.setOriginSort( mUseOriginSort );
+
+	if ( mCubeReflector.isEnabled() )
+		rdata.setCubemap( mCubeReflector.getCubemap() );
+
+	// Acculumation
+	rdata.setAccuTex(mAccuTex);
+
+	// If we have submesh culling enabled then prepare
+	// the object space frustum to pass to the shape.
+	Frustum culler;
+	if ( mMeshCulling )
+	{
+		culler = state->getCullingFrustum();
+		MatrixF xfm( true );
+		xfm.scale( Point3F::One / getScale() );
+		xfm.mul( getRenderWorldTransform() );
+		xfm.mul( culler.getTransform() );
+		culler.setTransform( xfm );
+		rdata.setCuller( &culler );
+	}
+
+	// We might have some forward lit materials
+	// so pass down a query to gather lights.
+	LightQuery query;
+	query.init( getWorldSphere() );
+	rdata.setLightQuery( &query );
+
+	MatrixF mat = getRenderTransform();
+	mat.scale( mObjScale );
+	GFX->setWorldMatrix( mat );
+
+	if ( state->isDiffusePass() && mCubeReflector.isEnabled() && mCubeReflector.getOcclusionQuery() )
+	{
+		 RenderPassManager *pass = state->getRenderPass();
+		 OccluderRenderInst *ri = pass->allocInst<OccluderRenderInst>();	
+		 
+		 ri->type = RenderPassManager::RIT_Occluder;
+		 ri->query = mCubeReflector.getOcclusionQuery();
+		 mObjToWorld.mulP( mObjBox.getCenter(), &ri->position );
+		 ri->scale.set( mObjBox.getExtents() );
+		 ri->orientation = pass->allocUniqueXform( mObjToWorld ); 
+		 ri->isSphere = false;
+		 state->getRenderPass()->addInst( ri );
+	}
+
+	mShapeInstance->animate();
+	if(mShapeInstance)
+	{
+		if (mUseAlphaFade)
+		{
+			mShapeInstance->setAlphaAlways(mAlphaFade);
+			S32 s = mShapeInstance->mMeshObjects.size();
+			
+			for(S32 x = 0; x < s; x++)
+			{
+				mShapeInstance->mMeshObjects[x].visible = mAlphaFade;
+			}
+		}
+	}
+	mShapeInstance->render( rdata );
+
+	if ( mRenderNormalScalar > 0 )
+	{
+		ObjectRenderInst *ri = state->getRenderPass()->allocInst<ObjectRenderInst>();
+		ri->renderDelegate.bind( this, &TSStatic::_renderNormals );
+		ri->type = RenderPassManager::RIT_Editor;
+		state->getRenderPass()->addInst( ri );
+	}
+}
+
+void TSStatic::_renderNormals( ObjectRenderInst *ri, SceneRenderState *state, BaseMatInstance *overrideMat )
+{
+	PROFILE_SCOPE( TSStatic_RenderNormals );
+
+	GFXTransformSaver saver;
+
+	MatrixF mat = getRenderTransform();
+	mat.scale( mObjScale );
+	GFX->multWorld( mat );
+
+	S32 dl = mShapeInstance->getCurrentDetail();
+	mShapeInstance->renderDebugNormals( mRenderNormalScalar, dl );
+}
+
+void TSStatic::onScaleChanged()
+{
+	Parent::onScaleChanged();
+
+	if ( mPhysicsRep )
+	{
+		// If the editor is enabled delay the scale operation
+		// by a few milliseconds so that we're not rebuilding
+		// during an active scale drag operation.
+		if ( gEditingMission )
+			mPhysicsRep->queueCallback( 500, Delegate<void()>( this, &TSStatic::_updatePhysics ) );
+		else
+			_updatePhysics();
+	}
+
+	setMaskBits( ScaleMask );
+}
+
+void TSStatic::setTransform(const MatrixF & mat)
+{
+	Parent::setTransform(mat);
+	if ( !isMounted() )
+		setMaskBits( TransformMask );
+
+	if ( mPhysicsRep )
+		mPhysicsRep->setTransform( mat );
+
+	// Accumulation
+	if ( isClientObject() && mShapeInstance )
+	{
+		if ( mShapeInstance->hasAccumulation() ) 
+			AccumulationVolume::updateObject(this);
+	}
+
+	// Since this is a static it's render transform changes 1
+	// to 1 with it's collision transform... no interpolation.
+	setRenderTransform(mat);
+}
+
+U32 TSStatic::packUpdate(NetConnection *con, U32 mask, BitStream *stream)
+{
+	U32 retMask = Parent::packUpdate(con, mask, stream);
+
+	if ( stream->writeFlag( mask & TransformMask ) )  
+		mathWrite( *stream, getTransform() );
+
+	if ( stream->writeFlag( mask & ScaleMask ) )	 
+	{
+		// Only write one bit if the scale is one.
+		if ( stream->writeFlag( mObjScale != Point3F::One ) )
+			mathWrite( *stream, mObjScale );	  
+	}
+
+	if ( stream->writeFlag( mask & UpdateCollisionMask ) )
+		stream->write( (U32)mCollisionType );
+
+	if ( stream->writeFlag( mask & SkinMask ) )
+		con->packNetStringHandleU( stream, mSkinNameHandle );
+
+	if (stream->writeFlag(mask & AdvancedStaticOptionsMask))
+	{
+		stream->writeString(mShapeName);
+		stream->write((U32)mDecalType);
+
+		stream->writeFlag(mAllowPlayerStep);
+		stream->writeFlag(mMeshCulling);
+		stream->writeFlag(mUseOriginSort);
+
+		stream->write(mRenderNormalScalar);
+
+		stream->write(mForceDetail);
+
+		stream->writeFlag(mPlayAmbient);
+	}
+
+	if ( stream->writeFlag(mUseAlphaFade) )  
+	{	
+		stream->write(mAlphaFadeStart);	
+		stream->write(mAlphaFadeEnd);	 
+		stream->write(mInvertAlphaFade);	 
+	} 
+
+	if ( mLightPlugin )
+		retMask |= mLightPlugin->packUpdate(this, AdvancedStaticOptionsMask, con, mask, stream);
+
+	if( stream->writeFlag( reflectorDesc != NULL ) )
+	{
+		stream->writeRangedU32( reflectorDesc->getId(), DataBlockObjectIdFirst,	 DataBlockObjectIdLast );
+	}
+	return retMask;
+}
+
+void TSStatic::unpackUpdate(NetConnection *con, BitStream *stream)
+{
+	Parent::unpackUpdate(con, stream);
+
+	if ( stream->readFlag() ) // TransformMask
+	{
+		MatrixF mat;
+		mathRead( *stream, &mat );
+		setTransform(mat);
+		setRenderTransform(mat);
+	}
+
+	if ( stream->readFlag() ) // ScaleMask
+	{
+		if ( stream->readFlag() )
+		{
+			VectorF scale;
+			mathRead( *stream, &scale );
+			setScale( scale );
+		}
+		else
+			setScale( Point3F::One );
+	}
+
+	if ( stream->readFlag() ) // UpdateCollisionMask
+	{
+		U32 collisionType = CollisionMesh;
+
+		stream->read( &collisionType );
+
+		// Handle it if we have changed CollisionType's
+		if ( (MeshType)collisionType != mCollisionType )
+		{
+			mCollisionType = (MeshType)collisionType;
+
+			if ( isProperlyAdded() && mShapeInstance )
+				prepCollision();
+		}
+	}
+
+	if (stream->readFlag())		// SkinMask
+	{
+		NetStringHandle skinDesiredNameHandle = con->unpackNetStringHandleU(stream);;
+		if (mSkinNameHandle != skinDesiredNameHandle)
+		{
+			mSkinNameHandle = skinDesiredNameHandle;
+			reSkin();
+		}
+	}
+
+	if (stream->readFlag()) // AdvancedStaticOptionsMask
+	{
+		mShapeName = stream->readSTString();
+
+		stream->read((U32*)&mDecalType);
+
+		mAllowPlayerStep = stream->readFlag();
+		mMeshCulling = stream->readFlag();
+		mUseOriginSort = stream->readFlag();
+
+		stream->read(&mRenderNormalScalar);
+
+		stream->read(&mForceDetail);
+		mPlayAmbient = stream->readFlag();
+	}
+
+	mUseAlphaFade = stream->readFlag();	 
+	if (mUseAlphaFade)
+	{
+		stream->read(&mAlphaFadeStart);	
+		stream->read(&mAlphaFadeEnd);	 
+		stream->read(&mInvertAlphaFade);	 
+	}
+
+	if ( mLightPlugin )
+	{
+		mLightPlugin->unpackUpdate(this, con, stream);
+	}
+
+	if( stream->readFlag() )
+	{
+		cubeDescId = stream->readRangedU32( DataBlockObjectIdFirst, DataBlockObjectIdLast );
+	}
+
+	if ( isProperlyAdded() )
+		_updateShouldTick();
+}
+
+//----------------------------------------------------------------------------
+bool TSStatic::castRay(const Point3F &start, const Point3F &end, RayInfo* info)
+{
+	if ( mCollisionType == None )
+		return false;
+
+	if ( !mShapeInstance )
+		return false;
+
+	if ( mCollisionType == Bounds )
+	{
+		F32 fst;
+		if (!mObjBox.collideLine(start, end, &fst, &info->normal))
+			return false;
+
+		info->t = fst;
+		info->object = this;
+		info->point.interpolate( start, end, fst );
+		info->material = NULL;
+		return true;
+	}
+	else
+	{
+		RayInfo shortest = *info;
+		RayInfo localInfo;
+		shortest.t = 1e8f;
+		localInfo.generateTexCoord = info->generateTexCoord;
+
+		for ( U32 i = 0; i < mLOSDetails.size(); i++ )
+		{
+			mShapeInstance->animate( mLOSDetails[i] );
+
+			if ( mShapeInstance->castRayOpcode( mLOSDetails[i], start, end, &localInfo ) )
+			{
+				localInfo.object = this;
+
+				if (localInfo.t < shortest.t)
+					shortest = localInfo;
+			}
+		}
+
+		if (shortest.object == this)
+		{
+			// Copy out the shortest time...
+			*info = shortest;
+			return true;
+		}
+	}
+
+	return false;
+}
+
+bool TSStatic::castRayRendered(const Point3F &start, const Point3F &end, RayInfo *info)
+{
+	if ( !mShapeInstance )
+		return false;
+
+	// Cast the ray against the currently visible detail
+	RayInfo localInfo;
+	bool res = mShapeInstance->castRayOpcode( mShapeInstance->getCurrentDetail(), start, end, &localInfo );
+
+	if ( res )
+	{
+		*info = localInfo;
+		info->object = this;
+		return true;
+	}
+
+	return false;
+}
+
+bool TSStatic::buildPolyList(PolyListContext context, AbstractPolyList* polyList, const Box3F &box, const SphereF &)
+{
+	if ( !mShapeInstance )
+		return false;
+
+	// This is safe to set even if we're not outputing 
+	polyList->setTransform( &mObjToWorld, mObjScale );
+	polyList->setObject( this );
+
+	if ( context == PLC_Export )
+	{
+		// Use highest detail level
+		S32 dl = 0;
+
+		// Try to call on the client so we can export materials
+		if ( isServerObject() && getClientObject() )
+			dynamic_cast<TSStatic*>(getClientObject())->mShapeInstance->buildPolyList( polyList, dl );
+		else
+			 mShapeInstance->buildPolyList( polyList, dl );
+	}
+	else if ( context == PLC_Selection )
+	{
+		// Use the last rendered detail level
+		S32 dl = mShapeInstance->getCurrentDetail();
+		mShapeInstance->buildPolyListOpcode( dl, polyList, box );
+	}
+	else
+	{
+		// Figure out the mesh type we're looking for.
+		MeshType meshType = ( context == PLC_Decal ) ? mDecalType : mCollisionType;
+
+		if ( meshType == None )
+			return false;
+		else if ( meshType == Bounds )
+			polyList->addBox( mObjBox );
+		else if ( meshType == VisibleMesh )
+			 mShapeInstance->buildPolyList( polyList, 0 );
+		else
+		{
+			// Everything else is done from the collision meshes
+			// which may be built from either the visual mesh or
+			// special collision geometry.
+			for ( U32 i = 0; i < mCollisionDetails.size(); i++ )
+				mShapeInstance->buildPolyListOpcode( mCollisionDetails[i], polyList, box );
+		}
+	}
+
+	return true;
+}
+
+void TSStatic::buildConvex(const Box3F& box, Convex* convex)
+{
+	if ( mCollisionType == None )
+		return;
+
+	if ( mShapeInstance == NULL )
+		return;
+
+	// These should really come out of a pool
+	mConvexList->collectGarbage();
+
+	if ( mCollisionType == Bounds )
+	{
+		// Just return a box convex for the entire shape...
+		Convex* cc = 0;
+		CollisionWorkingList& wl = convex->getWorkingList();
+		for (CollisionWorkingList* itr = wl.wLink.mNext; itr != &wl; itr = itr->wLink.mNext)
+		{
+			if (itr->mConvex->getType() == BoxConvexType &&
+				 itr->mConvex->getObject() == this)
+			{
+				cc = itr->mConvex;
+				break;
+			}
+		}
+		if (cc)
+			return;
+
+		// Create a new convex.
+		BoxConvex* cp = new BoxConvex;
+		mConvexList->registerObject(cp);
+		convex->addToWorkingList(cp);
+		cp->init(this);
+
+		mObjBox.getCenter(&cp->mCenter);
+		cp->mSize.x = mObjBox.len_x() / 2.0f;
+		cp->mSize.y = mObjBox.len_y() / 2.0f;
+		cp->mSize.z = mObjBox.len_z() / 2.0f;
+	}
+	else	// CollisionMesh || VisibleMesh
+	{
+		TSStaticPolysoupConvex::smCurObject = this;
+
+		for (U32 i = 0; i < mCollisionDetails.size(); i++)
+			mShapeInstance->buildConvexOpcode( mObjToWorld, mObjScale, mCollisionDetails[i], box, convex, mConvexList );
+
+		TSStaticPolysoupConvex::smCurObject = NULL;
+	}
+}
+
+SceneObject* TSStaticPolysoupConvex::smCurObject = NULL;
+
+TSStaticPolysoupConvex::TSStaticPolysoupConvex()
+:	box( 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f ),
+	normal( 0.0f, 0.0f, 0.0f, 0.0f ),
+	idx( 0 ),
+	mesh( NULL )
+{
+	mType = TSPolysoupConvexType;
+
+	for ( U32 i = 0; i < 4; ++i )
+	{
+		verts[i].set( 0.0f, 0.0f, 0.0f );
+	}
+}
+
+Point3F TSStaticPolysoupConvex::support(const VectorF& vec) const
+{
+	F32 bestDot = mDot( verts[0], vec );
+
+	const Point3F *bestP = &verts[0];
+	for(S32 i=1; i<4; i++)
+	{
+		F32 newD = mDot(verts[i], vec);
+		if(newD > bestDot)
+		{
+			bestDot = newD;
+			bestP = &verts[i];
+		}
+	}
+
+	return *bestP;
+}
+
+Box3F TSStaticPolysoupConvex::getBoundingBox() const
+{
+	Box3F wbox = box;
+	wbox.minExtents.convolve( mObject->getScale() );
+	wbox.maxExtents.convolve( mObject->getScale() );
+	mObject->getTransform().mul(wbox);
+	return wbox;
+}
+
+Box3F TSStaticPolysoupConvex::getBoundingBox(const MatrixF& mat, const Point3F& scale) const
+{
+	AssertISV(false, "TSStaticPolysoupConvex::getBoundingBox(m,p) - Not implemented. -- XEA");
+	return box;
+}
+
+void TSStaticPolysoupConvex::getPolyList(AbstractPolyList *list)
+{
+	// Transform the list into object space and set the pointer to the object
+	MatrixF i( mObject->getTransform() );
+	Point3F iS( mObject->getScale() );
+	list->setTransform(&i, iS);
+	list->setObject(mObject);
+
+	// Add only the original collision triangle
+	S32 base =	list->addPoint(verts[0]);
+					list->addPoint(verts[2]);
+					list->addPoint(verts[1]);
+
+	list->begin(0, (U32)idx ^ (uintptr_t)mesh);
+	list->vertex(base + 2);
+	list->vertex(base + 1);
+	list->vertex(base + 0);
+	list->plane(base + 0, base + 1, base + 2);
+	list->end();
+}
+
+void TSStaticPolysoupConvex::getFeatures(const MatrixF& mat,const VectorF& n, ConvexFeature* cf)
+{
+	cf->material = 0;
+	cf->object = mObject;
+
+	// For a tetrahedron this is pretty easy... first
+	// convert everything into world space.
+	Point3F tverts[4];
+	mat.mulP(verts[0], &tverts[0]);
+	mat.mulP(verts[1], &tverts[1]);
+	mat.mulP(verts[2], &tverts[2]);
+	mat.mulP(verts[3], &tverts[3]);
+
+	// points...
+	S32 firstVert = cf->mVertexList.size();
+	cf->mVertexList.increment(); cf->mVertexList.last() = tverts[0];
+	cf->mVertexList.increment(); cf->mVertexList.last() = tverts[1];
+	cf->mVertexList.increment(); cf->mVertexList.last() = tverts[2];
+	cf->mVertexList.increment(); cf->mVertexList.last() = tverts[3];
+
+	//		edges...
+	cf->mEdgeList.increment();
+	cf->mEdgeList.last().vertex[0] = firstVert+0;
+	cf->mEdgeList.last().vertex[1] = firstVert+1;
+
+	cf->mEdgeList.increment();
+	cf->mEdgeList.last().vertex[0] = firstVert+1;
+	cf->mEdgeList.last().vertex[1] = firstVert+2;
+
+	cf->mEdgeList.increment();
+	cf->mEdgeList.last().vertex[0] = firstVert+2;
+	cf->mEdgeList.last().vertex[1] = firstVert+0;
+
+	cf->mEdgeList.increment();
+	cf->mEdgeList.last().vertex[0] = firstVert+3;
+	cf->mEdgeList.last().vertex[1] = firstVert+0;
+
+	cf->mEdgeList.increment();
+	cf->mEdgeList.last().vertex[0] = firstVert+3;
+	cf->mEdgeList.last().vertex[1] = firstVert+1;
+
+	cf->mEdgeList.increment();
+	cf->mEdgeList.last().vertex[0] = firstVert+3;
+	cf->mEdgeList.last().vertex[1] = firstVert+2;
+
+	//		triangles...
+	cf->mFaceList.increment();
+	cf->mFaceList.last().normal = PlaneF(tverts[2], tverts[1], tverts[0]);
+	cf->mFaceList.last().vertex[0] = firstVert+2;
+	cf->mFaceList.last().vertex[1] = firstVert+1;
+	cf->mFaceList.last().vertex[2] = firstVert+0;
+
+	cf->mFaceList.increment();
+	cf->mFaceList.last().normal = PlaneF(tverts[1], tverts[0], tverts[3]);
+	cf->mFaceList.last().vertex[0] = firstVert+1;
+	cf->mFaceList.last().vertex[1] = firstVert+0;
+	cf->mFaceList.last().vertex[2] = firstVert+3;
+
+	cf->mFaceList.increment();
+	cf->mFaceList.last().normal = PlaneF(tverts[2], tverts[1], tverts[3]);
+	cf->mFaceList.last().vertex[0] = firstVert+2;
+	cf->mFaceList.last().vertex[1] = firstVert+1;
+	cf->mFaceList.last().vertex[2] = firstVert+3;
+
+	cf->mFaceList.increment();
+	cf->mFaceList.last().normal = PlaneF(tverts[0], tverts[2], tverts[3]);
+	cf->mFaceList.last().vertex[0] = firstVert+0;
+	cf->mFaceList.last().vertex[1] = firstVert+2;
+	cf->mFaceList.last().vertex[2] = firstVert+3;
+
+	// All done!
+}
+
+void TSStatic::onMount( SceneObject *obj, S32 node )
+{
+	Parent::onMount(obj, node);
+	_updateShouldTick();
+}
+
+void TSStatic::onUnmount( SceneObject *obj, S32 node )
+{
+	Parent::onUnmount( obj, node );
+	setMaskBits( TransformMask );
+	_updateShouldTick();
+}
+
+//------------------------------------------------------------------------
+//These functions are duplicated in tsStatic and shapeBase.
+//They each function a little differently; but achieve the same purpose of gathering
+//target names/counts without polluting simObject.
+
+DefineEngineMethod( TSStatic, getTargetName, const char*, ( S32 index ),(0),
+	"Get the name of the indexed shape material.\n"
+	"@param index index of the material to get (valid range is 0 - getTargetCount()-1).\n"
+	"@return the name of the indexed material.\n"
+	"@see getTargetCount()\n")
+{
+	TSStatic *obj = dynamic_cast< TSStatic* > ( object );
+	if(obj)
+	{
+		// Try to use the client object (so we get the reskinned targets in the Material Editor)
+		if ((TSStatic*)obj->getClientObject())
+			obj = (TSStatic*)obj->getClientObject();
+
+		return obj->getShapeInstance()->getTargetName(index);
+	}
+
+	return "";
+}
+
+DefineEngineMethod( TSStatic, getTargetCount, S32,(),,
+	"Get the number of materials in the shape.\n"
+	"@return the number of materials in the shape.\n"
+	"@see getTargetName()\n")
+{
+	TSStatic *obj = dynamic_cast< TSStatic* > ( object );
+	if(obj)
+	{
+		// Try to use the client object (so we get the reskinned targets in the Material Editor)
+		if ((TSStatic*)obj->getClientObject())
+			obj = (TSStatic*)obj->getClientObject();
+
+		return obj->getShapeInstance()->getTargetCount();
+	}
+
+	return -1;
+}
+
+// This method is able to change materials per map to with others. The material that is being replaced is being mapped to
+// unmapped_mat as a part of this transition
+
+DefineEngineMethod( TSStatic, changeMaterial, void, ( const char* mapTo, Material* oldMat, Material* newMat ),("",nullAsType<Material*>(),nullAsType<Material*>()),
+	"@brief Change one of the materials on the shape.\n\n"
+
+	"This method changes materials per mapTo with others. The material that "
+	"is being replaced is mapped to unmapped_mat as a part of this transition.\n"
+
+	"@note Warning, right now this only sort of works. It doesn't do a live "
+	"update like it should.\n"
+
+	"@param mapTo the name of the material target to remap (from getTargetName)\n"
+	"@param oldMat the old Material that was mapped \n"
+	"@param newMat the new Material to map\n\n"
+
+	"@tsexample\n"
+		"// remap the first material in the shape\n"
+		"%mapTo = %obj.getTargetName( 0 );\n"
+		"%obj.changeMaterial( %mapTo, 0, MyMaterial );\n"
+	"@endtsexample\n" )
+{
+	// if no valid new material, theres no reason for doing this
+	if( !newMat )
+	{
+		Con::errorf("TSShape::changeMaterial failed: New material does not exist!");
+		return;
+	}
+
+	TSMaterialList* shapeMaterialList = object->getShape()->materialList;
+
+	// Check the mapTo name exists for this shape
+	S32 matIndex = shapeMaterialList->getMaterialNameList().find_next(String(mapTo));
+	if (matIndex < 0)
+	{
+		Con::errorf("TSShape::changeMaterial failed: Invalid mapTo name '%s'", mapTo);
+		return;
+	}
+
+	// Lets remap the old material off, so as to let room for our current material room to claim its spot
+	if( oldMat )
+		oldMat->mMapTo = String("unmapped_mat");
+
+	newMat->mMapTo = mapTo;
+
+	// Map the material by name in the matmgr
+	MATMGR->mapMaterial( mapTo, newMat->getName() );
+
+	// Replace instances with the new material being traded in. Lets make sure that we only
+	// target the specific targets per inst, this is actually doing more than we thought
+	delete shapeMaterialList->mMatInstList[matIndex];
+	shapeMaterialList->mMatInstList[matIndex] = newMat->createMatInstance();
+
+	// Finish up preparing the material instances for rendering
+	const GFXVertexFormat *flags = getGFXVertexFormat<GFXVertexPNTTB>();
+	FeatureSet features = MATMGR->getDefaultFeatures();
+	shapeMaterialList->getMaterialInst(matIndex)->init(features, flags);
+}
+
+DefineEngineMethod( TSStatic, getModelFile, const char *, (),,
+	"@brief Get the model filename used by this shape.\n\n"
+
+	"@return the shape filename\n\n"
+	"@tsexample\n"
+		"// Acquire the model filename used on this shape.\n"
+		"%modelFilename = %obj.getModelFile();\n"
+	"@endtsexample\n"
+	)
+{
+<<<<<<< HEAD
+	return object->getShapeFileName();
+=======
+	return object->getShapeFileName();
+>>>>>>> garagegames/development
+}

+ 10 - 10
Engine/source/T3D/vehicles/guiSpeedometer.cpp

@@ -156,7 +156,7 @@ void GuiSpeedometerHud::onRender(Point2I offset, const RectI &updateRect)
    if (!conn)
    if (!conn)
       return;
       return;
 
 
-   // Requires either a vehicle control object or a vehicle-mounted player		
+   // Requires either a vehicle control object or a vehicle-mounted player    
    Vehicle* vehicle = dynamic_cast<Vehicle*>(conn->getControlObject());
    Vehicle* vehicle = dynamic_cast<Vehicle*>(conn->getControlObject());
    if(!vehicle){
    if(!vehicle){
       Player * player = dynamic_cast<Player*>(conn->getControlObject());
       Player * player = dynamic_cast<Player*>(conn->getControlObject());
@@ -183,20 +183,20 @@ void GuiSpeedometerHud::onRender(Point2I offset, const RectI &updateRect)
    F32 fillOffset = GFX->getFillConventionOffset(); // Find the fill offset
    F32 fillOffset = GFX->getFillConventionOffset(); // Find the fill offset
    Point2F viewCenter(offset.x + fillOffset + center.x, offset.y + fillOffset + center.y);
    Point2F viewCenter(offset.x + fillOffset + center.x, offset.y + fillOffset + center.y);
 
 
-   // Handle rotation calculations	
+   // Handle rotation calculations  
    F32 rotation, spinAngle;
    F32 rotation, spinAngle;
    rotation = mMinAngle + (mMaxAngle - mMinAngle) * (mSpeed / mMaxSpeed);
    rotation = mMinAngle + (mMaxAngle - mMinAngle) * (mSpeed / mMaxSpeed);
    spinAngle = mDegToRad(rotation);
    spinAngle = mDegToRad(rotation);
    MatrixF rotMatrix(EulerF(0.0, 0.0, spinAngle));
    MatrixF rotMatrix(EulerF(0.0, 0.0, spinAngle));
 
 
-	// Set up the needle vertex list
-	Point3F vertList[5];
-	vertList[0].set(+mNeedleLength,-mNeedleWidth,0);
-	vertList[1].set(+mNeedleLength,+mNeedleWidth,0);
-	vertList[2].set(-mTailLength  ,+mNeedleWidth,0);
-	vertList[3].set(-mTailLength  ,-mNeedleWidth,0);   
-	vertList[4].set(+mNeedleLength,-mNeedleWidth,0); //// Get back to the start!
-	
+   // Set up the needle vertex list
+   Point3F vertList[5];
+   vertList[0].set(+mNeedleLength,-mNeedleWidth,0);
+   vertList[1].set(+mNeedleLength,+mNeedleWidth,0);
+   vertList[2].set(-mTailLength  ,+mNeedleWidth,0);
+   vertList[3].set(-mTailLength  ,-mNeedleWidth,0);   
+   vertList[4].set(+mNeedleLength,-mNeedleWidth,0); //// Get back to the start!
+   
    // Create a GFXStateBlock description if one has not been set.
    // Create a GFXStateBlock description if one has not been set.
    if (mBlendSB.isNull())
    if (mBlendSB.isNull())
    {
    {

+ 17 - 17
Engine/source/app/badWordFilter.cpp

@@ -65,7 +65,7 @@ void BadWordFilter::create()
 {
 {
    Con::addVariable("pref::enableBadWordFilter", TypeBool, &filteringEnabled, 
    Con::addVariable("pref::enableBadWordFilter", TypeBool, &filteringEnabled, 
       "@brief If true, the bad word filter will be enabled.\n\n"
       "@brief If true, the bad word filter will be enabled.\n\n"
-	   "@ingroup Game");
+      "@ingroup Game");
    gBadWordFilter = new BadWordFilter;
    gBadWordFilter = new BadWordFilter;
    gBadWordFilter->addBadWord("shit");
    gBadWordFilter->addBadWord("shit");
    gBadWordFilter->addBadWord("fuck");
    gBadWordFilter->addBadWord("fuck");
@@ -251,7 +251,7 @@ DefineEngineFunction(addBadWord, bool, (const char* badWord),,
 
 
    "@ingroup Game")
    "@ingroup Game")
 {
 {
-	return gBadWordFilter->addBadWord(badWord);
+   return gBadWordFilter->addBadWord(badWord);
 }
 }
 
 
 DefineEngineFunction(filterString, const char *, (const char* baseString, const char* replacementChars), (nullAsType<const char*>(), nullAsType<const char*>()),
 DefineEngineFunction(filterString, const char *, (const char* baseString, const char* replacementChars), (nullAsType<const char*>(), nullAsType<const char*>()),
@@ -279,17 +279,17 @@ DefineEngineFunction(filterString, const char *, (const char* baseString, const
 
 
    "@ingroup Game")
    "@ingroup Game")
 {
 {
-	const char *replaceStr = NULL;
+   const char *replaceStr = NULL;
 
 
-	if(replacementChars)
-		replaceStr = replacementChars;
-	else
-		replaceStr = gBadWordFilter->getDefaultReplaceStr();
+   if(replacementChars)
+      replaceStr = replacementChars;
+   else
+      replaceStr = gBadWordFilter->getDefaultReplaceStr();
 
 
-	char *ret = Con::getReturnBuffer(dStrlen(baseString) + 1);
-	dStrcpy(ret, baseString);
-	gBadWordFilter->filterString(ret, replaceStr);
-	return ret;
+   char *ret = Con::getReturnBuffer(dStrlen(baseString) + 1);
+   dStrcpy(ret, baseString);
+   gBadWordFilter->filterString(ret, replaceStr);
+   return ret;
 }
 }
 
 
 DefineEngineFunction(containsBadWords, bool, (const char* text),,
 DefineEngineFunction(containsBadWords, bool, (const char* text),,
@@ -316,17 +316,17 @@ DefineEngineFunction(containsBadWords, bool, (const char* text),,
       "// Otherwise print the original text\n"
       "// Otherwise print the original text\n"
       "if(containsBadWords(%userText))\n"
       "if(containsBadWords(%userText))\n"
       "{\n"
       "{\n"
-      "	// Filter the string\n"
-      "	%filteredText = filterString(%userText, %replacementChars);\n\n"
-      "	// Print filtered text\n"
-      "	echo(%filteredText);\n"
+      "  // Filter the string\n"
+      "  %filteredText = filterString(%userText, %replacementChars);\n\n"
+      "  // Print filtered text\n"
+      "  echo(%filteredText);\n"
       "}\n"
       "}\n"
       "else\n"
       "else\n"
-      "	echo(%userText);\n\n"
+      "  echo(%userText);\n\n"
    "@endtsexample\n"
    "@endtsexample\n"
 
 
    "@ingroup Game")
    "@ingroup Game")
 {
 {
-	return gBadWordFilter->containsBadWords(text);
+   return gBadWordFilter->containsBadWords(text);
 }
 }
 
 

File diff suppressed because it is too large
+ 499 - 499
Engine/source/console/CMDscan.cpp


+ 12 - 12
Engine/source/console/SimXMLDocument.h

@@ -45,7 +45,7 @@ class SimXMLDocument: public SimObject
 {
 {
    // This typedef is required for tie ins with the script language.
    // This typedef is required for tie ins with the script language.
    // --------------------------------------------------------------------------
    // --------------------------------------------------------------------------
-	protected:
+   protected:
       typedef SimObject Parent;
       typedef SimObject Parent;
    // --------------------------------------------------------------------------
    // --------------------------------------------------------------------------
 
 
@@ -85,8 +85,8 @@ class SimXMLDocument: public SimObject
       bool nextSiblingElement(const char* rName);
       bool nextSiblingElement(const char* rName);
       // push child element at index onto stack.
       // push child element at index onto stack.
       bool pushChildElement(S32 index);
       bool pushChildElement(S32 index);
-	  // Get element value
-	  const char* elementValue();
+     // Get element value
+     const char* elementValue();
       
       
       // Pop last element off of stack.
       // Pop last element off of stack.
       void popElement(void);
       void popElement(void);
@@ -94,16 +94,16 @@ class SimXMLDocument: public SimObject
       // Get attribute from top element on element stack.
       // Get attribute from top element on element stack.
       const char* attribute(const char* rAttribute);
       const char* attribute(const char* rAttribute);
 
 
-	  // Does the attribute exist in the current element
+     // Does the attribute exist in the current element
       bool attributeExists(const char* rAttribute);
       bool attributeExists(const char* rAttribute);
 
 
-	  // Obtain the name of the current element's first or last attribute
-	  const char* firstAttribute();
-	  const char* lastAttribute();
+     // Obtain the name of the current element's first or last attribute
+     const char* firstAttribute();
+     const char* lastAttribute();
 
 
-	  // Move through the current element's attributes to obtain their names
-	  const char* nextAttribute();
-	  const char* prevAttribute();
+     // Move through the current element's attributes to obtain their names
+     const char* nextAttribute();
+     const char* prevAttribute();
 
 
       // Set attribute of top element on element stack.
       // Set attribute of top element on element stack.
       void setAttribute(const char* rAttribute, const char* rVal);
       void setAttribute(const char* rAttribute, const char* rVal);
@@ -139,8 +139,8 @@ class SimXMLDocument: public SimObject
       TiXmlDocument* m_qDocument;
       TiXmlDocument* m_qDocument;
       // Stack of nodes.
       // Stack of nodes.
       Vector<TiXmlElement*> m_paNode;
       Vector<TiXmlElement*> m_paNode;
-	  // The current attribute
-	  TiXmlAttribute* m_CurrentAttribute;
+     // The current attribute
+     TiXmlAttribute* m_CurrentAttribute;
 
 
    public:
    public:
       DECLARE_CONOBJECT(SimXMLDocument);
       DECLARE_CONOBJECT(SimXMLDocument);

+ 1 - 1
Engine/source/console/arrayObject.h

@@ -102,7 +102,7 @@ public:
 
 
    /// Returns the value for a given index.
    /// Returns the value for a given index.
    /// Will return a null value for an invalid index
    /// Will return a null value for an invalid index
-   const String&	getValueFromIndex( S32 index ) const;
+   const String&  getValueFromIndex( S32 index ) const;
    
    
    ///
    ///
    S32 getIndexFromKeyValue( const String &key, const String &value ) const;
    S32 getIndexFromKeyValue( const String &key, const String &value ) const;

+ 195 - 195
Engine/source/console/cmdgram.cpp

@@ -11,78 +11,78 @@
 #define yychar CMDchar
 #define yychar CMDchar
 #define yydebug CMDdebug
 #define yydebug CMDdebug
 #define yynerrs CMDnerrs
 #define yynerrs CMDnerrs
-#define	rwDEFINE	258
-#define	rwENDDEF	259
-#define	rwDECLARE	260
-#define	rwDECLARESINGLETON	261
-#define	rwBREAK	262
-#define	rwELSE	263
-#define	rwCONTINUE	264
-#define	rwGLOBAL	265
-#define	rwIF	266
-#define	rwNIL	267
-#define	rwRETURN	268
-#define	rwWHILE	269
-#define	rwDO	270
-#define	rwENDIF	271
-#define	rwENDWHILE	272
-#define	rwENDFOR	273
-#define	rwDEFAULT	274
-#define	rwFOR	275
-#define	rwFOREACH	276
-#define	rwFOREACHSTR	277
-#define	rwIN	278
-#define	rwDATABLOCK	279
-#define	rwSWITCH	280
-#define	rwCASE	281
-#define	rwSWITCHSTR	282
-#define	rwCASEOR	283
-#define	rwPACKAGE	284
-#define	rwNAMESPACE	285
-#define	rwCLASS	286
-#define	rwASSERT	287
-#define	ILLEGAL_TOKEN	288
-#define	CHRCONST	289
-#define	INTCONST	290
-#define	TTAG	291
-#define	VAR	292
-#define	IDENT	293
-#define	TYPEIDENT	294
-#define	DOCBLOCK	295
-#define	STRATOM	296
-#define	TAGATOM	297
-#define	FLTCONST	298
-#define	opINTNAME	299
-#define	opINTNAMER	300
-#define	opMINUSMINUS	301
-#define	opPLUSPLUS	302
-#define	STMT_SEP	303
-#define	opSHL	304
-#define	opSHR	305
-#define	opPLASN	306
-#define	opMIASN	307
-#define	opMLASN	308
-#define	opDVASN	309
-#define	opMODASN	310
-#define	opANDASN	311
-#define	opXORASN	312
-#define	opORASN	313
-#define	opSLASN	314
-#define	opSRASN	315
-#define	opCAT	316
-#define	opEQ	317
-#define	opNE	318
-#define	opGE	319
-#define	opLE	320
-#define	opAND	321
-#define	opOR	322
-#define	opSTREQ	323
-#define	opCOLONCOLON	324
-#define	opMDASN	325
-#define	opNDASN	326
-#define	opNTASN	327
-#define	opSTRNE	328
-#define	UNARY	329
+#define  rwDEFINE 258
+#define  rwENDDEF 259
+#define  rwDECLARE   260
+#define  rwDECLARESINGLETON   261
+#define  rwBREAK  262
+#define  rwELSE   263
+#define  rwCONTINUE  264
+#define  rwGLOBAL 265
+#define  rwIF  266
+#define  rwNIL 267
+#define  rwRETURN 268
+#define  rwWHILE  269
+#define  rwDO  270
+#define  rwENDIF  271
+#define  rwENDWHILE  272
+#define  rwENDFOR 273
+#define  rwDEFAULT   274
+#define  rwFOR 275
+#define  rwFOREACH   276
+#define  rwFOREACHSTR   277
+#define  rwIN  278
+#define  rwDATABLOCK 279
+#define  rwSWITCH 280
+#define  rwCASE   281
+#define  rwSWITCHSTR 282
+#define  rwCASEOR 283
+#define  rwPACKAGE   284
+#define  rwNAMESPACE 285
+#define  rwCLASS  286
+#define  rwASSERT 287
+#define  ILLEGAL_TOKEN  288
+#define  CHRCONST 289
+#define  INTCONST 290
+#define  TTAG  291
+#define  VAR   292
+#define  IDENT 293
+#define  TYPEIDENT   294
+#define  DOCBLOCK 295
+#define  STRATOM  296
+#define  TAGATOM  297
+#define  FLTCONST 298
+#define  opINTNAME   299
+#define  opINTNAMER  300
+#define  opMINUSMINUS   301
+#define  opPLUSPLUS  302
+#define  STMT_SEP 303
+#define  opSHL 304
+#define  opSHR 305
+#define  opPLASN  306
+#define  opMIASN  307
+#define  opMLASN  308
+#define  opDVASN  309
+#define  opMODASN 310
+#define  opANDASN 311
+#define  opXORASN 312
+#define  opORASN  313
+#define  opSLASN  314
+#define  opSRASN  315
+#define  opCAT 316
+#define  opEQ  317
+#define  opNE  318
+#define  opGE  319
+#define  opLE  320
+#define  opAND 321
+#define  opOR  322
+#define  opSTREQ  323
+#define  opCOLONCOLON   324
+#define  opMDASN  325
+#define  opNDASN  326
+#define  opNTASN  327
+#define  opSTRNE  328
+#define  UNARY 329
 
 
 #line 1 "cmdgram.y"
 #line 1 "cmdgram.y"
 
 
@@ -182,9 +182,9 @@ typedef
 
 
 
 
 
 
-#define	YYFINAL		388
-#define	YYFLAG		-32768
-#define	YYNTBASE	100
+#define  YYFINAL     388
+#define  YYFLAG      -32768
+#define  YYNTBASE 100
 
 
 #define YYTRANSLATE(x) ((unsigned)(x) <= 329 ? yytranslate[x] : 140)
 #define YYTRANSLATE(x) ((unsigned)(x) <= 329 ? yytranslate[x] : 140)
 
 
@@ -502,7 +502,7 @@ static const short yypgoto[] = {-32768,
 };
 };
 
 
 
 
-#define	YYLAST		3042
+#define  YYLAST      3042
 
 
 
 
 static const short yytable[] = {    47,
 static const short yytable[] = {    47,
@@ -1183,50 +1183,50 @@ void *alloca ();
    It is replaced by the list of actions, each action
    It is replaced by the list of actions, each action
    as one case of the switch.  */
    as one case of the switch.  */
 
 
-#define yyerrok		(yyerrstatus = 0)
-#define yyclearin	(yychar = YYEMPTY)
-#define YYEMPTY		-2
-#define YYEOF		0
-#define YYACCEPT	return(0)
-#define YYABORT 	return(1)
-#define YYERROR		goto yyerrlab1
+#define yyerrok      (yyerrstatus = 0)
+#define yyclearin (yychar = YYEMPTY)
+#define YYEMPTY      -2
+#define YYEOF     0
+#define YYACCEPT  return(0)
+#define YYABORT   return(1)
+#define YYERROR      goto yyerrlab1
 /* Like YYERROR except do call yyerror.
 /* Like YYERROR except do call yyerror.
    This remains here temporarily to ease the
    This remains here temporarily to ease the
    transition to the new meaning of YYERROR, for GCC.
    transition to the new meaning of YYERROR, for GCC.
    Once GCC version 2 has supplanted version 1, this can go.  */
    Once GCC version 2 has supplanted version 1, this can go.  */
-#define YYFAIL		goto yyerrlab
+#define YYFAIL    goto yyerrlab
 #define YYRECOVERING()  (!!yyerrstatus)
 #define YYRECOVERING()  (!!yyerrstatus)
 #define YYBACKUP(token, value) \
 #define YYBACKUP(token, value) \
-do								\
-  if (yychar == YYEMPTY && yylen == 1)				\
-    { yychar = (token), yylval = (value);			\
-      yychar1 = YYTRANSLATE (yychar);				\
-      YYPOPSTACK;						\
-      goto yybackup;						\
-    }								\
-  else								\
-    { yyerror ("syntax error: cannot back up"); YYERROR; }	\
+do                      \
+  if (yychar == YYEMPTY && yylen == 1)          \
+    { yychar = (token), yylval = (value);       \
+      yychar1 = YYTRANSLATE (yychar);           \
+      YYPOPSTACK;                \
+      goto yybackup;                \
+    }                      \
+  else                        \
+    { yyerror ("syntax error: cannot back up"); YYERROR; }  \
 while (0)
 while (0)
 
 
-#define YYTERROR	1
-#define YYERRCODE	256
+#define YYTERROR  1
+#define YYERRCODE 256
 
 
 #ifndef YYPURE
 #ifndef YYPURE
-#define YYLEX		yylex()
+#define YYLEX     yylex()
 #endif
 #endif
 
 
 #ifdef YYPURE
 #ifdef YYPURE
 #ifdef YYLSP_NEEDED
 #ifdef YYLSP_NEEDED
 #ifdef YYLEX_PARAM
 #ifdef YYLEX_PARAM
-#define YYLEX		yylex(&yylval, &yylloc, YYLEX_PARAM)
+#define YYLEX     yylex(&yylval, &yylloc, YYLEX_PARAM)
 #else
 #else
-#define YYLEX		yylex(&yylval, &yylloc)
+#define YYLEX     yylex(&yylval, &yylloc)
 #endif
 #endif
 #else /* not YYLSP_NEEDED */
 #else /* not YYLSP_NEEDED */
 #ifdef YYLEX_PARAM
 #ifdef YYLEX_PARAM
-#define YYLEX		yylex(&yylval, YYLEX_PARAM)
+#define YYLEX     yylex(&yylval, YYLEX_PARAM)
 #else
 #else
-#define YYLEX		yylex(&yylval)
+#define YYLEX     yylex(&yylval)
 #endif
 #endif
 #endif /* not YYLSP_NEEDED */
 #endif /* not YYLSP_NEEDED */
 #endif
 #endif
@@ -1235,27 +1235,27 @@ while (0)
 
 
 #ifndef YYPURE
 #ifndef YYPURE
 
 
-int	yychar;			/*  the lookahead symbol		*/
-YYSTYPE	yylval;			/*  the semantic value of the		*/
-				/*  lookahead symbol			*/
+int   yychar;        /*  the lookahead symbol      */
+YYSTYPE  yylval;        /*  the semantic value of the    */
+            /*  lookahead symbol       */
 
 
 #ifdef YYLSP_NEEDED
 #ifdef YYLSP_NEEDED
-YYLTYPE yylloc;			/*  location data for the lookahead	*/
-				/*  symbol				*/
+YYLTYPE yylloc;         /*  location data for the lookahead */
+            /*  symbol           */
 #endif
 #endif
 
 
-int yynerrs;			/*  number of parse errors so far       */
+int yynerrs;         /*  number of parse errors so far       */
 #endif  /* not YYPURE */
 #endif  /* not YYPURE */
 
 
 #if YYDEBUG != 0
 #if YYDEBUG != 0
-int yydebug;			/*  nonzero means print parse trace	*/
+int yydebug;         /*  nonzero means print parse trace */
 /* Since this is uninitialized, it does not stop multiple parsers
 /* Since this is uninitialized, it does not stop multiple parsers
    from coexisting.  */
    from coexisting.  */
 #endif
 #endif
 
 
-/*  YYINITDEPTH indicates the initial size of the parser's stacks	*/
+/*  YYINITDEPTH indicates the initial size of the parser's stacks */
 
 
-#ifndef	YYINITDEPTH
+#ifndef  YYINITDEPTH
 #define YYINITDEPTH 200
 #define YYINITDEPTH 200
 #endif
 #endif
 
 
@@ -1275,9 +1275,9 @@ int yydebug;			/*  nonzero means print parse trace	*/
 int yyparse (void);
 int yyparse (void);
 #endif
 #endif
 
 
-#if __GNUC__ > 1		/* GNU C and GNU C++ define this.  */
-#define __yy_memcpy(FROM,TO,COUNT)	__builtin_memcpy(TO,FROM,COUNT)
-#else				/* not GNU C or C++ */
+#if __GNUC__ > 1     /* GNU C and GNU C++ define this.  */
+#define __yy_memcpy(FROM,TO,COUNT)  __builtin_memcpy(TO,FROM,COUNT)
+#else          /* not GNU C or C++ */
 #ifndef __cplusplus
 #ifndef __cplusplus
 
 
 /* This is the most reliable way to avoid incompatibilities
 /* This is the most reliable way to avoid incompatibilities
@@ -1337,17 +1337,17 @@ yyparse(YYPARSE_PARAM)
   int yyn;
   int yyn;
   short *yyssp;
   short *yyssp;
   YYSTYPE *yyvsp;
   YYSTYPE *yyvsp;
-  int yyerrstatus;	/*  number of tokens to shift before error messages enabled */
-  int yychar1 = 0;		/*  lookahead token as an internal (translated) token number */
+  int yyerrstatus;   /*  number of tokens to shift before error messages enabled */
+  int yychar1 = 0;      /*  lookahead token as an internal (translated) token number */
 
 
-  short	yyssa[YYINITDEPTH];	/*  the state stack			*/
-  YYSTYPE yyvsa[YYINITDEPTH];	/*  the semantic value stack		*/
+  short  yyssa[YYINITDEPTH];  /*  the state stack        */
+  YYSTYPE yyvsa[YYINITDEPTH]; /*  the semantic value stack     */
 
 
-  short *yyss = yyssa;		/*  refer to the stacks thru separate pointers */
-  YYSTYPE *yyvs = yyvsa;	/*  to allow yyoverflow to reallocate them elsewhere */
+  short *yyss = yyssa;     /*  refer to the stacks thru separate pointers */
+  YYSTYPE *yyvs = yyvsa;   /*  to allow yyoverflow to reallocate them elsewhere */
 
 
 #ifdef YYLSP_NEEDED
 #ifdef YYLSP_NEEDED
-  YYLTYPE yylsa[YYINITDEPTH];	/*  the location stack			*/
+  YYLTYPE yylsa[YYINITDEPTH]; /*  the location stack        */
   YYLTYPE *yyls = yylsa;
   YYLTYPE *yyls = yylsa;
   YYLTYPE *yylsp;
   YYLTYPE *yylsp;
 
 
@@ -1367,9 +1367,9 @@ yyparse(YYPARSE_PARAM)
 #endif
 #endif
 #endif
 #endif
 
 
-  YYSTYPE yyval;		/*  the variable used to return		*/
-				/*  semantic values from the action	*/
-				/*  routines				*/
+  YYSTYPE yyval;     /*  the variable used to return     */
+            /*  semantic values from the action */
+            /*  routines            */
 
 
   int yylen;
   int yylen;
 
 
@@ -1381,7 +1381,7 @@ yyparse(YYPARSE_PARAM)
   yystate = 0;
   yystate = 0;
   yyerrstatus = 0;
   yyerrstatus = 0;
   yynerrs = 0;
   yynerrs = 0;
-  yychar = YYEMPTY;		/* Cause a token to be read.  */
+  yychar = YYEMPTY;     /* Cause a token to be read.  */
 
 
   /* Initialize stack pointers.
   /* Initialize stack pointers.
      Waste one element of value and location stack
      Waste one element of value and location stack
@@ -1416,20 +1416,20 @@ yynewstate:
 
 
 #ifdef yyoverflow
 #ifdef yyoverflow
       /* Each stack pointer address is followed by the size of
       /* Each stack pointer address is followed by the size of
-	 the data in use in that stack, in bytes.  */
+    the data in use in that stack, in bytes.  */
 #ifdef YYLSP_NEEDED
 #ifdef YYLSP_NEEDED
       /* This used to be a conditional around just the two extra args,
       /* This used to be a conditional around just the two extra args,
-	 but that might be undefined if yyoverflow is a macro.  */
+    but that might be undefined if yyoverflow is a macro.  */
       yyoverflow("parser stack overflow",
       yyoverflow("parser stack overflow",
-		 &yyss1, size * sizeof (*yyssp),
-		 &yyvs1, size * sizeof (*yyvsp),
-		 &yyls1, size * sizeof (*yylsp),
-		 &yystacksize);
+       &yyss1, size * sizeof (*yyssp),
+       &yyvs1, size * sizeof (*yyvsp),
+       &yyls1, size * sizeof (*yylsp),
+       &yystacksize);
 #else
 #else
       yyoverflow("parser stack overflow",
       yyoverflow("parser stack overflow",
-		 &yyss1, size * sizeof (*yyssp),
-		 &yyvs1, size * sizeof (*yyvsp),
-		 &yystacksize);
+       &yyss1, size * sizeof (*yyssp),
+       &yyvs1, size * sizeof (*yyvsp),
+       &yystacksize);
 #endif
 #endif
 
 
       yyss = yyss1; yyvs = yyvs1;
       yyss = yyss1; yyvs = yyvs1;
@@ -1439,13 +1439,13 @@ yynewstate:
 #else /* no yyoverflow */
 #else /* no yyoverflow */
       /* Extend the stack our own way.  */
       /* Extend the stack our own way.  */
       if (yystacksize >= YYMAXDEPTH)
       if (yystacksize >= YYMAXDEPTH)
-	{
-	  yyerror("parser stack overflow");
-	  return 2;
-	}
+   {
+     yyerror("parser stack overflow");
+     return 2;
+   }
       yystacksize *= 2;
       yystacksize *= 2;
       if (yystacksize > YYMAXDEPTH)
       if (yystacksize > YYMAXDEPTH)
-	yystacksize = YYMAXDEPTH;
+   yystacksize = YYMAXDEPTH;
       yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
       yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
       __yy_memcpy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp));
       __yy_memcpy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp));
       yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
       yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
@@ -1464,11 +1464,11 @@ yynewstate:
 
 
 #if YYDEBUG != 0
 #if YYDEBUG != 0
       if (yydebug)
       if (yydebug)
-	fprintf(stderr, "Stack size increased to %d\n", yystacksize);
+   fprintf(stderr, "Stack size increased to %d\n", yystacksize);
 #endif
 #endif
 
 
       if (yyssp >= yyss + yystacksize - 1)
       if (yyssp >= yyss + yystacksize - 1)
-	YYABORT;
+   YYABORT;
     }
     }
 
 
 #if YYDEBUG != 0
 #if YYDEBUG != 0
@@ -1498,21 +1498,21 @@ yynewstate:
     {
     {
 #if YYDEBUG != 0
 #if YYDEBUG != 0
       if (yydebug)
       if (yydebug)
-	fprintf(stderr, "Reading a token: ");
+   fprintf(stderr, "Reading a token: ");
 #endif
 #endif
       yychar = YYLEX;
       yychar = YYLEX;
     }
     }
 
 
   /* Convert token to internal form (in yychar1) for indexing tables with */
   /* Convert token to internal form (in yychar1) for indexing tables with */
 
 
-  if (yychar <= 0)		/* This means end of input. */
+  if (yychar <= 0)      /* This means end of input. */
     {
     {
       yychar1 = 0;
       yychar1 = 0;
-      yychar = YYEOF;		/* Don't call YYLEX any more */
+      yychar = YYEOF;      /* Don't call YYLEX any more */
 
 
 #if YYDEBUG != 0
 #if YYDEBUG != 0
       if (yydebug)
       if (yydebug)
-	fprintf(stderr, "Now at end of input.\n");
+   fprintf(stderr, "Now at end of input.\n");
 #endif
 #endif
     }
     }
   else
   else
@@ -1521,15 +1521,15 @@ yynewstate:
 
 
 #if YYDEBUG != 0
 #if YYDEBUG != 0
       if (yydebug)
       if (yydebug)
-	{
-	  fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
-	  /* Give the individual parser a way to print the precise meaning
-	     of a token, for further debugging info.  */
+   {
+     fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
+     /* Give the individual parser a way to print the precise meaning
+        of a token, for further debugging info.  */
 #ifdef YYPRINT
 #ifdef YYPRINT
-	  YYPRINT (stderr, yychar, yylval);
+     YYPRINT (stderr, yychar, yylval);
 #endif
 #endif
-	  fprintf (stderr, ")\n");
-	}
+     fprintf (stderr, ")\n");
+   }
 #endif
 #endif
     }
     }
 
 
@@ -1549,7 +1549,7 @@ yynewstate:
   if (yyn < 0)
   if (yyn < 0)
     {
     {
       if (yyn == YYFLAG)
       if (yyn == YYFLAG)
-	goto yyerrlab;
+   goto yyerrlab;
       yyn = -yyn;
       yyn = -yyn;
       goto yyreduce;
       goto yyreduce;
     }
     }
@@ -1600,11 +1600,11 @@ yyreduce:
       int i;
       int i;
 
 
       fprintf (stderr, "Reducing via rule %d (line %d), ",
       fprintf (stderr, "Reducing via rule %d (line %d), ",
-	       yyn, yyrline[yyn]);
+          yyn, yyrline[yyn]);
 
 
       /* Print the symbols being reduced, and their result.  */
       /* Print the symbols being reduced, and their result.  */
       for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
       for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
-	fprintf (stderr, "%s ", yytname[yyrhs[i]]);
+   fprintf (stderr, "%s ", yytname[yyrhs[i]]);
       fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
       fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
     }
     }
 #endif
 #endif
@@ -2265,7 +2265,7 @@ case 162:
       short *ssp1 = yyss - 1;
       short *ssp1 = yyss - 1;
       fprintf (stderr, "state stack now");
       fprintf (stderr, "state stack now");
       while (ssp1 != yyssp)
       while (ssp1 != yyssp)
-	fprintf (stderr, " %d", *++ssp1);
+   fprintf (stderr, " %d", *++ssp1);
       fprintf (stderr, "\n");
       fprintf (stderr, "\n");
     }
     }
 #endif
 #endif
@@ -2315,44 +2315,44 @@ yyerrlab:   /* here on detecting error */
       yyn = yypact[yystate];
       yyn = yypact[yystate];
 
 
       if (yyn > YYFLAG && yyn < YYLAST)
       if (yyn > YYFLAG && yyn < YYLAST)
-	{
-	  int size = 0;
-	  char *msg;
-	  int x, count;
-
-	  count = 0;
-	  /* Start X at -yyn if nec to avoid negative indexes in yycheck.  */
-	  for (x = (yyn < 0 ? -yyn : 0);
-	       x < (sizeof(yytname) / sizeof(char *)); x++)
-	    if (yycheck[x + yyn] == x)
-	      size += strlen(yytname[x]) + 15, count++;
-	  msg = (char *) malloc(size + 15);
-	  if (msg != 0)
-	    {
-	      strcpy(msg, "parse error");
-
-	      if (count < 5)
-		{
-		  count = 0;
-		  for (x = (yyn < 0 ? -yyn : 0);
-		       x < (sizeof(yytname) / sizeof(char *)); x++)
-		    if (yycheck[x + yyn] == x)
-		      {
-			strcat(msg, count == 0 ? ", expecting `" : " or `");
-			strcat(msg, yytname[x]);
-			strcat(msg, "'");
-			count++;
-		      }
-		}
-	      yyerror(msg);
-	      free(msg);
-	    }
-	  else
-	    yyerror ("parse error; also virtual memory exceeded");
-	}
+   {
+     int size = 0;
+     char *msg;
+     int x, count;
+
+     count = 0;
+     /* Start X at -yyn if nec to avoid negative indexes in yycheck.  */
+     for (x = (yyn < 0 ? -yyn : 0);
+          x < (sizeof(yytname) / sizeof(char *)); x++)
+       if (yycheck[x + yyn] == x)
+         size += strlen(yytname[x]) + 15, count++;
+     msg = (char *) malloc(size + 15);
+     if (msg != 0)
+       {
+         strcpy(msg, "parse error");
+
+         if (count < 5)
+      {
+        count = 0;
+        for (x = (yyn < 0 ? -yyn : 0);
+             x < (sizeof(yytname) / sizeof(char *)); x++)
+          if (yycheck[x + yyn] == x)
+            {
+         strcat(msg, count == 0 ? ", expecting `" : " or `");
+         strcat(msg, yytname[x]);
+         strcat(msg, "'");
+         count++;
+            }
+      }
+         yyerror(msg);
+         free(msg);
+       }
+     else
+       yyerror ("parse error; also virtual memory exceeded");
+   }
       else
       else
 #endif /* YYERROR_VERBOSE */
 #endif /* YYERROR_VERBOSE */
-	yyerror("parse error");
+   yyerror("parse error");
     }
     }
 
 
   goto yyerrlab1;
   goto yyerrlab1;
@@ -2364,11 +2364,11 @@ yyerrlab1:   /* here on error raised explicitly by an action */
 
 
       /* return failure if at end of input */
       /* return failure if at end of input */
       if (yychar == YYEOF)
       if (yychar == YYEOF)
-	YYABORT;
+   YYABORT;
 
 
 #if YYDEBUG != 0
 #if YYDEBUG != 0
       if (yydebug)
       if (yydebug)
-	fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
+   fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
 #endif
 #endif
 
 
       yychar = YYEMPTY;
       yychar = YYEMPTY;
@@ -2377,7 +2377,7 @@ yyerrlab1:   /* here on error raised explicitly by an action */
   /* Else will try to reuse lookahead token
   /* Else will try to reuse lookahead token
      after shifting the error token.  */
      after shifting the error token.  */
 
 
-  yyerrstatus = 3;		/* Each real token shifted decrements this */
+  yyerrstatus = 3;      /* Each real token shifted decrements this */
 
 
   goto yyerrhandle;
   goto yyerrhandle;
 
 
@@ -2405,7 +2405,7 @@ yyerrpop:   /* pop the current state because it cannot handle the error token */
       short *ssp1 = yyss - 1;
       short *ssp1 = yyss - 1;
       fprintf (stderr, "Error: state stack now");
       fprintf (stderr, "Error: state stack now");
       while (ssp1 != yyssp)
       while (ssp1 != yyssp)
-	fprintf (stderr, " %d", *++ssp1);
+   fprintf (stderr, " %d", *++ssp1);
       fprintf (stderr, "\n");
       fprintf (stderr, "\n");
     }
     }
 #endif
 #endif
@@ -2424,7 +2424,7 @@ yyerrhandle:
   if (yyn < 0)
   if (yyn < 0)
     {
     {
       if (yyn == YYFLAG)
       if (yyn == YYFLAG)
-	goto yyerrpop;
+   goto yyerrpop;
       yyn = -yyn;
       yyn = -yyn;
       goto yyreduce;
       goto yyreduce;
     }
     }

+ 72 - 72
Engine/source/console/cmdgram.h

@@ -15,78 +15,78 @@ typedef union {
    AssignDecl              asn;
    AssignDecl              asn;
    IfStmtNode*             ifnode;
    IfStmtNode*             ifnode;
 } YYSTYPE;
 } YYSTYPE;
-#define	rwDEFINE	258
-#define	rwENDDEF	259
-#define	rwDECLARE	260
-#define	rwDECLARESINGLETON	261
-#define	rwBREAK	262
-#define	rwELSE	263
-#define	rwCONTINUE	264
-#define	rwGLOBAL	265
-#define	rwIF	266
-#define	rwNIL	267
-#define	rwRETURN	268
-#define	rwWHILE	269
-#define	rwDO	270
-#define	rwENDIF	271
-#define	rwENDWHILE	272
-#define	rwENDFOR	273
-#define	rwDEFAULT	274
-#define	rwFOR	275
-#define	rwFOREACH	276
-#define	rwFOREACHSTR	277
-#define	rwIN	278
-#define	rwDATABLOCK	279
-#define	rwSWITCH	280
-#define	rwCASE	281
-#define	rwSWITCHSTR	282
-#define	rwCASEOR	283
-#define	rwPACKAGE	284
-#define	rwNAMESPACE	285
-#define	rwCLASS	286
-#define	rwASSERT	287
-#define	ILLEGAL_TOKEN	288
-#define	CHRCONST	289
-#define	INTCONST	290
-#define	TTAG	291
-#define	VAR	292
-#define	IDENT	293
-#define	TYPEIDENT	294
-#define	DOCBLOCK	295
-#define	STRATOM	296
-#define	TAGATOM	297
-#define	FLTCONST	298
-#define	opINTNAME	299
-#define	opINTNAMER	300
-#define	opMINUSMINUS	301
-#define	opPLUSPLUS	302
-#define	STMT_SEP	303
-#define	opSHL	304
-#define	opSHR	305
-#define	opPLASN	306
-#define	opMIASN	307
-#define	opMLASN	308
-#define	opDVASN	309
-#define	opMODASN	310
-#define	opANDASN	311
-#define	opXORASN	312
-#define	opORASN	313
-#define	opSLASN	314
-#define	opSRASN	315
-#define	opCAT	316
-#define	opEQ	317
-#define	opNE	318
-#define	opGE	319
-#define	opLE	320
-#define	opAND	321
-#define	opOR	322
-#define	opSTREQ	323
-#define	opCOLONCOLON	324
-#define	opMDASN	325
-#define	opNDASN	326
-#define	opNTASN	327
-#define	opSTRNE	328
-#define	UNARY	329
+#define  rwDEFINE 258
+#define  rwENDDEF 259
+#define  rwDECLARE   260
+#define  rwDECLARESINGLETON   261
+#define  rwBREAK  262
+#define  rwELSE   263
+#define  rwCONTINUE  264
+#define  rwGLOBAL 265
+#define  rwIF  266
+#define  rwNIL 267
+#define  rwRETURN 268
+#define  rwWHILE  269
+#define  rwDO  270
+#define  rwENDIF  271
+#define  rwENDWHILE  272
+#define  rwENDFOR 273
+#define  rwDEFAULT   274
+#define  rwFOR 275
+#define  rwFOREACH   276
+#define  rwFOREACHSTR   277
+#define  rwIN  278
+#define  rwDATABLOCK 279
+#define  rwSWITCH 280
+#define  rwCASE   281
+#define  rwSWITCHSTR 282
+#define  rwCASEOR 283
+#define  rwPACKAGE   284
+#define  rwNAMESPACE 285
+#define  rwCLASS  286
+#define  rwASSERT 287
+#define  ILLEGAL_TOKEN  288
+#define  CHRCONST 289
+#define  INTCONST 290
+#define  TTAG  291
+#define  VAR   292
+#define  IDENT 293
+#define  TYPEIDENT   294
+#define  DOCBLOCK 295
+#define  STRATOM  296
+#define  TAGATOM  297
+#define  FLTCONST 298
+#define  opINTNAME   299
+#define  opINTNAMER  300
+#define  opMINUSMINUS   301
+#define  opPLUSPLUS  302
+#define  STMT_SEP 303
+#define  opSHL 304
+#define  opSHR 305
+#define  opPLASN  306
+#define  opMIASN  307
+#define  opMLASN  308
+#define  opDVASN  309
+#define  opMODASN 310
+#define  opANDASN 311
+#define  opXORASN 312
+#define  opORASN  313
+#define  opSLASN  314
+#define  opSRASN  315
+#define  opCAT 316
+#define  opEQ  317
+#define  opNE  318
+#define  opGE  319
+#define  opLE  320
+#define  opAND 321
+#define  opOR  322
+#define  opSTREQ  323
+#define  opCOLONCOLON   324
+#define  opMDASN  325
+#define  opNDASN  326
+#define  opNTASN  327
+#define  opSTRNE  328
+#define  UNARY 329
 
 
 
 
 extern YYSTYPE CMDlval;
 extern YYSTYPE CMDlval;

+ 8 - 8
Engine/source/console/compiledEval.cpp

@@ -242,7 +242,7 @@ inline void ExprEvalState::setCurVarName(StringTableEntry name)
    else if( getStackDepth() > 0 )
    else if( getStackDepth() > 0 )
       currentVariable = getCurrentFrame().lookup(name);
       currentVariable = getCurrentFrame().lookup(name);
    if(!currentVariable && gWarnUndefinedScriptVariables)
    if(!currentVariable && gWarnUndefinedScriptVariables)
-	   Con::warnf(ConsoleLogEntry::Script, "Variable referenced before assignment: %s", name);
+      Con::warnf(ConsoleLogEntry::Script, "Variable referenced before assignment: %s", name);
 }
 }
 
 
 inline void ExprEvalState::setCurVarNameCreate(StringTableEntry name)
 inline void ExprEvalState::setCurVarNameCreate(StringTableEntry name)
@@ -316,7 +316,7 @@ inline void ExprEvalState::setCopyVariable()
          default:
          default:
             currentVariable->setStringValue(copyVariable->getStringValue());
             currentVariable->setStringValue(copyVariable->getStringValue());
          break;
          break;
-	   }
+      }
    }
    }
 }
 }
 
 
@@ -398,7 +398,7 @@ static void setFieldComponent( SimObject* object, StringTableEntry field, const
 
 
    // Ensure that the variable has a value
    // Ensure that the variable has a value
    if (!prevVal)
    if (!prevVal)
-	   return;
+      return;
 
 
    static const StringTableEntry xyzw[] = 
    static const StringTableEntry xyzw[] = 
    {
    {
@@ -419,7 +419,7 @@ static void setFieldComponent( SimObject* object, StringTableEntry field, const
    // Insert the value into the specified 
    // Insert the value into the specified 
    // component of the string.
    // component of the string.
    if ( subField == xyzw[0] || subField == rgba[0] )
    if ( subField == xyzw[0] || subField == rgba[0] )
-	  dStrcpy( val, StringUnit::setUnit( prevVal, 0, strValue, " \t\n") );
+     dStrcpy( val, StringUnit::setUnit( prevVal, 0, strValue, " \t\n") );
 
 
    else if ( subField == xyzw[1] || subField == rgba[1] )
    else if ( subField == xyzw[1] || subField == rgba[1] )
       dStrcpy( val, StringUnit::setUnit( prevVal, 1, strValue, " \t\n") );
       dStrcpy( val, StringUnit::setUnit( prevVal, 1, strValue, " \t\n") );
@@ -1020,7 +1020,7 @@ breakContinue:
                dataBlock->deleteObject();
                dataBlock->deleteObject();
                currentNewObject = NULL;
                currentNewObject = NULL;
                ip = failJump;
                ip = failJump;
-			   
+            
                // Prevent stack value corruption
                // Prevent stack value corruption
                CSTK.popFrame();
                CSTK.popFrame();
                STR.popFrame();
                STR.popFrame();
@@ -1164,8 +1164,8 @@ breakContinue:
             
             
          // This fixes a bug when not explicitly returning a value.
          // This fixes a bug when not explicitly returning a value.
          case OP_RETURN_VOID:
          case OP_RETURN_VOID:
-      		STR.setStringValue("");
-      		// We're falling thru here on purpose.
+            STR.setStringValue("");
+            // We're falling thru here on purpose.
             
             
          case OP_RETURN:
          case OP_RETURN:
             retValue = STR.getStringValuePtr();
             retValue = STR.getStringValuePtr();
@@ -1437,7 +1437,7 @@ breakContinue:
          case OP_SAVEVAR_STR:
          case OP_SAVEVAR_STR:
             gEvalState.setStringVariable(STR.getStringValue());
             gEvalState.setStringVariable(STR.getStringValue());
             break;
             break;
-		    
+          
          case OP_SAVEVAR_VAR:
          case OP_SAVEVAR_VAR:
             // this basically handles %var1 = %var2
             // this basically handles %var1 = %var2
             gEvalState.setCopyVariable();
             gEvalState.setCopyVariable();

+ 34 - 34
Engine/source/console/console.cpp

@@ -278,8 +278,8 @@ bool useTimestamp = false;
 ConsoleFunctionGroupBegin( Clipboard, "Miscellaneous functions to control the clipboard and clear the console.");
 ConsoleFunctionGroupBegin( Clipboard, "Miscellaneous functions to control the clipboard and clear the console.");
 
 
 DefineConsoleFunction( cls, void, (), , "()"
 DefineConsoleFunction( cls, void, (), , "()"
-				"@brief Clears the console output.\n\n"
-				"@ingroup Console")
+            "@brief Clears the console output.\n\n"
+            "@ingroup Console")
 {
 {
    if(consoleLogLocked)
    if(consoleLogLocked)
       return;
       return;
@@ -288,17 +288,17 @@ DefineConsoleFunction( cls, void, (), , "()"
 };
 };
 
 
 DefineConsoleFunction( getClipboard, const char*, (), , "()"
 DefineConsoleFunction( getClipboard, const char*, (), , "()"
-				"@brief Get text from the clipboard.\n\n"
-				"@internal")
+            "@brief Get text from the clipboard.\n\n"
+            "@internal")
 {
 {
-	return Platform::getClipboard();
+   return Platform::getClipboard();
 };
 };
 
 
 DefineConsoleFunction( setClipboard, bool, (const char* text), , "(string text)"
 DefineConsoleFunction( setClipboard, bool, (const char* text), , "(string text)"
                "@brief Set the system clipboard.\n\n"
                "@brief Set the system clipboard.\n\n"
-			   "@internal")
+            "@internal")
 {
 {
-	return Platform::setClipboard(text);
+   return Platform::setClipboard(text);
 };
 };
 
 
 ConsoleFunctionGroupEnd( Clipboard );
 ConsoleFunctionGroupEnd( Clipboard );
@@ -332,25 +332,25 @@ void init()
    // Variables
    // Variables
    setVariable("Con::prompt", "% ");
    setVariable("Con::prompt", "% ");
    addVariable("Con::logBufferEnabled", TypeBool, &logBufferEnabled, "If true, the log buffer will be enabled.\n"
    addVariable("Con::logBufferEnabled", TypeBool, &logBufferEnabled, "If true, the log buffer will be enabled.\n"
-	   "@ingroup Console\n");
+      "@ingroup Console\n");
    addVariable("Con::printLevel", TypeS32, &printLevel, 
    addVariable("Con::printLevel", TypeS32, &printLevel, 
       "@brief This is deprecated.\n\n"
       "@brief This is deprecated.\n\n"
       "It is no longer in use and does nothing.\n"      
       "It is no longer in use and does nothing.\n"      
-	   "@ingroup Console\n");
+      "@ingroup Console\n");
    addVariable("Con::warnUndefinedVariables", TypeBool, &gWarnUndefinedScriptVariables, "If true, a warning will be displayed in the console whenever a undefined variable is used in script.\n"
    addVariable("Con::warnUndefinedVariables", TypeBool, &gWarnUndefinedScriptVariables, "If true, a warning will be displayed in the console whenever a undefined variable is used in script.\n"
-	   "@ingroup Console\n");
+      "@ingroup Console\n");
    addVariable( "instantGroup", TypeRealString, &gInstantGroup, "The group that objects will be added to when they are created.\n"
    addVariable( "instantGroup", TypeRealString, &gInstantGroup, "The group that objects will be added to when they are created.\n"
-	   "@ingroup Console\n");
+      "@ingroup Console\n");
 
 
    addVariable("Con::objectCopyFailures", TypeS32, &gObjectCopyFailures, "If greater than zero then it counts the number of object creation "
    addVariable("Con::objectCopyFailures", TypeS32, &gObjectCopyFailures, "If greater than zero then it counts the number of object creation "
       "failures based on a missing copy object and does not report an error..\n"
       "failures based on a missing copy object and does not report an error..\n"
-	   "@ingroup Console\n");   
+      "@ingroup Console\n");   
 
 
    // Current script file name and root
    // Current script file name and root
    addVariable( "Con::File", TypeString, &gCurrentFile, "The currently executing script file.\n"
    addVariable( "Con::File", TypeString, &gCurrentFile, "The currently executing script file.\n"
-	   "@ingroup FileSystem\n");
+      "@ingroup FileSystem\n");
    addVariable( "Con::Root", TypeString, &gCurrentRoot, "The mod folder for the currently executing script file.\n"
    addVariable( "Con::Root", TypeString, &gCurrentRoot, "The mod folder for the currently executing script file.\n"
-	   "@ingroup FileSystem\n" );
+      "@ingroup FileSystem\n" );
 
 
    // alwaysUseDebugOutput determines whether to send output to the platform's 
    // alwaysUseDebugOutput determines whether to send output to the platform's 
    // "debug" system.  see winConsole for an example.  
    // "debug" system.  see winConsole for an example.  
@@ -364,14 +364,14 @@ void init()
    addVariable("Con::alwaysUseDebugOutput", TypeBool, &alwaysUseDebugOutput, 
    addVariable("Con::alwaysUseDebugOutput", TypeBool, &alwaysUseDebugOutput, 
       "@brief Determines whether to send output to the platform's \"debug\" system.\n\n" 
       "@brief Determines whether to send output to the platform's \"debug\" system.\n\n" 
       "@note This is disabled in shipping builds.\n"
       "@note This is disabled in shipping builds.\n"
-	   "@ingroup Console");
+      "@ingroup Console");
 #else
 #else
    alwaysUseDebugOutput = false;
    alwaysUseDebugOutput = false;
 #endif
 #endif
 
 
    // controls whether a timestamp is prepended to every console message
    // controls whether a timestamp is prepended to every console message
    addVariable("Con::useTimestamp", TypeBool, &useTimestamp, "If true a timestamp is prepended to every console message.\n"
    addVariable("Con::useTimestamp", TypeBool, &useTimestamp, "If true a timestamp is prepended to every console message.\n"
-	   "@ingroup Console\n");
+      "@ingroup Console\n");
 
 
    // Plug us into the journaled console input signal.
    // Plug us into the journaled console input signal.
    smConsoleInput.notify(postConsoleInput);
    smConsoleInput.notify(postConsoleInput);
@@ -599,7 +599,7 @@ static void log(const char *string)
 static void _printf(ConsoleLogEntry::Level level, ConsoleLogEntry::Type type, const char* fmt, va_list argptr)
 static void _printf(ConsoleLogEntry::Level level, ConsoleLogEntry::Type type, const char* fmt, va_list argptr)
 {
 {
    if (!active)
    if (!active)
-	   return;
+      return;
    Con::active = false; 
    Con::active = false; 
 
 
    char buffer[8192];
    char buffer[8192];
@@ -781,7 +781,7 @@ Dictionary::Entry *getAddVariableEntry(const char *name)
    StringTableEntry stName = StringTable->insert(name);
    StringTableEntry stName = StringTable->insert(name);
    Dictionary::Entry *entry = gEvalState.globalVars.lookup(stName);
    Dictionary::Entry *entry = gEvalState.globalVars.lookup(stName);
    if (!entry)
    if (!entry)
-	   entry = gEvalState.globalVars.add(stName);
+      entry = gEvalState.globalVars.add(stName);
    return entry;
    return entry;
 }
 }
 
 
@@ -791,7 +791,7 @@ Dictionary::Entry *getAddLocalVariableEntry(const char *name)
    StringTableEntry stName = StringTable->insert(name);
    StringTableEntry stName = StringTable->insert(name);
    Dictionary::Entry *entry = gEvalState.getCurrentFrame().lookup(stName);
    Dictionary::Entry *entry = gEvalState.getCurrentFrame().lookup(stName);
    if (!entry)
    if (!entry)
-	   entry = gEvalState.getCurrentFrame().add(stName);
+      entry = gEvalState.getCurrentFrame().add(stName);
    return entry;
    return entry;
 }
 }
 
 
@@ -802,7 +802,7 @@ void setVariable(const char *name, const char *value)
 
 
    if (getVariableObjectField(name, &obj, &objField))
    if (getVariableObjectField(name, &obj, &objField))
    {
    {
-	   obj->setDataField(StringTable->insert(objField), 0, value);
+      obj->setDataField(StringTable->insert(objField), 0, value);
    }
    }
    else 
    else 
    {
    {
@@ -824,13 +824,13 @@ void setBoolVariable(const char *varName, bool value)
 
 
    if (getVariableObjectField(varName, &obj, &objField))
    if (getVariableObjectField(varName, &obj, &objField))
    {
    {
-	   obj->setDataField(StringTable->insert(objField), 0, value ? "1" : "0");
+      obj->setDataField(StringTable->insert(objField), 0, value ? "1" : "0");
    }
    }
    else
    else
    {
    {
       varName = prependDollar(varName);
       varName = prependDollar(varName);
       Dictionary::Entry *entry = getAddVariableEntry(varName);
       Dictionary::Entry *entry = getAddVariableEntry(varName);
-	  entry->setStringValue(value ? "1" : "0");
+     entry->setStringValue(value ? "1" : "0");
    }
    }
 }
 }
 
 
@@ -841,9 +841,9 @@ void setIntVariable(const char *varName, S32 value)
 
 
    if (getVariableObjectField(varName, &obj, &objField))
    if (getVariableObjectField(varName, &obj, &objField))
    {
    {
-	   char scratchBuffer[32];
-	   dSprintf(scratchBuffer, sizeof(scratchBuffer), "%d", value);
-	   obj->setDataField(StringTable->insert(objField), 0, scratchBuffer);
+      char scratchBuffer[32];
+      dSprintf(scratchBuffer, sizeof(scratchBuffer), "%d", value);
+      obj->setDataField(StringTable->insert(objField), 0, scratchBuffer);
    }
    }
    else
    else
    {
    {
@@ -860,15 +860,15 @@ void setFloatVariable(const char *varName, F32 value)
 
 
    if (getVariableObjectField(varName, &obj, &objField))
    if (getVariableObjectField(varName, &obj, &objField))
    {
    {
-	   char scratchBuffer[32];
-	   dSprintf(scratchBuffer, sizeof(scratchBuffer), "%g", value);
-	   obj->setDataField(StringTable->insert(objField), 0, scratchBuffer);
+      char scratchBuffer[32];
+      dSprintf(scratchBuffer, sizeof(scratchBuffer), "%g", value);
+      obj->setDataField(StringTable->insert(objField), 0, scratchBuffer);
    }
    }
    else
    else
    {
    {
       varName = prependDollar(varName);
       varName = prependDollar(varName);
       Dictionary::Entry *entry = getAddVariableEntry(varName);
       Dictionary::Entry *entry = getAddVariableEntry(varName);
-	  entry->setFloatValue(value);
+     entry->setFloatValue(value);
    }
    }
 }
 }
 
 
@@ -1020,7 +1020,7 @@ F32 getFloatVariable(const char *varName, F32 def)
    else
    else
    {
    {
       Dictionary::Entry *entry = getVariableEntry(varName);
       Dictionary::Entry *entry = getVariableEntry(varName);
-	   return entry ? entry->getFloatValue() : def;
+      return entry ? entry->getFloatValue() : def;
    }
    }
 }
 }
 
 
@@ -1308,8 +1308,8 @@ bool executeFile(const char* fileName, bool noCalls, bool journalScript)
 
 
    // Let's do a sanity check to complain about DSOs in the future.
    // Let's do a sanity check to complain about DSOs in the future.
    //
    //
-   // MM:	This doesn't seem to be working correctly for now so let's just not issue
-   //		the warning until someone knows how to resolve it.
+   // MM:   This doesn't seem to be working correctly for now so let's just not issue
+   //    the warning until someone knows how to resolve it.
    //
    //
    //if(compiled && rCom && rScr && Platform::compareFileTimes(comModifyTime, scrModifyTime) < 0)
    //if(compiled && rCom && rScr && Platform::compareFileTimes(comModifyTime, scrModifyTime) < 0)
    //{
    //{
@@ -1515,7 +1515,7 @@ ConsoleValueRef execute(S32 argc, ConsoleValueRef argv[])
 #endif
 #endif
       ConsoleStackFrameSaver stackSaver;
       ConsoleStackFrameSaver stackSaver;
       stackSaver.save();
       stackSaver.save();
-	   return _internalExecute(argc, argv);
+      return _internalExecute(argc, argv);
 #ifdef TORQUE_MULTITHREAD
 #ifdef TORQUE_MULTITHREAD
    }
    }
    else
    else
@@ -2616,7 +2616,7 @@ const char *ConsoleValue::getStringValue()
 
 
       U32 stringLen = dStrlen(internalValue);
       U32 stringLen = dStrlen(internalValue);
       U32 newLen = ((stringLen + 1) + 15) & ~15; // pad upto next cache line
       U32 newLen = ((stringLen + 1) + 15) & ~15; // pad upto next cache line
-	   
+      
       if (bufferLen == 0)
       if (bufferLen == 0)
          sval = (char *) dMalloc(newLen);
          sval = (char *) dMalloc(newLen);
       else if(newLen > bufferLen)
       else if(newLen > bufferLen)

+ 2 - 2
Engine/source/console/consoleDoc.cpp

@@ -45,7 +45,7 @@ DefineConsoleFunction( dumpConsoleClasses, void, (bool dumpScript, bool dumpEngi
             "@brief Dumps all declared console classes to the console.\n\n"
             "@brief Dumps all declared console classes to the console.\n\n"
             "@param dumpScript Optional parameter specifying whether or not classes defined in script should be dumped.\n"
             "@param dumpScript Optional parameter specifying whether or not classes defined in script should be dumped.\n"
             "@param dumpEngine Optional parameter specifying whether or not classes defined in the engine should be dumped.\n"
             "@param dumpEngine Optional parameter specifying whether or not classes defined in the engine should be dumped.\n"
-			"@ingroup Logging")
+         "@ingroup Logging")
 {
 {
    Namespace::dumpClasses( dumpScript, dumpEngine );
    Namespace::dumpClasses( dumpScript, dumpEngine );
 }
 }
@@ -54,7 +54,7 @@ DefineConsoleFunction(dumpConsoleFunctions, void, ( bool dumpScript, bool dumpEn
             "@brief Dumps all declared console functions to the console.\n"
             "@brief Dumps all declared console functions to the console.\n"
             "@param dumpScript Optional parameter specifying whether or not functions defined in script should be dumped.\n"
             "@param dumpScript Optional parameter specifying whether or not functions defined in script should be dumped.\n"
             "@param dumpEngine Optional parameter specitying whether or not functions defined in the engine should be dumped.\n"
             "@param dumpEngine Optional parameter specitying whether or not functions defined in the engine should be dumped.\n"
-			"@ingroup Logging")
+         "@ingroup Logging")
 {
 {
    Namespace::dumpFunctions( dumpScript, dumpEngine );
    Namespace::dumpFunctions( dumpScript, dumpEngine );
 }
 }

+ 65 - 65
Engine/source/console/consoleFunctions.cpp

@@ -463,12 +463,12 @@ DefineConsoleFunction( strposr, S32, ( const char* haystack, const char* needle,
    U32 sublen = dStrlen( needle );
    U32 sublen = dStrlen( needle );
    U32 strlen = dStrlen( haystack );
    U32 strlen = dStrlen( haystack );
    S32 start = strlen - offset;
    S32 start = strlen - offset;
-   	
+      
    if(start < 0 || start > strlen)
    if(start < 0 || start > strlen)
       return -1;
       return -1;
    
    
    if (start + sublen > strlen)
    if (start + sublen > strlen)
-	  start = strlen - sublen;
+     start = strlen - sublen;
    for(; start >= 0; start--)
    for(; start >= 0; start--)
       if(!dStrncmp(haystack + start, needle, sublen))
       if(!dStrncmp(haystack + start, needle, sublen))
          return start;
          return start;
@@ -1022,15 +1022,15 @@ DefineConsoleFunction( strrchrpos, S32, ( const char* str, const char* chr, S32
 //----------------------------------------------------------------
 //----------------------------------------------------------------
 
 
 DefineConsoleFunction(ColorFloatToInt, ColorI, (ColorF color), ,
 DefineConsoleFunction(ColorFloatToInt, ColorI, (ColorF color), ,
-	"Convert from a float color to an integer color (0.0 - 1.0 to 0 to 255).\n"
-	"@param color Float color value to be converted in the form \"R G B A\", where R is red, G is green, B is blue, and A is alpha.\n"
-	"@return Converted color value (0 - 255)\n\n"
-	"@tsexample\n"
-	"ColorFloatToInt( \"0 0 1 0.5\" ) // Returns \"0 0 255 128\".\n"
-	"@endtsexample\n"
-	"@ingroup Strings")
+   "Convert from a float color to an integer color (0.0 - 1.0 to 0 to 255).\n"
+   "@param color Float color value to be converted in the form \"R G B A\", where R is red, G is green, B is blue, and A is alpha.\n"
+   "@return Converted color value (0 - 255)\n\n"
+   "@tsexample\n"
+   "ColorFloatToInt( \"0 0 1 0.5\" ) // Returns \"0 0 255 128\".\n"
+   "@endtsexample\n"
+   "@ingroup Strings")
 {
 {
-	return (ColorI)color;
+   return (ColorI)color;
 }
 }
 
 
 DefineConsoleFunction(ColorIntToFloat, ColorF, (ColorI color), ,
 DefineConsoleFunction(ColorIntToFloat, ColorF, (ColorI color), ,
@@ -1201,8 +1201,8 @@ DefineConsoleFunction( isValidIP, bool, ( const char* str),,
 ConsoleFunction(addCaseSensitiveStrings,void,2,0,"[string1, string2, ...]"
 ConsoleFunction(addCaseSensitiveStrings,void,2,0,"[string1, string2, ...]"
                 "Adds case sensitive strings to the StringTable.")
                 "Adds case sensitive strings to the StringTable.")
 {
 {
-	for(int i = 1; i < argc; i++)
-		StringTable->insert(argv[i], true);
+   for(int i = 1; i < argc; i++)
+      StringTable->insert(argv[i], true);
 }
 }
 
 
 //=============================================================================
 //=============================================================================
@@ -1645,7 +1645,7 @@ DefineConsoleFunction( nextToken, const char*, ( const char* str1, const char* t
    "@endtsexample\n\n"
    "@endtsexample\n\n"
    "@ingroup Strings" )
    "@ingroup Strings" )
 {
 {
-	char buffer[4096];
+   char buffer[4096];
    dStrncpy(buffer, str1, 4096);
    dStrncpy(buffer, str1, 4096);
    char *str = buffer;
    char *str = buffer;
 
 
@@ -1812,7 +1812,7 @@ DefineEngineFunction( detag, const char*, ( const char* str ),,
       "{\n"
       "{\n"
       "   onChatMessage(detag(%msgString), %voice, %pitch);\n"
       "   onChatMessage(detag(%msgString), %voice, %pitch);\n"
       "}\n"
       "}\n"
-	"@endtsexample\n\n"
+   "@endtsexample\n\n"
 
 
    "@see \\ref syntaxDataTypes under Tagged %Strings\n"
    "@see \\ref syntaxDataTypes under Tagged %Strings\n"
    "@see getTag()\n"
    "@see getTag()\n"
@@ -2017,8 +2017,8 @@ DefineConsoleFunction( collapseEscape, const char*, ( const char* text ),,
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
 DefineEngineFunction( setLogMode, void, ( S32 mode ),,
 DefineEngineFunction( setLogMode, void, ( S32 mode ),,
-	"@brief Determines how log files are written.\n\n"
-	"Sets the operational mode of the console logging system.\n\n"
+   "@brief Determines how log files are written.\n\n"
+   "Sets the operational mode of the console logging system.\n\n"
    "@param mode Parameter specifying the logging mode.  This can be:\n"
    "@param mode Parameter specifying the logging mode.  This can be:\n"
       "- 1: Open and close the console log file for each seperate string of output.  This will ensure that all "
       "- 1: Open and close the console log file for each seperate string of output.  This will ensure that all "
          "parts get written out to disk and that no parts remain in intermediate buffers even if the process crashes.\n"
          "parts get written out to disk and that no parts remain in intermediate buffers even if the process crashes.\n"
@@ -2030,8 +2030,8 @@ DefineEngineFunction( setLogMode, void, ( S32 mode ),,
       "combined by binary OR with 0x4 to cause the logging system to flush all console log messages that had already been "
       "combined by binary OR with 0x4 to cause the logging system to flush all console log messages that had already been "
       "issued to the console system into the newly created log file.\n\n"
       "issued to the console system into the newly created log file.\n\n"
 
 
-	"@note Xbox 360 does not support logging to a file. Use Platform::OutputDebugStr in C++ instead."
-	"@ingroup Logging" )
+   "@note Xbox 360 does not support logging to a file. Use Platform::OutputDebugStr in C++ instead."
+   "@ingroup Logging" )
 {
 {
    Con::setLogMode( mode );
    Con::setLogMode( mode );
 }
 }
@@ -2144,7 +2144,7 @@ DefineEngineFunction( gotoWebPage, void, ( const char* address ),,
 DefineEngineFunction( displaySplashWindow, bool, (const char* path), (""),
 DefineEngineFunction( displaySplashWindow, bool, (const char* path), (""),
    "Display a startup splash window suitable for showing while the engine still starts up.\n\n"
    "Display a startup splash window suitable for showing while the engine still starts up.\n\n"
    "@note This is currently only implemented on Windows.\n\n"
    "@note This is currently only implemented on Windows.\n\n"
-   "@param path	relative path to splash screen image to display.\n"
+   "@param path   relative path to splash screen image to display.\n"
    "@return True if the splash window could be successfully initialized.\n\n"
    "@return True if the splash window could be successfully initialized.\n\n"
    "@ingroup Platform" )
    "@ingroup Platform" )
 {
 {
@@ -2395,19 +2395,19 @@ DefineConsoleFunction( setVariable, void, ( const char* varName, const char* val
 }
 }
 
 
 DefineConsoleFunction( isFunction, bool, ( const char* funcName ), , "(string funcName)" 
 DefineConsoleFunction( isFunction, bool, ( const char* funcName ), , "(string funcName)" 
-	"@brief Determines if a function exists or not\n\n"
-	"@param funcName String containing name of the function\n"
-	"@return True if the function exists, false if not\n"
-	"@ingroup Scripting")
+   "@brief Determines if a function exists or not\n\n"
+   "@param funcName String containing name of the function\n"
+   "@return True if the function exists, false if not\n"
+   "@ingroup Scripting")
 {
 {
    return Con::isFunction(funcName);
    return Con::isFunction(funcName);
 }
 }
 
 
 DefineConsoleFunction( getFunctionPackage, const char*, ( const char* funcName ), , "(string funcName)" 
 DefineConsoleFunction( getFunctionPackage, const char*, ( const char* funcName ), , "(string funcName)" 
-	"@brief Provides the name of the package the function belongs to\n\n"
-	"@param funcName String containing name of the function\n"
-	"@return The name of the function's package\n"
-	"@ingroup Packages")
+   "@brief Provides the name of the package the function belongs to\n\n"
+   "@param funcName String containing name of the function\n"
+   "@return The name of the function's package\n"
+   "@ingroup Packages")
 {
 {
    Namespace::Entry* nse = Namespace::global()->lookup( StringTable->insert( funcName ) );
    Namespace::Entry* nse = Namespace::global()->lookup( StringTable->insert( funcName ) );
    if( !nse )
    if( !nse )
@@ -2417,11 +2417,11 @@ DefineConsoleFunction( getFunctionPackage, const char*, ( const char* funcName )
 }
 }
 
 
 DefineConsoleFunction( isMethod, bool, ( const char* nameSpace, const char* method ), , "(string namespace, string method)" 
 DefineConsoleFunction( isMethod, bool, ( const char* nameSpace, const char* method ), , "(string namespace, string method)" 
-	"@brief Determines if a class/namespace method exists\n\n"
-	"@param namespace Class or namespace, such as Player\n"
-	"@param method Name of the function to search for\n"
-	"@return True if the method exists, false if not\n"
-	"@ingroup Scripting\n")
+   "@brief Determines if a class/namespace method exists\n\n"
+   "@param namespace Class or namespace, such as Player\n"
+   "@param method Name of the function to search for\n"
+   "@return True if the method exists, false if not\n"
+   "@ingroup Scripting\n")
 {
 {
    Namespace* ns = Namespace::find( StringTable->insert( nameSpace ) );
    Namespace* ns = Namespace::find( StringTable->insert( nameSpace ) );
    Namespace::Entry* nse = ns->lookup( StringTable->insert( method ) );
    Namespace::Entry* nse = ns->lookup( StringTable->insert( method ) );
@@ -2432,11 +2432,11 @@ DefineConsoleFunction( isMethod, bool, ( const char* nameSpace, const char* meth
 }
 }
 
 
 DefineConsoleFunction( getMethodPackage, const char*, ( const char* nameSpace, const char* method ), , "(string namespace, string method)" 
 DefineConsoleFunction( getMethodPackage, const char*, ( const char* nameSpace, const char* method ), , "(string namespace, string method)" 
-	"@brief Provides the name of the package the method belongs to\n\n"
-	"@param namespace Class or namespace, such as Player\n"
-	"@param method Name of the funciton to search for\n"
-	"@return The name of the method's package\n"
-	"@ingroup Packages")
+   "@brief Provides the name of the package the method belongs to\n\n"
+   "@param namespace Class or namespace, such as Player\n"
+   "@param method Name of the funciton to search for\n"
+   "@return The name of the method's package\n"
+   "@ingroup Packages")
 {
 {
    Namespace* ns = Namespace::find( StringTable->insert( nameSpace ) );
    Namespace* ns = Namespace::find( StringTable->insert( nameSpace ) );
    if( !ns )
    if( !ns )
@@ -2450,13 +2450,13 @@ DefineConsoleFunction( getMethodPackage, const char*, ( const char* nameSpace, c
 }
 }
 
 
 DefineConsoleFunction( isDefined, bool, ( const char* varName, const char* varValue ), ("") , "(string varName)" 
 DefineConsoleFunction( isDefined, bool, ( const char* varName, const char* varValue ), ("") , "(string varName)" 
-	"@brief Determines if a variable exists and contains a value\n"
-	"@param varName Name of the variable to search for\n"
-	"@return True if the variable was defined in script, false if not\n"
+   "@brief Determines if a variable exists and contains a value\n"
+   "@param varName Name of the variable to search for\n"
+   "@return True if the variable was defined in script, false if not\n"
    "@tsexample\n"
    "@tsexample\n"
       "isDefined( \"$myVar\" );\n"
       "isDefined( \"$myVar\" );\n"
    "@endtsexample\n\n"
    "@endtsexample\n\n"
-	"@ingroup Scripting")
+   "@ingroup Scripting")
 {
 {
    if(String::isEmpty(varName))
    if(String::isEmpty(varName))
    {
    {
@@ -2595,10 +2595,10 @@ DefineConsoleFunction( isCurrentScriptToolScript, bool, (), , "()"
 }
 }
 
 
 DefineConsoleFunction( getModNameFromPath, const char *, ( const char* path ), , "(string path)" 
 DefineConsoleFunction( getModNameFromPath, const char *, ( const char* path ), , "(string path)" 
-				"@brief Attempts to extract a mod directory from path. Returns empty string on failure.\n\n"
-				"@param File path of mod folder\n"
-				"@note This is no longer relevant in Torque 3D (which does not use mod folders), should be deprecated\n"
-				"@internal")
+            "@brief Attempts to extract a mod directory from path. Returns empty string on failure.\n\n"
+            "@param File path of mod folder\n"
+            "@note This is no longer relevant in Torque 3D (which does not use mod folders), should be deprecated\n"
+            "@internal")
 {
 {
    StringTableEntry modPath = Con::getModNameFromPath(path);
    StringTableEntry modPath = Con::getModNameFromPath(path);
    return modPath ? modPath : "";
    return modPath ? modPath : "";
@@ -2607,11 +2607,11 @@ DefineConsoleFunction( getModNameFromPath, const char *, ( const char* path ), ,
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
 DefineConsoleFunction( pushInstantGroup, void, ( String group ),("") , "([group])" 
 DefineConsoleFunction( pushInstantGroup, void, ( String group ),("") , "([group])" 
-				"@brief Pushes the current $instantGroup on a stack "
-				"and sets it to the given value (or clears it).\n\n"
-				"@note Currently only used for editors\n"
-				"@ingroup Editors\n"
-				"@internal")
+            "@brief Pushes the current $instantGroup on a stack "
+            "and sets it to the given value (or clears it).\n\n"
+            "@note Currently only used for editors\n"
+            "@ingroup Editors\n"
+            "@internal")
 {
 {
    if( group.size() > 0 )
    if( group.size() > 0 )
       Con::pushInstantGroup( group );
       Con::pushInstantGroup( group );
@@ -2620,10 +2620,10 @@ DefineConsoleFunction( pushInstantGroup, void, ( String group ),("") , "([group]
 }
 }
 
 
 DefineConsoleFunction( popInstantGroup, void, (), , "()" 
 DefineConsoleFunction( popInstantGroup, void, (), , "()" 
-				"@brief Pop and restore the last setting of $instantGroup off the stack.\n\n"
-				"@note Currently only used for editors\n\n"
-				"@ingroup Editors\n"
-				"@internal")
+            "@brief Pop and restore the last setting of $instantGroup off the stack.\n\n"
+            "@note Currently only used for editors\n\n"
+            "@ingroup Editors\n"
+            "@internal")
 {
 {
    Con::popInstantGroup();
    Con::popInstantGroup();
 }
 }
@@ -2631,8 +2631,8 @@ DefineConsoleFunction( popInstantGroup, void, (), , "()"
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
 DefineConsoleFunction( getPrefsPath, const char *, ( const char* relativeFileName ), (""), "([relativeFileName])" 
 DefineConsoleFunction( getPrefsPath, const char *, ( const char* relativeFileName ), (""), "([relativeFileName])" 
-				"@note Appears to be useless in Torque 3D, should be deprecated\n"
-				"@internal")
+            "@note Appears to be useless in Torque 3D, should be deprecated\n"
+            "@internal")
 {
 {
    const char *filename = Platform::getPrefsPath(relativeFileName);
    const char *filename = Platform::getPrefsPath(relativeFileName);
    if(filename == NULL || *filename == 0)
    if(filename == NULL || *filename == 0)
@@ -2644,13 +2644,13 @@ DefineConsoleFunction( getPrefsPath, const char *, ( const char* relativeFileNam
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
 ConsoleFunction( execPrefs, bool, 2, 4, "( string relativeFileName, bool noCalls=false, bool journalScript=false )"
 ConsoleFunction( execPrefs, bool, 2, 4, "( string relativeFileName, bool noCalls=false, bool journalScript=false )"
-				"@brief Manually execute a special script file that contains game or editor preferences\n\n"
-				"@param relativeFileName Name and path to file from project folder\n"
-				"@param noCalls Deprecated\n"
-				"@param journalScript Deprecated\n"
-				"@return True if script was successfully executed\n"
-				"@note Appears to be useless in Torque 3D, should be deprecated\n"
-				"@ingroup Scripting")
+            "@brief Manually execute a special script file that contains game or editor preferences\n\n"
+            "@param relativeFileName Name and path to file from project folder\n"
+            "@param noCalls Deprecated\n"
+            "@param journalScript Deprecated\n"
+            "@return True if script was successfully executed\n"
+            "@note Appears to be useless in Torque 3D, should be deprecated\n"
+            "@ingroup Scripting")
 {
 {
    const char *filename = Platform::getPrefsPath(argv[1]);
    const char *filename = Platform::getPrefsPath(argv[1]);
    if(filename == NULL || *filename == 0)
    if(filename == NULL || *filename == 0)
@@ -2791,8 +2791,8 @@ DefineEngineFunction( isToolBuild, bool, (),,
 }
 }
 
 
 DefineEngineFunction( getMaxDynamicVerts, S32, (),,
 DefineEngineFunction( getMaxDynamicVerts, S32, (),,
-	"Get max number of allowable dynamic vertices in a single vertex buffer.\n\n"
-	"@return the max number of allowable dynamic vertices in a single vertex buffer" )
+   "Get max number of allowable dynamic vertices in a single vertex buffer.\n\n"
+   "@return the max number of allowable dynamic vertices in a single vertex buffer" )
 {
 {
    return MAX_DYNAMIC_VERTS / 2;
    return MAX_DYNAMIC_VERTS / 2;
 }
 }

+ 7 - 7
Engine/source/console/consoleInternal.cpp

@@ -510,7 +510,7 @@ void ConsoleValue::setStringValue(const char * value)
          return;
          return;
       }
       }
 */
 */
-	   if (value == typeValueEmpty)
+      if (value == typeValueEmpty)
       {
       {
          if (bufferLen > 0)
          if (bufferLen > 0)
          {
          {
@@ -544,7 +544,7 @@ void ConsoleValue::setStringValue(const char * value)
 
 
       // may as well pad to the next cache line
       // may as well pad to the next cache line
       U32 newLen = ((stringLen + 1) + 15) & ~15;
       U32 newLen = ((stringLen + 1) + 15) & ~15;
-	  
+     
       if(bufferLen == 0)
       if(bufferLen == 0)
          sval = (char *) dMalloc(newLen);
          sval = (char *) dMalloc(newLen);
       else if(newLen > bufferLen)
       else if(newLen > bufferLen)
@@ -573,7 +573,7 @@ void ConsoleValue::setStackStringValue(const char *value)
          bufferLen = 0;
          bufferLen = 0;
       }
       }
 
 
-	   if (value == typeValueEmpty)
+      if (value == typeValueEmpty)
       {
       {
          sval = typeValueEmpty;
          sval = typeValueEmpty;
          fval = 0.f;
          fval = 0.f;
@@ -607,7 +607,7 @@ void ConsoleValue::setStringStackPtrValue(StringStackPtr ptrValue)
    if(type <= ConsoleValue::TypeInternalString)
    if(type <= ConsoleValue::TypeInternalString)
    {
    {
       const char *value = StringStackPtrRef(ptrValue).getPtr(&STR);
       const char *value = StringStackPtrRef(ptrValue).getPtr(&STR);
-	   if (bufferLen > 0)
+      if (bufferLen > 0)
       {
       {
          dFree(sval);
          dFree(sval);
          bufferLen = 0;
          bufferLen = 0;
@@ -1418,14 +1418,14 @@ ConsoleValueRef Namespace::Entry::execute(S32 argc, ConsoleValueRef *argv, ExprE
       case StringCallbackType:
       case StringCallbackType:
          return ConsoleValueRef::fromValue(CSTK.pushStackString(cb.mStringCallbackFunc(state->thisObject, argc, argv)));
          return ConsoleValueRef::fromValue(CSTK.pushStackString(cb.mStringCallbackFunc(state->thisObject, argc, argv)));
       case IntCallbackType:
       case IntCallbackType:
-		 return ConsoleValueRef::fromValue(CSTK.pushUINT((U32)cb.mBoolCallbackFunc(state->thisObject, argc, argv)));
+       return ConsoleValueRef::fromValue(CSTK.pushUINT((U32)cb.mBoolCallbackFunc(state->thisObject, argc, argv)));
       case FloatCallbackType:
       case FloatCallbackType:
-		 return ConsoleValueRef::fromValue(CSTK.pushFLT((U32)cb.mBoolCallbackFunc(state->thisObject, argc, argv)));
+       return ConsoleValueRef::fromValue(CSTK.pushFLT((U32)cb.mBoolCallbackFunc(state->thisObject, argc, argv)));
       case VoidCallbackType:
       case VoidCallbackType:
          cb.mVoidCallbackFunc(state->thisObject, argc, argv);
          cb.mVoidCallbackFunc(state->thisObject, argc, argv);
          return ConsoleValueRef();
          return ConsoleValueRef();
       case BoolCallbackType:
       case BoolCallbackType:
-		 return ConsoleValueRef::fromValue(CSTK.pushUINT((U32)cb.mBoolCallbackFunc(state->thisObject, argc, argv)));
+       return ConsoleValueRef::fromValue(CSTK.pushUINT((U32)cb.mBoolCallbackFunc(state->thisObject, argc, argv)));
    }
    }
    
    
    return ConsoleValueRef();
    return ConsoleValueRef();

+ 28 - 28
Engine/source/console/consoleLogger.cpp

@@ -226,20 +226,20 @@ void ConsoleLogger::log( const char *consoleLine )
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
 DefineConsoleMethod( ConsoleLogger, attach, bool, (), , "() Attaches the logger to the console and begins writing to file"
 DefineConsoleMethod( ConsoleLogger, attach, bool, (), , "() Attaches the logger to the console and begins writing to file"
-			  "@tsexample\n"
-			  "// Create the logger\n"
-			  "// Will automatically start writing to testLogging.txt with normal priority\n"
-			  "new ConsoleLogger(logger, \"testLogging.txt\", false);\n\n"
-			  "// Send something to the console, with the logger consumes and writes to file\n"
-			  "echo(\"This is logged to the file\");\n\n"
-			  "// Stop logging, but do not delete the logger\n"
-			  "logger.detach();\n\n"
-			  "echo(\"This is not logged to the file\");\n\n"
-			  "// Attach the logger to the console again\n"
-			  "logger.attach();\n\n"
-			  "// Logging has resumed\n"
-			  "echo(\"Logging has resumed\");"
-			  "@endtsexample\n\n")
+           "@tsexample\n"
+           "// Create the logger\n"
+           "// Will automatically start writing to testLogging.txt with normal priority\n"
+           "new ConsoleLogger(logger, \"testLogging.txt\", false);\n\n"
+           "// Send something to the console, with the logger consumes and writes to file\n"
+           "echo(\"This is logged to the file\");\n\n"
+           "// Stop logging, but do not delete the logger\n"
+           "logger.detach();\n\n"
+           "echo(\"This is not logged to the file\");\n\n"
+           "// Attach the logger to the console again\n"
+           "logger.attach();\n\n"
+           "// Logging has resumed\n"
+           "echo(\"Logging has resumed\");"
+           "@endtsexample\n\n")
 {
 {
    ConsoleLogger *logger = static_cast<ConsoleLogger *>( object );
    ConsoleLogger *logger = static_cast<ConsoleLogger *>( object );
    return logger->attach();
    return logger->attach();
@@ -248,20 +248,20 @@ DefineConsoleMethod( ConsoleLogger, attach, bool, (), , "() Attaches the logger
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
 DefineConsoleMethod( ConsoleLogger, detach, bool, (), , "() Detaches the logger from the console and stops writing to file"
 DefineConsoleMethod( ConsoleLogger, detach, bool, (), , "() Detaches the logger from the console and stops writing to file"
-			  "@tsexample\n"
-			  "// Create the logger\n"
-			  "// Will automatically start writing to testLogging.txt with normal priority\n"
-			  "new ConsoleLogger(logger, \"testLogging.txt\", false);\n\n"
-			  "// Send something to the console, with the logger consumes and writes to file\n"
-			  "echo(\"This is logged to the file\");\n\n"
-			  "// Stop logging, but do not delete the logger\n"
-			  "logger.detach();\n\n"
-			  "echo(\"This is not logged to the file\");\n\n"
-			  "// Attach the logger to the console again\n"
-			  "logger.attach();\n\n"
-			  "// Logging has resumed\n"
-			  "echo(\"Logging has resumed\");"
-			  "@endtsexample\n\n")
+           "@tsexample\n"
+           "// Create the logger\n"
+           "// Will automatically start writing to testLogging.txt with normal priority\n"
+           "new ConsoleLogger(logger, \"testLogging.txt\", false);\n\n"
+           "// Send something to the console, with the logger consumes and writes to file\n"
+           "echo(\"This is logged to the file\");\n\n"
+           "// Stop logging, but do not delete the logger\n"
+           "logger.detach();\n\n"
+           "echo(\"This is not logged to the file\");\n\n"
+           "// Attach the logger to the console again\n"
+           "logger.attach();\n\n"
+           "// Logging has resumed\n"
+           "echo(\"Logging has resumed\");"
+           "@endtsexample\n\n")
 {
 {
    ConsoleLogger *logger = static_cast<ConsoleLogger *>( object );
    ConsoleLogger *logger = static_cast<ConsoleLogger *>( object );
    return logger->detach();
    return logger->detach();

+ 29 - 29
Engine/source/console/consoleObject.cpp

@@ -334,15 +334,15 @@ AbstractClassRep *AbstractClassRep::getCommonParent( const AbstractClassRep *oth
 static char replacebuf[1024];
 static char replacebuf[1024];
 static char* suppressSpaces(const char* in_pname)
 static char* suppressSpaces(const char* in_pname)
 {
 {
-	U32 i = 0;
-	char chr;
-	do
-	{
-		chr = in_pname[i];
-		replacebuf[i++] = (chr != 32) ? chr : '_';
-	} while(chr);
+   U32 i = 0;
+   char chr;
+   do
+   {
+      chr = in_pname[i];
+      replacebuf[i++] = (chr != 32) ? chr : '_';
+   } while(chr);
 
 
-	return replacebuf;
+   return replacebuf;
 }
 }
 
 
 void ConsoleObject::addGroup(const char* in_pGroupname, const char* in_pGroupDocs)
 void ConsoleObject::addGroup(const char* in_pGroupname, const char* in_pGroupDocs)
@@ -740,8 +740,8 @@ static const char* returnClassList( Vector< AbstractClassRep* >& classes, U32 bu
 //------------------------------------------------------------------------------
 //------------------------------------------------------------------------------
 
 
 DefineEngineFunction( isClass, bool,  ( const char* identifier ),,
 DefineEngineFunction( isClass, bool,  ( const char* identifier ),,
-				"@brief Returns true if the passed identifier is the name of a declared class.\n\n"
-				"@ingroup Console")
+            "@brief Returns true if the passed identifier is the name of a declared class.\n\n"
+            "@ingroup Console")
 {
 {
    AbstractClassRep* rep = AbstractClassRep::findClassRep( identifier );
    AbstractClassRep* rep = AbstractClassRep::findClassRep( identifier );
    return rep != NULL;
    return rep != NULL;
@@ -765,10 +765,10 @@ DefineEngineFunction( isMemberOfClass, bool, ( const char* className, const char
 }
 }
 
 
 DefineEngineFunction( getDescriptionOfClass, const char*, ( const char* className ),,
 DefineEngineFunction( getDescriptionOfClass, const char*, ( const char* className ),,
-				"@brief Returns the description string for the named class.\n\n"
-				"@param className The name of the class.\n"
-				"@return The class description in string format.\n"
-				"@ingroup Console")
+            "@brief Returns the description string for the named class.\n\n"
+            "@param className The name of the class.\n"
+            "@return The class description in string format.\n"
+            "@ingroup Console")
 {
 {
    AbstractClassRep* rep = AbstractClassRep::findClassRep( className );
    AbstractClassRep* rep = AbstractClassRep::findClassRep( className );
    if( rep )
    if( rep )
@@ -779,9 +779,9 @@ DefineEngineFunction( getDescriptionOfClass, const char*, ( const char* classNam
 }
 }
 
 
 DefineEngineFunction( getCategoryOfClass, const char*,  ( const char* className ),,
 DefineEngineFunction( getCategoryOfClass, const char*,  ( const char* className ),,
-				"@brief Returns the category of the given class.\n\n"
-				"@param className The name of the class.\n"
-				"@ingroup Console")
+            "@brief Returns the category of the given class.\n\n"
+            "@param className The name of the class.\n"
+            "@ingroup Console")
 {
 {
    AbstractClassRep* rep = AbstractClassRep::findClassRep( className );
    AbstractClassRep* rep = AbstractClassRep::findClassRep( className );
    if( rep )
    if( rep )
@@ -792,12 +792,12 @@ DefineEngineFunction( getCategoryOfClass, const char*,  ( const char* className
 }
 }
 
 
 DefineEngineFunction( enumerateConsoleClasses, const char*, ( const char* className ), ( "" ),
 DefineEngineFunction( enumerateConsoleClasses, const char*, ( const char* className ), ( "" ),
-				"@brief Returns a list of classes that derive from the named class.\n\n"
+            "@brief Returns a list of classes that derive from the named class.\n\n"
             "If the named class is omitted this dumps all the classes.\n"
             "If the named class is omitted this dumps all the classes.\n"
             "@param className The optional base class name.\n"
             "@param className The optional base class name.\n"
-				"@return A tab delimited list of classes.\n"
+            "@return A tab delimited list of classes.\n"
             "@ingroup Editors\n"
             "@ingroup Editors\n"
-				"@internal")
+            "@internal")
 {
 {
    AbstractClassRep *base = NULL;    
    AbstractClassRep *base = NULL;    
    if(className && *className)
    if(className && *className)
@@ -822,11 +822,11 @@ DefineEngineFunction( enumerateConsoleClasses, const char*, ( const char* classN
 }
 }
 
 
 DefineEngineFunction( enumerateConsoleClassesByCategory, const char*, ( String category ),,
 DefineEngineFunction( enumerateConsoleClassesByCategory, const char*, ( String category ),,
-				"@brief Provide a list of classes that belong to the given category.\n\n"
-				"@param category The category name.\n"
-				"@return A tab delimited list of classes.\n"
-				"@ingroup Editors\n"
-				"@internal")
+            "@brief Provide a list of classes that belong to the given category.\n\n"
+            "@param category The category name.\n"
+            "@return A tab delimited list of classes.\n"
+            "@ingroup Editors\n"
+            "@internal")
 {
 {
    U32 categoryLength = category.length();
    U32 categoryLength = category.length();
    
    
@@ -914,10 +914,10 @@ DefineEngineFunction( dumpNetStats, void, (),,
 }
 }
 
 
 DefineEngineFunction( sizeof, S32, ( const char *objectOrClass ),,
 DefineEngineFunction( sizeof, S32, ( const char *objectOrClass ),,
-				"@brief Determines the memory consumption of a class or object.\n\n"
-				"@param objectOrClass The object or class being measured.\n"
-				"@return Returns the total size of an object in bytes.\n"
-				"@ingroup Debugging\n")
+            "@brief Determines the memory consumption of a class or object.\n\n"
+            "@param objectOrClass The object or class being measured.\n"
+            "@return Returns the total size of an object in bytes.\n"
+            "@ingroup Debugging\n")
 {
 {
    AbstractClassRep *acr = NULL;
    AbstractClassRep *acr = NULL;
    SimObject *obj = Sim::findObject(objectOrClass);
    SimObject *obj = Sim::findObject(objectOrClass);

+ 25 - 25
Engine/source/console/consoleParser.cpp

@@ -35,21 +35,21 @@ static ConsoleParser *gDefaultParser = NULL;
 
 
 void freeConsoleParserList(void)
 void freeConsoleParserList(void)
 {
 {
-	while(gParserList)
-	{
+   while(gParserList)
+   {
       ConsoleParser * pParser = gParserList;
       ConsoleParser * pParser = gParserList;
-		gParserList = pParser->next;
-		delete pParser;
-	}
+      gParserList = pParser->next;
+      delete pParser;
+   }
 
 
-	gDefaultParser = NULL;
+   gDefaultParser = NULL;
 }
 }
 
 
 bool addConsoleParser(char *ext, fnGetCurrentFile gcf, fnGetCurrentLine gcl, fnParse p, fnRestart r, fnSetScanBuffer ssb, bool def)
 bool addConsoleParser(char *ext, fnGetCurrentFile gcf, fnGetCurrentLine gcl, fnParse p, fnRestart r, fnSetScanBuffer ssb, bool def)
 {
 {
-	AssertFatal(ext && gcf && gcl && p && r, "AddConsoleParser called with one or more NULL arguments");
+   AssertFatal(ext && gcf && gcl && p && r, "AddConsoleParser called with one or more NULL arguments");
 
 
-	ConsoleParser * pParser = new ConsoleParser;
+   ConsoleParser * pParser = new ConsoleParser;
 
 
    pParser->ext = ext;
    pParser->ext = ext;
    pParser->getCurrentFile = gcf;
    pParser->getCurrentFile = gcf;
@@ -69,23 +69,23 @@ bool addConsoleParser(char *ext, fnGetCurrentFile gcf, fnGetCurrentLine gcl, fnP
 
 
 ConsoleParser * getParserForFile(const char *filename)
 ConsoleParser * getParserForFile(const char *filename)
 {
 {
-	if(filename == NULL)
-		return gDefaultParser;
-
-	char *ptr = dStrrchr((char *)filename, '.');
-	if(ptr != NULL)
-	{
-		ptr++;
-
-		ConsoleParser *p;
-		for(p = gParserList; p; p = p->next)
-		{
-			if(dStricmp(ptr, p->ext) == 0)
-				return p;
-		}
-	}
-
-	return gDefaultParser;
+   if(filename == NULL)
+      return gDefaultParser;
+
+   char *ptr = dStrrchr((char *)filename, '.');
+   if(ptr != NULL)
+   {
+      ptr++;
+
+      ConsoleParser *p;
+      for(p = gParserList; p; p = p->next)
+      {
+         if(dStricmp(ptr, p->ext) == 0)
+            return p;
+      }
+   }
+
+   return gDefaultParser;
 }
 }
 
 
 } // end namespace Con
 } // end namespace Con

+ 16 - 16
Engine/source/console/consoleParser.h

@@ -57,15 +57,15 @@ typedef void (*fnSetScanBuffer)(const char *sb, const char *fn);
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 struct ConsoleParser
 struct ConsoleParser
 {
 {
-	struct ConsoleParser *next;       //!< Next object in list or NULL
-
-	char *ext;                        //!< Filename extension handled by this parser
-	
-	fnGetCurrentFile getCurrentFile;  //!< GetCurrentFile lexer function
-	fnGetCurrentLine getCurrentLine;  //!< GetCurrentLine lexer function
-	fnParse          parse;           //!< Parse lexer function
-	fnRestart        restart;         //!< Restart lexer function
-	fnSetScanBuffer  setScanBuffer;   //!< SetScanBuffer lexer function
+   struct ConsoleParser *next;       //!< Next object in list or NULL
+
+   char *ext;                        //!< Filename extension handled by this parser
+   
+   fnGetCurrentFile getCurrentFile;  //!< GetCurrentFile lexer function
+   fnGetCurrentLine getCurrentLine;  //!< GetCurrentLine lexer function
+   fnParse          parse;           //!< Parse lexer function
+   fnRestart        restart;         //!< Restart lexer function
+   fnSetScanBuffer  setScanBuffer;   //!< SetScanBuffer lexer function
 };
 };
 
 
 // Macros
 // Macros
@@ -74,18 +74,18 @@ struct ConsoleParser
 /// \brief Declare a parser's function prototypes
 /// \brief Declare a parser's function prototypes
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 #define CON_DECLARE_PARSER(prefix) \
 #define CON_DECLARE_PARSER(prefix) \
-	const char * prefix##GetCurrentFile(); \
-	S32 prefix##GetCurrentLine(); \
-	void prefix##SetScanBuffer(const char *sb, const char *fn); \
-	S32 prefix##parse(); \
-	void prefix##restart(FILE *input_file)
+   const char * prefix##GetCurrentFile(); \
+   S32 prefix##GetCurrentLine(); \
+   void prefix##SetScanBuffer(const char *sb, const char *fn); \
+   S32 prefix##parse(); \
+   void prefix##restart(FILE *input_file)
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 /// \brief Helper macro to add console parsers
 /// \brief Helper macro to add console parsers
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 #define CON_ADD_PARSER(prefix, ext, def) \
 #define CON_ADD_PARSER(prefix, ext, def) \
-	Compiler::addConsoleParser(ext, prefix##GetCurrentFile, prefix##GetCurrentLine, prefix##parse, \
-						  prefix##restart, prefix##SetScanBuffer, def)
+   Compiler::addConsoleParser(ext, prefix##GetCurrentFile, prefix##GetCurrentLine, prefix##parse, \
+                    prefix##restart, prefix##SetScanBuffer, def)
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 /// \brief Free the console parser list
 /// \brief Free the console parser list

+ 1 - 1
Engine/source/console/simManager.cpp

@@ -99,7 +99,7 @@ U32 postEvent(SimObject *destObject, SimEvent* event,U32 time)
 
 
    Mutex::lockMutex(gEventQueueMutex);
    Mutex::lockMutex(gEventQueueMutex);
 
 
-   if( time == -1 )
+   if( time == -1 ) // FIXME: a smart compiler will remove this check. - see http://garagegames.com/community/resources/view/19785 for a fix
       time = gCurrentTime;
       time = gCurrentTime;
 
 
    event->time = time;
    event->time = time;

+ 23 - 23
Engine/source/gfx/bitmap/gBitmap.cpp

@@ -611,31 +611,31 @@ bool GBitmap::checkForTransparency()
 //------------------------------------------------------------------------------
 //------------------------------------------------------------------------------
 ColorF GBitmap::sampleTexel(F32 u, F32 v) const
 ColorF GBitmap::sampleTexel(F32 u, F32 v) const
 {
 {
-	ColorF col(0.5f, 0.5f, 0.5f);
-	// normally sampling wraps all the way around at 1.0,
-	// but locking doesn't support this, and we seem to calc
-	// the uv based on a clamped 0 - 1...
-	Point2F max((F32)(getWidth()-1), (F32)(getHeight()-1));
-	Point2F posf;
-	posf.x = mClampF(((u) * max.x), 0.0f, max.x);
-	posf.y = mClampF(((v) * max.y), 0.0f, max.y);
-	Point2I posi((S32)posf.x, (S32)posf.y);
-
-	const U8 *buffer = getBits();
-	U32 lexelindex = ((posi.y * getWidth()) + posi.x) * mBytesPerPixel;
-
-	if(mBytesPerPixel == 2)
-	{
-		//U16 *buffer = (U16 *)lockrect->pBits;
-	}
-	else if(mBytesPerPixel > 2)
-	{		
-		col.red = F32(buffer[lexelindex + 0]) / 255.0f;
+   ColorF col(0.5f, 0.5f, 0.5f);
+   // normally sampling wraps all the way around at 1.0,
+   // but locking doesn't support this, and we seem to calc
+   // the uv based on a clamped 0 - 1...
+   Point2F max((F32)(getWidth()-1), (F32)(getHeight()-1));
+   Point2F posf;
+   posf.x = mClampF(((u) * max.x), 0.0f, max.x);
+   posf.y = mClampF(((v) * max.y), 0.0f, max.y);
+   Point2I posi((S32)posf.x, (S32)posf.y);
+
+   const U8 *buffer = getBits();
+   U32 lexelindex = ((posi.y * getWidth()) + posi.x) * mBytesPerPixel;
+
+   if(mBytesPerPixel == 2)
+   {
+      //U16 *buffer = (U16 *)lockrect->pBits;
+   }
+   else if(mBytesPerPixel > 2)
+   {     
+      col.red = F32(buffer[lexelindex + 0]) / 255.0f;
       col.green = F32(buffer[lexelindex + 1]) / 255.0f;
       col.green = F32(buffer[lexelindex + 1]) / 255.0f;
-		col.blue = F32(buffer[lexelindex + 2]) / 255.0f;
-	}
+      col.blue = F32(buffer[lexelindex + 2]) / 255.0f;
+   }
 
 
-	return col;
+   return col;
 }
 }
 
 
 //--------------------------------------------------------------------------
 //--------------------------------------------------------------------------

+ 2 - 2
Engine/source/module/moduleDefinition.cpp

@@ -51,7 +51,7 @@ mModuleId(StringTable->EmptyString()),
     mSynchronized( false ),
     mSynchronized( false ),
     mDeprecated( false ),
     mDeprecated( false ),
     mCriticalMerge( false ),
     mCriticalMerge( false ),
-    mOverrideExitingObjects(false),
+    mOverrideExistingObjects(false),
     mModuleDescription( StringTable->EmptyString() ),
     mModuleDescription( StringTable->EmptyString() ),
     mAuthor(StringTable->EmptyString()),
     mAuthor(StringTable->EmptyString()),
     mModuleGroup(StringTable->EmptyString()),
     mModuleGroup(StringTable->EmptyString()),
@@ -92,7 +92,7 @@ void ModuleDefinition::initPersistFields()
     addProtectedField( "Synchronized", TypeBool, Offset(mSynchronized, ModuleDefinition), &setSynchronized, &defaultProtectedGetFn, &writeSynchronized, "Whether the module should be synchronized or not.  Optional: If not specified then the module is not synchronized." );
     addProtectedField( "Synchronized", TypeBool, Offset(mSynchronized, ModuleDefinition), &setSynchronized, &defaultProtectedGetFn, &writeSynchronized, "Whether the module should be synchronized or not.  Optional: If not specified then the module is not synchronized." );
     addProtectedField( "Deprecated", TypeBool, Offset(mDeprecated, ModuleDefinition), &setDeprecated, &defaultProtectedGetFn, &writeDeprecated, "Whether the module is deprecated or not.  Optional: If not specified then the module is not deprecated." );
     addProtectedField( "Deprecated", TypeBool, Offset(mDeprecated, ModuleDefinition), &setDeprecated, &defaultProtectedGetFn, &writeDeprecated, "Whether the module is deprecated or not.  Optional: If not specified then the module is not deprecated." );
     addProtectedField( "CriticalMerge", TypeBool, Offset(mCriticalMerge, ModuleDefinition), &setDeprecated, &defaultProtectedGetFn, &writeCriticalMerge, "Whether the merging of a module prior to a restart is critical or not.  Optional: If not specified then the module is not merge critical." );
     addProtectedField( "CriticalMerge", TypeBool, Offset(mCriticalMerge, ModuleDefinition), &setDeprecated, &defaultProtectedGetFn, &writeCriticalMerge, "Whether the merging of a module prior to a restart is critical or not.  Optional: If not specified then the module is not merge critical." );
-    addProtectedField( "OverrideExistingObjects", TypeBool, Offset(mOverrideExitingObjects, ModuleDefinition), &setOverrideExistingObjects, &defaultProtectedGetFn, &writeOverrideExistingObjects, "Controls if when this module is loaded and the create function is executed, it will replace existing objects that share names or not.");
+    addProtectedField( "OverrideExistingObjects", TypeBool, Offset(mOverrideExistingObjects, ModuleDefinition), &setOverrideExistingObjects, &defaultProtectedGetFn, &writeOverrideExistingObjects, "Controls if when this module is loaded and the create function is executed, it will replace existing objects that share names or not.");
     addProtectedField( "Description", TypeString, Offset(mModuleDescription, ModuleDefinition), &setModuleDescription, &defaultProtectedGetFn, &writeModuleDescription, "The description typically used for debugging purposes but can be used for anything." );
     addProtectedField( "Description", TypeString, Offset(mModuleDescription, ModuleDefinition), &setModuleDescription, &defaultProtectedGetFn, &writeModuleDescription, "The description typically used for debugging purposes but can be used for anything." );
     addProtectedField( "Author", TypeString, Offset(mAuthor, ModuleDefinition), &setAuthor, &defaultProtectedGetFn, &writeAuthor, "The author of the module." );
     addProtectedField( "Author", TypeString, Offset(mAuthor, ModuleDefinition), &setAuthor, &defaultProtectedGetFn, &writeAuthor, "The author of the module." );
     addProtectedField( "Group", TypeString, Offset(mModuleGroup, ModuleDefinition), &setModuleGroup, &defaultProtectedGetFn, "The module group used typically when loading modules as a group." );
     addProtectedField( "Group", TypeString, Offset(mModuleGroup, ModuleDefinition), &setModuleGroup, &defaultProtectedGetFn, "The module group used typically when loading modules as a group." );

+ 3 - 3
Engine/source/module/moduleDefinition.h

@@ -89,7 +89,7 @@ private:
     bool                            mSynchronized;
     bool                            mSynchronized;
     bool                            mDeprecated;
     bool                            mDeprecated;
     bool                            mCriticalMerge;
     bool                            mCriticalMerge;
-    bool                            mOverrideExitingObjects;
+    bool                            mOverrideExistingObjects;
     StringTableEntry                mModuleDescription;
     StringTableEntry                mModuleDescription;
     StringTableEntry                mAuthor;;
     StringTableEntry                mAuthor;;
     StringTableEntry                mModuleGroup;
     StringTableEntry                mModuleGroup;
@@ -142,8 +142,8 @@ public:
     inline bool             getDeprecated( void ) const                         { return mDeprecated; }
     inline bool             getDeprecated( void ) const                         { return mDeprecated; }
     inline void             setCriticalMerge( const bool mergeCritical )        { if ( checkUnlocked() ) { mCriticalMerge = mergeCritical; } }
     inline void             setCriticalMerge( const bool mergeCritical )        { if ( checkUnlocked() ) { mCriticalMerge = mergeCritical; } }
     inline bool             getCriticalMerge( void ) const                      { return mCriticalMerge; }
     inline bool             getCriticalMerge( void ) const                      { return mCriticalMerge; }
-    inline void             setOverrideExistingObjects(const bool overrideExistingObj) { if (checkUnlocked()) { mOverrideExitingObjects = overrideExistingObj; } }
-    inline bool             getOverrideExistingObjects(void) const              { return mOverrideExitingObjects; }
+    inline void             setOverrideExistingObjects(const bool overrideExistingObj) { if (checkUnlocked()) { mOverrideExistingObjects = overrideExistingObj; } }
+    inline bool             getOverrideExistingObjects(void) const              { return mOverrideExistingObjects; }
     inline void             setModuleDescription( const char* pModuleDescription ) { if ( checkUnlocked() ) { mModuleDescription = StringTable->insert(pModuleDescription); } }
     inline void             setModuleDescription( const char* pModuleDescription ) { if ( checkUnlocked() ) { mModuleDescription = StringTable->insert(pModuleDescription); } }
     inline StringTableEntry getModuleDescription( void ) const                  { return mModuleDescription; }
     inline StringTableEntry getModuleDescription( void ) const                  { return mModuleDescription; }
     inline void             setAuthor( const char* pAuthor )                    { if ( checkUnlocked() ) { mAuthor = StringTable->insert(pAuthor); } }
     inline void             setAuthor( const char* pAuthor )                    { if ( checkUnlocked() ) { mAuthor = StringTable->insert(pAuthor); } }

+ 4 - 4
Engine/source/platform/platformNet.cpp

@@ -492,10 +492,10 @@ template<class T> T ReservedSocketList<T>::resolve(NetSocket socketToResolve)
    return entry.used ? entry.value : -1;
    return entry.used ? entry.value : -1;
 }
 }
 
 
-static ConnectionNotifyEvent*   smConnectionNotify = NULL;
-static ConnectionAcceptedEvent* smConnectionAccept = NULL;
-static ConnectionReceiveEvent*  smConnectionReceive = NULL;
-static PacketReceiveEvent*      smPacketReceive = NULL;
+ConnectionNotifyEvent*   Net::smConnectionNotify = NULL;
+ConnectionAcceptedEvent* Net::smConnectionAccept = NULL;
+ConnectionReceiveEvent*  Net::smConnectionReceive = NULL;
+PacketReceiveEvent*      Net::smPacketReceive = NULL;
 
 
 ConnectionNotifyEvent& Net::getConnectionNotifyEvent()
 ConnectionNotifyEvent& Net::getConnectionNotifyEvent()
 {
 {

+ 6 - 0
Engine/source/platform/platformNet.h

@@ -214,6 +214,12 @@ struct Net
    static bool smMulticastEnabled;
    static bool smMulticastEnabled;
    static bool smIpv4Enabled;
    static bool smIpv4Enabled;
    static bool smIpv6Enabled;
    static bool smIpv6Enabled;
+   
+   static ConnectionNotifyEvent*   smConnectionNotify;
+   static ConnectionAcceptedEvent* smConnectionAccept;
+   static ConnectionReceiveEvent*  smConnectionReceive;
+   static PacketReceiveEvent*      smPacketReceive;
+
 
 
    static bool init();
    static bool init();
    static void shutdown();
    static void shutdown();

+ 110 - 110
Engine/source/platform/profiler.cpp

@@ -54,9 +54,9 @@ Profiler *gProfiler = NULL;
 Vector<StringTableEntry> gProfilerNodeStack;
 Vector<StringTableEntry> gProfilerNodeStack;
 #define TORQUE_PROFILE_AT_ENGINE_START true
 #define TORQUE_PROFILE_AT_ENGINE_START true
 #define PROFILER_DEBUG_PUSH_NODE( nodename ) \
 #define PROFILER_DEBUG_PUSH_NODE( nodename ) \
-gProfilerNodeStack.push_back( nodename );
+   gProfilerNodeStack.push_back( nodename );
 #define PROFILER_DEBUG_POP_NODE() \
 #define PROFILER_DEBUG_POP_NODE() \
-gProfilerNodeStack.pop_back();
+   gProfilerNodeStack.pop_back();
 #else
 #else
 #define TORQUE_PROFILE_AT_ENGINE_START false
 #define TORQUE_PROFILE_AT_ENGINE_START false
 #define PROFILER_DEBUG_PUSH_NODE( nodename ) ;
 #define PROFILER_DEBUG_PUSH_NODE( nodename ) ;
@@ -68,7 +68,7 @@ gProfilerNodeStack.pop_back();
 void startHighResolutionTimer(U32 time[2])
 void startHighResolutionTimer(U32 time[2])
 {
 {
    //time[0] = Platform::getRealMilliseconds();
    //time[0] = Platform::getRealMilliseconds();
-   
+
    __asm
    __asm
    {
    {
       push eax
       push eax
@@ -89,7 +89,7 @@ U32 endHighResolutionTimer(U32 time[2])
    U32 ticks;
    U32 ticks;
    //ticks = Platform::getRealMilliseconds() - time[0];
    //ticks = Platform::getRealMilliseconds() - time[0];
    //return ticks;
    //return ticks;
-   
+
    __asm
    __asm
    {
    {
       push  eax
       push  eax
@@ -176,7 +176,7 @@ Profiler::Profiler()
 {
 {
    mMaxStackDepth = MaxStackDepth;
    mMaxStackDepth = MaxStackDepth;
    mCurrentHash = 0;
    mCurrentHash = 0;
-   
+
    mCurrentProfilerData = (ProfilerData *) malloc(sizeof(ProfilerData));
    mCurrentProfilerData = (ProfilerData *) malloc(sizeof(ProfilerData));
    mCurrentProfilerData->mRoot = NULL;
    mCurrentProfilerData->mRoot = NULL;
    mCurrentProfilerData->mNextForRoot = NULL;
    mCurrentProfilerData->mNextForRoot = NULL;
@@ -195,12 +195,12 @@ Profiler::Profiler()
    mCurrentProfilerData->mPath = "";
    mCurrentProfilerData->mPath = "";
 #endif
 #endif
    mRootProfilerData = mCurrentProfilerData;
    mRootProfilerData = mCurrentProfilerData;
-   
+
    for(U32 i = 0; i < ProfilerData::HashTableSize; i++)
    for(U32 i = 0; i < ProfilerData::HashTableSize; i++)
       mCurrentProfilerData->mChildHash[i] = 0;
       mCurrentProfilerData->mChildHash[i] = 0;
-   
+
    mProfileList = NULL;
    mProfileList = NULL;
-   
+
    mEnabled = TORQUE_PROFILE_AT_ENGINE_START;
    mEnabled = TORQUE_PROFILE_AT_ENGINE_START;
    mNextEnable = TORQUE_PROFILE_AT_ENGINE_START;
    mNextEnable = TORQUE_PROFILE_AT_ENGINE_START;
    mStackDepth = 0;
    mStackDepth = 0;
@@ -222,20 +222,20 @@ void Profiler::reset()
    mEnabled = false; // in case we're in a profiler call.
    mEnabled = false; // in case we're in a profiler call.
    ProfilerData * head = mProfileList;
    ProfilerData * head = mProfileList;
    ProfilerData * curr = head;
    ProfilerData * curr = head;
-   
+
    while ( curr )
    while ( curr )
    {
    {
       head = curr->mNextProfilerData;
       head = curr->mNextProfilerData;
       free( curr );
       free( curr );
-      
+
       if ( head )
       if ( head )
          curr = head;
          curr = head;
       else
       else
          curr = NULL;
          curr = NULL;
    }
    }
-   
+
    mProfileList = NULL;
    mProfileList = NULL;
-   
+
    for(ProfilerRootData *walk = ProfilerRootData::sRootList; walk; walk = walk->mNextRoot)
    for(ProfilerRootData *walk = ProfilerRootData::sRootList; walk; walk = walk->mNextRoot)
    {
    {
       walk->mFirstProfilerData = 0;
       walk->mFirstProfilerData = 0;
@@ -262,7 +262,7 @@ ProfilerRootData::ProfilerRootData(const char *name)
    for(ProfilerRootData *walk = sRootList; walk; walk = walk->mNextRoot)
    for(ProfilerRootData *walk = sRootList; walk; walk = walk->mNextRoot)
       if(!dStrcmp(walk->mName, name))
       if(!dStrcmp(walk->mName, name))
          AssertFatal( false, avar( "Duplicate profile name: %s", name ) );
          AssertFatal( false, avar( "Duplicate profile name: %s", name ) );
-   
+
    mName = name;
    mName = name;
    mNameHash = _StringTable::hashString(name);
    mNameHash = _StringTable::hashString(name);
    mNextRoot = sRootList;
    mNextRoot = sRootList;
@@ -306,7 +306,7 @@ const char * Profiler::getProfilePath()
    if( !ThreadManager::isMainThread() )
    if( !ThreadManager::isMainThread() )
       return "[non-main thread]";
       return "[non-main thread]";
 #endif
 #endif
-   
+
    return (mEnabled && mCurrentProfilerData) ? mCurrentProfilerData->mPath : "na";
    return (mEnabled && mCurrentProfilerData) ? mCurrentProfilerData->mPath : "na";
 }
 }
 #endif
 #endif
@@ -318,14 +318,14 @@ const char * Profiler::constructProfilePath(ProfilerData * pd)
    {
    {
       const bool saveEnable = gProfiler->mEnabled;
       const bool saveEnable = gProfiler->mEnabled;
       gProfiler->mEnabled = false;
       gProfiler->mEnabled = false;
-      
+
       const char * connector = " -> ";
       const char * connector = " -> ";
       U32 len = dStrlen(pd->mParent->mPath);
       U32 len = dStrlen(pd->mParent->mPath);
       if (!len)
       if (!len)
          connector = "";
          connector = "";
       len += dStrlen(connector);
       len += dStrlen(connector);
       len += dStrlen(pd->mRoot->mName);
       len += dStrlen(pd->mRoot->mName);
-      
+
       U32 mark = FrameAllocator::getWaterMark();
       U32 mark = FrameAllocator::getWaterMark();
       char * buf = (char*)FrameAllocator::alloc(len+1);
       char * buf = (char*)FrameAllocator::alloc(len+1);
       dStrcpy(buf,pd->mParent->mPath);
       dStrcpy(buf,pd->mParent->mPath);
@@ -348,25 +348,25 @@ void Profiler::hashPush(ProfilerRootData *root)
    if( !ThreadManager::isMainThread() )
    if( !ThreadManager::isMainThread() )
       return;
       return;
 #endif
 #endif
-   
+
    mStackDepth++;
    mStackDepth++;
    PROFILER_DEBUG_PUSH_NODE(root->mName);
    PROFILER_DEBUG_PUSH_NODE(root->mName);
    AssertFatal(mStackDepth <= mMaxStackDepth,
    AssertFatal(mStackDepth <= mMaxStackDepth,
             "Stack overflow in profiler.  You may have mismatched PROFILE_START and PROFILE_ENDs");
             "Stack overflow in profiler.  You may have mismatched PROFILE_START and PROFILE_ENDs");
    if(!mEnabled)
    if(!mEnabled)
       return;
       return;
-   
+
    ProfilerData *nextProfiler = NULL;
    ProfilerData *nextProfiler = NULL;
    if(!root->mEnabled || mCurrentProfilerData->mRoot == root)
    if(!root->mEnabled || mCurrentProfilerData->mRoot == root)
    {
    {
       mCurrentProfilerData->mSubDepth++;
       mCurrentProfilerData->mSubDepth++;
       return;
       return;
    }
    }
-   
+
    if(mCurrentProfilerData->mLastSeenProfiler &&
    if(mCurrentProfilerData->mLastSeenProfiler &&
       mCurrentProfilerData->mLastSeenProfiler->mRoot == root)
       mCurrentProfilerData->mLastSeenProfiler->mRoot == root)
       nextProfiler = mCurrentProfilerData->mLastSeenProfiler;
       nextProfiler = mCurrentProfilerData->mLastSeenProfiler;
-   
+
    if(!nextProfiler)
    if(!nextProfiler)
    {
    {
       // first see if it's in the hash table...
       // first see if it's in the hash table...
@@ -383,17 +383,17 @@ void Profiler::hashPush(ProfilerRootData *root)
          nextProfiler = (ProfilerData *) malloc(sizeof(ProfilerData));
          nextProfiler = (ProfilerData *) malloc(sizeof(ProfilerData));
          for(U32 i = 0; i < ProfilerData::HashTableSize; i++)
          for(U32 i = 0; i < ProfilerData::HashTableSize; i++)
             nextProfiler->mChildHash[i] = 0;
             nextProfiler->mChildHash[i] = 0;
-         
+
          nextProfiler->mRoot = root;
          nextProfiler->mRoot = root;
          nextProfiler->mNextForRoot = root->mFirstProfilerData;
          nextProfiler->mNextForRoot = root->mFirstProfilerData;
          root->mFirstProfilerData = nextProfiler;
          root->mFirstProfilerData = nextProfiler;
-         
+
          nextProfiler->mNextProfilerData = mProfileList;
          nextProfiler->mNextProfilerData = mProfileList;
          mProfileList = nextProfiler;
          mProfileList = nextProfiler;
-         
+
          nextProfiler->mNextHash = mCurrentProfilerData->mChildHash[index];
          nextProfiler->mNextHash = mCurrentProfilerData->mChildHash[index];
          mCurrentProfilerData->mChildHash[index] = nextProfiler;
          mCurrentProfilerData->mChildHash[index] = nextProfiler;
-         
+
          nextProfiler->mParent = mCurrentProfilerData;
          nextProfiler->mParent = mCurrentProfilerData;
          nextProfiler->mNextSibling = mCurrentProfilerData->mFirstChild;
          nextProfiler->mNextSibling = mCurrentProfilerData->mFirstChild;
          mCurrentProfilerData->mFirstChild = nextProfiler;
          mCurrentProfilerData->mFirstChild = nextProfiler;
@@ -443,7 +443,7 @@ void Profiler::hashPop(ProfilerRootData *expected)
    if( !ThreadManager::isMainThread() )
    if( !ThreadManager::isMainThread() )
       return;
       return;
 #endif
 #endif
-   
+
    mStackDepth--;
    mStackDepth--;
    PROFILER_DEBUG_POP_NODE();
    PROFILER_DEBUG_POP_NODE();
    AssertFatal(mStackDepth >= 0, "Stack underflow in profiler.  You may have mismatched PROFILE_START and PROFILE_ENDs");
    AssertFatal(mStackDepth >= 0, "Stack underflow in profiler.  You may have mismatched PROFILE_START and PROFILE_ENDs");
@@ -459,15 +459,15 @@ void Profiler::hashPop(ProfilerRootData *expected)
       {
       {
          AssertISV(expected == mCurrentProfilerData->mRoot, "Profiler::hashPop - didn't get expected ProfilerRoot!");
          AssertISV(expected == mCurrentProfilerData->mRoot, "Profiler::hashPop - didn't get expected ProfilerRoot!");
       }
       }
-      
+
       F64 fElapsed = endHighResolutionTimer(mCurrentProfilerData->mStartTime);
       F64 fElapsed = endHighResolutionTimer(mCurrentProfilerData->mStartTime);
-      
+
       mCurrentProfilerData->mTotalTime += fElapsed;
       mCurrentProfilerData->mTotalTime += fElapsed;
       mCurrentProfilerData->mParent->mSubTime += fElapsed; // mark it in the parent as well...
       mCurrentProfilerData->mParent->mSubTime += fElapsed; // mark it in the parent as well...
       mCurrentProfilerData->mRoot->mTotalTime += fElapsed;
       mCurrentProfilerData->mRoot->mTotalTime += fElapsed;
       if(mCurrentProfilerData->mParent->mRoot)
       if(mCurrentProfilerData->mParent->mRoot)
          mCurrentProfilerData->mParent->mRoot->mSubTime += fElapsed; // mark it in the parent as well...
          mCurrentProfilerData->mParent->mRoot->mSubTime += fElapsed; // mark it in the parent as well...
-      
+
       mCurrentProfilerData = mCurrentProfilerData->mParent;
       mCurrentProfilerData = mCurrentProfilerData->mParent;
    }
    }
    if(mStackDepth == 0)
    if(mStackDepth == 0)
@@ -480,13 +480,13 @@ void Profiler::hashPop(ProfilerRootData *expected)
       }
       }
       if(!mEnabled && mNextEnable)
       if(!mEnabled && mNextEnable)
          startHighResolutionTimer(mCurrentProfilerData->mStartTime);
          startHighResolutionTimer(mCurrentProfilerData->mStartTime);
-      
+
 #if defined(TORQUE_OS_WIN)
 #if defined(TORQUE_OS_WIN)
       // The high performance counters under win32 are unreliable when running on multiple
       // The high performance counters under win32 are unreliable when running on multiple
       // processors. When the profiler is enabled, we restrict Torque to a single processor.
       // processors. When the profiler is enabled, we restrict Torque to a single processor.
       if(mNextEnable != mEnabled)
       if(mNextEnable != mEnabled)
       {
       {
-         
+
          if(mNextEnable)
          if(mNextEnable)
          {
          {
             Con::warnf("Warning: forcing the Torque profiler thread to run only on cpu 1.");
             Con::warnf("Warning: forcing the Torque profiler thread to run only on cpu 1.");
@@ -502,7 +502,7 @@ void Profiler::hashPop(ProfilerRootData *expected)
          }
          }
       }
       }
 #endif
 #endif
-      
+
       mEnabled = mNextEnable;
       mEnabled = mNextEnable;
    }
    }
 }
 }
@@ -520,15 +520,15 @@ static void profilerDataDumpRecurse(ProfilerData *data, char *buffer, U32 buffer
 {
 {
    // dump out this one:
    // dump out this one:
    Con::printf("%7.3f %7.3f %8d %s%s",
    Con::printf("%7.3f %7.3f %8d %s%s",
-            100 * data->mTotalTime / totalTime,
-            100 * (data->mTotalTime - data->mSubTime) / totalTime,
-            data->mInvokeCount,
-            buffer,
-            data->mRoot ? data->mRoot->mName : "ROOT" );
+         100 * data->mTotalTime / totalTime,
+         100 * (data->mTotalTime - data->mSubTime) / totalTime,
+         data->mInvokeCount,
+         buffer,
+         data->mRoot ? data->mRoot->mName : "ROOT" );
    data->mTotalTime = 0;
    data->mTotalTime = 0;
    data->mSubTime = 0;
    data->mSubTime = 0;
    data->mInvokeCount = 0;
    data->mInvokeCount = 0;
-   
+
    buffer[bufferLen] = ' ';
    buffer[bufferLen] = ' ';
    buffer[bufferLen+1] = ' ';
    buffer[bufferLen+1] = ' ';
    buffer[bufferLen+2] = 0;
    buffer[bufferLen+2] = 0;
@@ -558,16 +558,16 @@ static void profilerDataDumpRecurseFile(ProfilerData *data, char *buffer, U32 bu
 {
 {
    char pbuffer[256];
    char pbuffer[256];
    dSprintf(pbuffer, 255, "%7.3f %7.3f %8d %s%s\n",
    dSprintf(pbuffer, 255, "%7.3f %7.3f %8d %s%s\n",
-          100 * data->mTotalTime / totalTime,
-          100 * (data->mTotalTime - data->mSubTime) / totalTime,
-          data->mInvokeCount,
-          buffer,
-          data->mRoot ? data->mRoot->mName : "ROOT" );
+         100 * data->mTotalTime / totalTime,
+         100 * (data->mTotalTime - data->mSubTime) / totalTime,
+         data->mInvokeCount,
+         buffer,
+         data->mRoot ? data->mRoot->mName : "ROOT" );
    fws.write(dStrlen(pbuffer), pbuffer);
    fws.write(dStrlen(pbuffer), pbuffer);
    data->mTotalTime = 0;
    data->mTotalTime = 0;
    data->mSubTime = 0;
    data->mSubTime = 0;
    data->mInvokeCount = 0;
    data->mInvokeCount = 0;
-   
+
    buffer[bufferLen] = ' ';
    buffer[bufferLen] = ' ';
    buffer[bufferLen+1] = ' ';
    buffer[bufferLen+1] = ' ';
    buffer[bufferLen+2] = 0;
    buffer[bufferLen+2] = 0;
@@ -599,7 +599,7 @@ void Profiler::dump()
    mEnabled = false;
    mEnabled = false;
    mStackDepth++;
    mStackDepth++;
    // may have some profiled calls... gotta turn em off.
    // may have some profiled calls... gotta turn em off.
-   
+
    Vector<ProfilerRootData *> rootVector;
    Vector<ProfilerRootData *> rootVector;
    F64 totalTime = 0;
    F64 totalTime = 0;
    for(ProfilerRootData *walk = ProfilerRootData::sRootList; walk; walk = walk->mNextRoot)
    for(ProfilerRootData *walk = ProfilerRootData::sRootList; walk; walk = walk->mNextRoot)
@@ -608,8 +608,8 @@ void Profiler::dump()
       rootVector.push_back(walk);
       rootVector.push_back(walk);
    }
    }
    dQsort((void *) &rootVector[0], rootVector.size(), sizeof(ProfilerRootData *), rootDataCompare);
    dQsort((void *) &rootVector[0], rootVector.size(), sizeof(ProfilerRootData *), rootDataCompare);
-   
-   
+
+
    if (mDumpToConsole == true)
    if (mDumpToConsole == true)
    {
    {
       Con::printf("Profiler Data Dump:");
       Con::printf("Profiler Data Dump:");
@@ -618,10 +618,10 @@ void Profiler::dump()
       for(U32 i = 0; i < rootVector.size(); i++)
       for(U32 i = 0; i < rootVector.size(); i++)
       {
       {
          Con::printf("%7.3f %7.3f %8d %s",
          Con::printf("%7.3f %7.3f %8d %s",
-                  100 * (rootVector[i]->mTotalTime - rootVector[i]->mSubTime) / totalTime,
-                  100 * rootVector[i]->mTotalTime / totalTime,
-                  rootVector[i]->mTotalInvokeCount,
-                  rootVector[i]->mName);
+                     100 * (rootVector[i]->mTotalTime - rootVector[i]->mSubTime) / totalTime,
+                     100 * rootVector[i]->mTotalTime / totalTime,
+                     rootVector[i]->mTotalInvokeCount,
+                     rootVector[i]->mName);
          rootVector[i]->mTotalInvokeCount = 0;
          rootVector[i]->mTotalInvokeCount = 0;
          rootVector[i]->mTotalTime = 0;
          rootVector[i]->mTotalTime = 0;
          rootVector[i]->mSubTime = 0;
          rootVector[i]->mSubTime = 0;
@@ -629,9 +629,9 @@ void Profiler::dump()
       Con::printf("");
       Con::printf("");
       Con::printf("Ordered by stack trace total time -");
       Con::printf("Ordered by stack trace total time -");
       Con::printf("%% Time  %% NSTime  Invoke #  Name");
       Con::printf("%% Time  %% NSTime  Invoke #  Name");
-      
+
       mCurrentProfilerData->mTotalTime = endHighResolutionTimer(mCurrentProfilerData->mStartTime);
       mCurrentProfilerData->mTotalTime = endHighResolutionTimer(mCurrentProfilerData->mStartTime);
-      
+
       char depthBuffer[MaxStackDepth * 2 + 1];
       char depthBuffer[MaxStackDepth * 2 + 1];
       depthBuffer[0] = 0;
       depthBuffer[0] = 0;
       profilerDataDumpRecurse(mCurrentProfilerData, depthBuffer, 0, totalTime);
       profilerDataDumpRecurse(mCurrentProfilerData, depthBuffer, 0, totalTime);
@@ -643,44 +643,44 @@ void Profiler::dump()
       FileStream fws;
       FileStream fws;
       bool success = fws.open(mDumpFileName, Torque::FS::File::Write);
       bool success = fws.open(mDumpFileName, Torque::FS::File::Write);
       AssertFatal(success, "Cannot write profile dump to specified file!");
       AssertFatal(success, "Cannot write profile dump to specified file!");
-      char buffer[1024];
-      
-      dStrcpy(buffer, "Profiler Data Dump:\n");
-      fws.write(dStrlen(buffer), buffer);
-      dStrcpy(buffer, "Ordered by non-sub total time -\n");
-      fws.write(dStrlen(buffer), buffer);
-      dStrcpy(buffer, "%%NSTime  %% Time  Invoke #  Name\n");
-      fws.write(dStrlen(buffer), buffer);
-      
-      for(U32 i = 0; i < rootVector.size(); i++)
-      {
-         dSprintf(buffer, 1023, "%7.3f %7.3f %8d %s\n",
-                100 * (rootVector[i]->mTotalTime - rootVector[i]->mSubTime) / totalTime,
-                100 * rootVector[i]->mTotalTime / totalTime,
-                rootVector[i]->mTotalInvokeCount,
-                rootVector[i]->mName);
+         char buffer[1024];
+
+         dStrcpy(buffer, "Profiler Data Dump:\n");
          fws.write(dStrlen(buffer), buffer);
          fws.write(dStrlen(buffer), buffer);
-         
-         rootVector[i]->mTotalInvokeCount = 0;
-         rootVector[i]->mTotalTime = 0;
-         rootVector[i]->mSubTime = 0;
-      }
-      dStrcpy(buffer, "\nOrdered by non-sub total time -\n");
-      fws.write(dStrlen(buffer), buffer);
-      dStrcpy(buffer, "%%NSTime  %% Time  Invoke #  Name\n");
-      fws.write(dStrlen(buffer), buffer);
-      
+         dStrcpy(buffer, "Ordered by non-sub total time -\n");
+         fws.write(dStrlen(buffer), buffer);
+         dStrcpy(buffer, "%%NSTime  %% Time  Invoke #  Name\n");
+         fws.write(dStrlen(buffer), buffer);
+
+         for(U32 i = 0; i < rootVector.size(); i++)
+         {
+            dSprintf(buffer, 1023, "%7.3f %7.3f %8d %s\n",
+                     100 * (rootVector[i]->mTotalTime - rootVector[i]->mSubTime) / totalTime,
+                     100 * rootVector[i]->mTotalTime / totalTime,
+                     rootVector[i]->mTotalInvokeCount,
+                     rootVector[i]->mName);
+            fws.write(dStrlen(buffer), buffer);
+
+            rootVector[i]->mTotalInvokeCount = 0;
+            rootVector[i]->mTotalTime = 0;
+            rootVector[i]->mSubTime = 0;
+         }
+         dStrcpy(buffer, "\nOrdered by non-sub total time -\n");
+         fws.write(dStrlen(buffer), buffer);
+         dStrcpy(buffer, "%%NSTime  %% Time  Invoke #  Name\n");
+         fws.write(dStrlen(buffer), buffer);
+
       mCurrentProfilerData->mTotalTime = endHighResolutionTimer(mCurrentProfilerData->mStartTime);
       mCurrentProfilerData->mTotalTime = endHighResolutionTimer(mCurrentProfilerData->mStartTime);
-      
+
       char depthBuffer[MaxStackDepth * 2 + 1];
       char depthBuffer[MaxStackDepth * 2 + 1];
       depthBuffer[0] = 0;
       depthBuffer[0] = 0;
       profilerDataDumpRecurseFile(mCurrentProfilerData, depthBuffer, 0, totalTime, fws);
       profilerDataDumpRecurseFile(mCurrentProfilerData, depthBuffer, 0, totalTime, fws);
       mEnabled = enableSave;
       mEnabled = enableSave;
       mStackDepth--;
       mStackDepth--;
-      
+
       fws.close();
       fws.close();
    }
    }
-   
+
    mDumpToConsole = false;
    mDumpToConsole = false;
    mDumpToFile    = false;
    mDumpToFile    = false;
    mDumpFileName[0] = '\0';
    mDumpFileName[0] = '\0';
@@ -716,12 +716,12 @@ void Profiler::enableMarker(const char *marker, bool enable)
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
 DefineEngineFunction( profilerMarkerEnable, void, ( const char* markerName, bool enable ), ( true ),
 DefineEngineFunction( profilerMarkerEnable, void, ( const char* markerName, bool enable ), ( true ),
-                "@brief Enable or disable a specific profile.\n\n"
-                "@param enable     Optional paramater to enable or disable the profile.\n"
-                "@param markerName Name of a specific marker to enable or disable.\n"
-                "@note Calling this function will first call profilerReset(), clearing all data from profiler. "
-                "All profile markers are enabled by default.\n\n"
-                "@ingroup Debugging")
+   "@brief Enable or disable a specific profile.\n\n"
+   "@param enable   Optional paramater to enable or disable the profile.\n"
+   "@param markerName Name of a specific marker to enable or disable.\n"
+   "@note Calling this function will first call profilerReset(), clearing all data from profiler. "
+   "All profile markers are enabled by default.\n\n"
+   "@ingroup Debugging")
 {
 {
    if( gProfiler )
    if( gProfiler )
       gProfiler->enableMarker( markerName, enable );
       gProfiler->enableMarker( markerName, enable );
@@ -730,47 +730,47 @@ DefineEngineFunction( profilerMarkerEnable, void, ( const char* markerName, bool
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
 DefineEngineFunction( profilerEnable, void, ( bool enable ),,
 DefineEngineFunction( profilerEnable, void, ( bool enable ),,
-                "@brief Enables or disables the profiler.\n\n"
-                "Data is only gathered while the profiler is enabled.\n\n"
-                "@note Profiler is not available in shipping builds.\n"
-                "T3D has predefined profiling areas surrounded by markers, "
-                "but you may need to define additional markers (in C++) around areas you wish to profile,"
-                " by using the PROFILE_START( markerName ); and PROFILE_END(); macros.\n\n"
-                "@ingroup Debugging\n" )
+            "@brief Enables or disables the profiler.\n\n"
+            "Data is only gathered while the profiler is enabled.\n\n"
+            "@note Profiler is not available in shipping builds.\n"
+            "T3D has predefined profiling areas surrounded by markers, "
+            "but you may need to define additional markers (in C++) around areas you wish to profile,"
+            " by using the PROFILE_START( markerName ); and PROFILE_END(); macros.\n\n"
+            "@ingroup Debugging\n" )
 {
 {
    if(gProfiler)
    if(gProfiler)
       gProfiler->enable(enable);
       gProfiler->enable(enable);
 }
 }
 
 
 DefineEngineFunction(profilerDump, void, (),,
 DefineEngineFunction(profilerDump, void, (),,
-                "@brief Dumps current profiling stats to the console window.\n\n"
-                "@note Markers disabled with profilerMarkerEnable() will be skipped over. "
-                "If the profiler is currently running, it will be disabled.\n"
-                "@ingroup Debugging")
+            "@brief Dumps current profiling stats to the console window.\n\n"
+            "@note Markers disabled with profilerMarkerEnable() will be skipped over. "
+            "If the profiler is currently running, it will be disabled.\n"
+            "@ingroup Debugging")
 {
 {
    if(gProfiler)
    if(gProfiler)
       gProfiler->dumpToConsole();
       gProfiler->dumpToConsole();
 }
 }
 
 
 DefineEngineFunction( profilerDumpToFile, void, ( const char* fileName ),,
 DefineEngineFunction( profilerDumpToFile, void, ( const char* fileName ),,
-                "@brief Dumps current profiling stats to a file.\n\n"
-                "@note If the profiler is currently running, it will be disabled.\n"
-                "@param fileName Name and path of file to save profiling stats to. Must use forward slashes (/). "
-                "Will attempt to create the file if it does not already exist.\n"
-                "@tsexample\n"
-                "profilerDumpToFile( \"C:/Torque/log1.txt\" );\n"
-                "@endtsexample\n\n"
-                "@ingroup Debugging" )
+            "@brief Dumps current profiling stats to a file.\n\n"
+            "@note If the profiler is currently running, it will be disabled.\n"
+            "@param fileName Name and path of file to save profiling stats to. Must use forward slashes (/). "
+            "Will attempt to create the file if it does not already exist.\n"
+            "@tsexample\n"
+            "profilerDumpToFile( \"C:/Torque/log1.txt\" );\n"
+            "@endtsexample\n\n"
+            "@ingroup Debugging" )
 {
 {
    if(gProfiler)
    if(gProfiler)
       gProfiler->dumpToFile(fileName);
       gProfiler->dumpToFile(fileName);
 }
 }
 
 
 DefineEngineFunction( profilerReset, void, (),,
 DefineEngineFunction( profilerReset, void, (),,
-                "@brief Resets the profiler, clearing it of all its data.\n\n"
-                "If the profiler is currently running, it will first be disabled. "
-                "All markers will retain their current enabled/disabled status.\n\n"
-                "@ingroup Debugging" )
+            "@brief Resets the profiler, clearing it of all its data.\n\n"
+            "If the profiler is currently running, it will first be disabled. "
+            "All markers will retain their current enabled/disabled status.\n\n"
+            "@ingroup Debugging" )
 {
 {
    if(gProfiler)
    if(gProfiler)
       gProfiler->reset();
       gProfiler->reset();

+ 8 - 8
Engine/source/platform/test/netTest.cpp

@@ -76,8 +76,8 @@ TEST(Net, TCPRequest)
    handler.mDataReceived = 0;
    handler.mDataReceived = 0;
 
 
    // Hook into the signals.
    // Hook into the signals.
-   Net::smConnectionNotify .notify(&handler, &TcpHandle::notify);
-   Net::smConnectionReceive.notify(&handler, &TcpHandle::receive);
+   Net::smConnectionNotify ->notify(&handler, &TcpHandle::notify);
+   Net::smConnectionReceive->notify(&handler, &TcpHandle::receive);
 
 
    // Open a TCP connection to garagegames.com
    // Open a TCP connection to garagegames.com
    handler.mSocket = Net::openConnectTo("72.246.107.193:80");
    handler.mSocket = Net::openConnectTo("72.246.107.193:80");
@@ -85,8 +85,8 @@ TEST(Net, TCPRequest)
    while(Process::processEvents() && (Platform::getRealMilliseconds() < limit) ) {}
    while(Process::processEvents() && (Platform::getRealMilliseconds() < limit) ) {}
 
 
    // Unhook from the signals.
    // Unhook from the signals.
-   Net::smConnectionNotify .remove(&handler, &TcpHandle::notify);
-   Net::smConnectionReceive.remove(&handler, &TcpHandle::receive);
+   Net::smConnectionNotify ->remove(&handler, &TcpHandle::notify);
+   Net::smConnectionReceive->remove(&handler, &TcpHandle::receive);
 
 
    EXPECT_GT(handler.mDataReceived, 0)
    EXPECT_GT(handler.mDataReceived, 0)
       << "Didn't get any data back!";
       << "Didn't get any data back!";
@@ -139,8 +139,8 @@ struct JournalHandle
       mDataReceived = 0;
       mDataReceived = 0;
 
 
       // Hook into the signals.
       // Hook into the signals.
-      Net::smConnectionNotify .notify(this, &JournalHandle::notify);
-      Net::smConnectionReceive.notify(this, &JournalHandle::receive);
+      Net::smConnectionNotify ->notify(this, &JournalHandle::notify);
+      Net::smConnectionReceive->notify(this, &JournalHandle::receive);
 
 
       // Open a TCP connection to garagegames.com
       // Open a TCP connection to garagegames.com
       mSocket = Net::openConnectTo("72.246.107.193:80");
       mSocket = Net::openConnectTo("72.246.107.193:80");
@@ -149,8 +149,8 @@ struct JournalHandle
       while(Process::processEvents()) {}
       while(Process::processEvents()) {}
 
 
       // Unhook from the signals.
       // Unhook from the signals.
-      Net::smConnectionNotify .remove(this, &JournalHandle::notify);
-      Net::smConnectionReceive.remove(this, &JournalHandle::receive);
+      Net::smConnectionNotify ->remove(this, &JournalHandle::notify);
+      Net::smConnectionReceive->remove(this, &JournalHandle::receive);
 
 
       EXPECT_GT(mDataReceived, 0)
       EXPECT_GT(mDataReceived, 0)
          << "Didn't get any data back!";
          << "Didn't get any data back!";

+ 1 - 1
Engine/source/windowManager/sdl/sdlSplashScreen.cpp

@@ -98,7 +98,7 @@ bool Platform::displaySplashWindow( String path )
       SDL_RenderPresent(gSplashRenderer);
       SDL_RenderPresent(gSplashRenderer);
    }
    }
 
 
-	return true;
+   return true;
 }
 }
 
 
 bool Platform::closeSplashWindow()
 bool Platform::closeSplashWindow()

+ 74 - 74
Engine/source/windowManager/sdl/sdlWindow.cpp

@@ -104,37 +104,37 @@ mShouldLockMouse(false),
 mSuppressReset(false),
 mSuppressReset(false),
 mMenuHandle(NULL)
 mMenuHandle(NULL)
 {
 {
-	mCursorController = new PlatformCursorControllerSDL( this );
+   mCursorController = new PlatformCursorControllerSDL( this );
 
 
-	mVideoMode.bitDepth = 32;
-	mVideoMode.fullScreen = false;
-	mVideoMode.refreshRate = 60;
-	mVideoMode.resolution.set(800,600);
+   mVideoMode.bitDepth = 32;
+   mVideoMode.fullScreen = false;
+   mVideoMode.refreshRate = 60;
+   mVideoMode.resolution.set(800,600);
 }
 }
 
 
 PlatformWindowSDL::~PlatformWindowSDL()
 PlatformWindowSDL::~PlatformWindowSDL()
 {
 {
-	// delete our sdl handle..
-	SDL_DestroyWindow(mWindowHandle);
+   // delete our sdl handle..
+   SDL_DestroyWindow(mWindowHandle);
 
 
-	// unlink ourselves from the window list...
-	AssertFatal(mOwningManager, "PlatformWindowSDL::~PlatformWindowSDL - orphan window, cannot unlink!");
-	mOwningManager->unlinkWindow(this);
+   // unlink ourselves from the window list...
+   AssertFatal(mOwningManager, "PlatformWindowSDL::~PlatformWindowSDL - orphan window, cannot unlink!");
+   mOwningManager->unlinkWindow(this);
 }
 }
 
 
 GFXDevice * PlatformWindowSDL::getGFXDevice()
 GFXDevice * PlatformWindowSDL::getGFXDevice()
 {
 {
-	return mDevice;
+   return mDevice;
 }
 }
 
 
 GFXWindowTarget * PlatformWindowSDL::getGFXTarget()
 GFXWindowTarget * PlatformWindowSDL::getGFXTarget()
 {
 {
-	return mTarget;
+   return mTarget;
 }
 }
 
 
 const GFXVideoMode & PlatformWindowSDL::getVideoMode()
 const GFXVideoMode & PlatformWindowSDL::getVideoMode()
 {
 {
-	return mVideoMode;
+   return mVideoMode;
 }
 }
 
 
 void* PlatformWindowSDL::getSystemWindow(const WindowSystem system)
 void* PlatformWindowSDL::getSystemWindow(const WindowSystem system)
@@ -162,41 +162,41 @@ void PlatformWindowSDL::setVideoMode( const GFXVideoMode &mode )
    mVideoMode = mode;
    mVideoMode = mode;
    mSuppressReset = true;
    mSuppressReset = true;
 
 
-	// Set our window to have the right style based on the mode
+   // Set our window to have the right style based on the mode
    if(mode.fullScreen && !Platform::getWebDeployment() && !mOffscreenRender)
    if(mode.fullScreen && !Platform::getWebDeployment() && !mOffscreenRender)
-	{		
+   {     
       setSize(mode.resolution);
       setSize(mode.resolution);
 
 
       SDL_SetWindowFullscreen( mWindowHandle, SDL_WINDOW_FULLSCREEN);
       SDL_SetWindowFullscreen( mWindowHandle, SDL_WINDOW_FULLSCREEN);
 
 
       // When switching to Fullscreen, reset device after setting style
       // When switching to Fullscreen, reset device after setting style
-	   if(mTarget.isValid())
-		   mTarget->resetMode();
-	}
-	else
-	{
+      if(mTarget.isValid())
+         mTarget->resetMode();
+   }
+   else
+   {
       // Reset device *first*, so that when we call setSize() and let it
       // Reset device *first*, so that when we call setSize() and let it
-	   // access the monitor settings, it won't end up with our fullscreen
-	   // geometry that is just about to change.
+      // access the monitor settings, it won't end up with our fullscreen
+      // geometry that is just about to change.
 
 
-	   if(mTarget.isValid())
-		   mTarget->resetMode();
+      if(mTarget.isValid())
+         mTarget->resetMode();
 
 
       if (!mOffscreenRender)
       if (!mOffscreenRender)
       {
       {
-		   SDL_SetWindowFullscreen( mWindowHandle, 0);
+         SDL_SetWindowFullscreen( mWindowHandle, 0);
       }
       }
 
 
       setSize(mode.resolution);
       setSize(mode.resolution);
       centerWindow();
       centerWindow();
-	}
+   }
 
 
-	mSuppressReset = false;
+   mSuppressReset = false;
 }
 }
 
 
 bool PlatformWindowSDL::clearFullscreen()
 bool PlatformWindowSDL::clearFullscreen()
 {
 {
-	return true;
+   return true;
 }
 }
 
 
 bool PlatformWindowSDL::isFullscreen()
 bool PlatformWindowSDL::isFullscreen()
@@ -210,32 +210,32 @@ bool PlatformWindowSDL::isFullscreen()
 
 
 void PlatformWindowSDL::_setFullscreen(const bool fullscreen)
 void PlatformWindowSDL::_setFullscreen(const bool fullscreen)
 {
 {
-	if( isFullscreen() )
-		return;
-
-	if(fullscreen && !mOffscreenRender)
-	{
-		Con::printf("PlatformWindowSDL::setFullscreen (full) enter");
-		SDL_SetWindowFullscreen( mWindowHandle, SDL_WINDOW_FULLSCREEN);
-	}
-	else
-	{
-		Con::printf("PlatformWindowSDL::setFullscreen (windowed) enter");
+   if( isFullscreen() )
+      return;
+
+   if(fullscreen && !mOffscreenRender)
+   {
+      Con::printf("PlatformWindowSDL::setFullscreen (full) enter");
+      SDL_SetWindowFullscreen( mWindowHandle, SDL_WINDOW_FULLSCREEN);
+   }
+   else
+   {
+      Con::printf("PlatformWindowSDL::setFullscreen (windowed) enter");
       if (!mOffscreenRender)
       if (!mOffscreenRender)
       {
       {
-	      SDL_SetWindowFullscreen( mWindowHandle, SDL_WINDOW_FULLSCREEN_DESKTOP);
+         SDL_SetWindowFullscreen( mWindowHandle, SDL_WINDOW_FULLSCREEN_DESKTOP);
       }
       }
 
 
       setSize(mVideoMode.resolution);
       setSize(mVideoMode.resolution);
 
 
-	}
-	Con::printf("PlatformWindowSDL::setFullscreen exit");   
+   }
+   Con::printf("PlatformWindowSDL::setFullscreen exit");   
 }
 }
 
 
 bool PlatformWindowSDL::setCaption( const char *cap )
 bool PlatformWindowSDL::setCaption( const char *cap )
 {
 {
    SDL_SetWindowTitle(mWindowHandle, cap);
    SDL_SetWindowTitle(mWindowHandle, cap);
-	return true;
+   return true;
 }
 }
 
 
 const char * PlatformWindowSDL::getCaption()
 const char * PlatformWindowSDL::getCaption()
@@ -250,45 +250,45 @@ void PlatformWindowSDL::setFocus()
 
 
 void PlatformWindowSDL::setClientExtent( const Point2I newExtent )
 void PlatformWindowSDL::setClientExtent( const Point2I newExtent )
 {
 {
-	Point2I oldExtent = getClientExtent();
-	if (oldExtent == newExtent)
-		return;   
+   Point2I oldExtent = getClientExtent();
+   if (oldExtent == newExtent)
+      return;   
 
 
    SDL_SetWindowSize(mWindowHandle, newExtent.x, newExtent.y);
    SDL_SetWindowSize(mWindowHandle, newExtent.x, newExtent.y);
 }
 }
 
 
 const Point2I PlatformWindowSDL::getClientExtent()
 const Point2I PlatformWindowSDL::getClientExtent()
 {
 {
-	// Fetch Client Rect from Windows
+   // Fetch Client Rect from Windows
    Point2I size;
    Point2I size;
-	SDL_GetWindowSize(mWindowHandle, &size.x, &size.y);
+   SDL_GetWindowSize(mWindowHandle, &size.x, &size.y);
 
 
-	return size;
+   return size;
 }
 }
 
 
 void PlatformWindowSDL::setBounds( const RectI &newBounds )
 void PlatformWindowSDL::setBounds( const RectI &newBounds )
 {
 {
-	// TODO SDL
+   // TODO SDL
 }
 }
 
 
 const RectI PlatformWindowSDL::getBounds() const
 const RectI PlatformWindowSDL::getBounds() const
 {
 {
-	// TODO SDL
-	return RectI(0, 0, 0, 0);   
+   // TODO SDL
+   return RectI(0, 0, 0, 0);   
 }
 }
 
 
 void PlatformWindowSDL::setPosition( const Point2I newPosition )
 void PlatformWindowSDL::setPosition( const Point2I newPosition )
 {
 {
-	SDL_SetWindowPosition( mWindowHandle, newPosition.x, newPosition.y );
+   SDL_SetWindowPosition( mWindowHandle, newPosition.x, newPosition.y );
 }
 }
 
 
 const Point2I PlatformWindowSDL::getPosition()
 const Point2I PlatformWindowSDL::getPosition()
 {
 {
-	Point2I position;
-	SDL_GetWindowPosition( mWindowHandle, &position.x, &position.y );
+   Point2I position;
+   SDL_GetWindowPosition( mWindowHandle, &position.x, &position.y );
 
 
-	// Return position
-	return position;
+   // Return position
+   return position;
 }
 }
 
 
 Point2I PlatformWindowSDL::clientToScreen( const Point2I& pos )
 Point2I PlatformWindowSDL::clientToScreen( const Point2I& pos )
@@ -311,7 +311,7 @@ void PlatformWindowSDL::centerWindow()
    SDL_GetWindowSize(mWindowHandle, &sizeX, &sizeY);
    SDL_GetWindowSize(mWindowHandle, &sizeX, &sizeY);
 
 
    SDL_DisplayMode mode;
    SDL_DisplayMode mode;
-	SDL_GetDesktopDisplayMode(0, &mode);
+   SDL_GetDesktopDisplayMode(0, &mode);
    
    
    U32 posX = (mode.w/2) - (sizeX/2);
    U32 posX = (mode.w/2) - (sizeX/2);
    U32 posY = (mode.h/2) - (sizeY/2);
    U32 posY = (mode.h/2) - (sizeY/2);
@@ -325,21 +325,21 @@ bool PlatformWindowSDL::setSize( const Point2I &newSize )
 
 
    // Let GFX get an update about the new resolution
    // Let GFX get an update about the new resolution
    if (mTarget.isValid())
    if (mTarget.isValid())
-		mTarget->resetMode();
+      mTarget->resetMode();
 
 
-	return true;
+   return true;
 }
 }
 
 
 bool PlatformWindowSDL::isOpen()
 bool PlatformWindowSDL::isOpen()
 {
 {
-	return mWindowHandle;
+   return mWindowHandle;
 }
 }
 
 
 bool PlatformWindowSDL::isVisible()
 bool PlatformWindowSDL::isVisible()
 {
 {
-	// Is the window open and visible, ie. not minimized?
-	if(!mWindowHandle)
-		return false;
+   // Is the window open and visible, ie. not minimized?
+   if(!mWindowHandle)
+      return false;
 
 
    if (mOffscreenRender)
    if (mOffscreenRender)
       return true;
       return true;
@@ -348,7 +348,7 @@ bool PlatformWindowSDL::isVisible()
    if( flags & SDL_WINDOW_SHOWN)
    if( flags & SDL_WINDOW_SHOWN)
       return true;
       return true;
 
 
-	return false;
+   return false;
 }
 }
 
 
 bool PlatformWindowSDL::isFocused()
 bool PlatformWindowSDL::isFocused()
@@ -389,7 +389,7 @@ bool PlatformWindowSDL::isMaximized()
 
 
 WindowId PlatformWindowSDL::getWindowId()
 WindowId PlatformWindowSDL::getWindowId()
 {
 {
-	return mWindowId;
+   return mWindowId;
 }
 }
 
 
 void PlatformWindowSDL::minimize()
 void PlatformWindowSDL::minimize()
@@ -397,7 +397,7 @@ void PlatformWindowSDL::minimize()
    if (mOffscreenRender)
    if (mOffscreenRender)
       return;
       return;
 
 
-	SDL_MinimizeWindow( mWindowHandle );
+   SDL_MinimizeWindow( mWindowHandle );
 }
 }
 
 
 void PlatformWindowSDL::maximize()
 void PlatformWindowSDL::maximize()
@@ -405,7 +405,7 @@ void PlatformWindowSDL::maximize()
    if (mOffscreenRender)
    if (mOffscreenRender)
       return;
       return;
 
 
-	SDL_MaximizeWindow( mWindowHandle );
+   SDL_MaximizeWindow( mWindowHandle );
 }
 }
 
 
 void PlatformWindowSDL::restore()
 void PlatformWindowSDL::restore()
@@ -413,7 +413,7 @@ void PlatformWindowSDL::restore()
    if (mOffscreenRender)
    if (mOffscreenRender)
       return;
       return;
 
 
-	SDL_RestoreWindow( mWindowHandle );
+   SDL_RestoreWindow( mWindowHandle );
 }
 }
 
 
 void PlatformWindowSDL::hide()
 void PlatformWindowSDL::hide()
@@ -421,7 +421,7 @@ void PlatformWindowSDL::hide()
    if (mOffscreenRender)
    if (mOffscreenRender)
       return;
       return;
 
 
-	SDL_HideWindow( mWindowHandle );
+   SDL_HideWindow( mWindowHandle );
 }
 }
 
 
 void PlatformWindowSDL::show()
 void PlatformWindowSDL::show()
@@ -429,17 +429,17 @@ void PlatformWindowSDL::show()
    if (mOffscreenRender)
    if (mOffscreenRender)
       return;
       return;
 
 
-	SDL_ShowWindow( mWindowHandle );
+   SDL_ShowWindow( mWindowHandle );
 }
 }
 
 
 void PlatformWindowSDL::close()
 void PlatformWindowSDL::close()
 {
 {
-	delete this;
+   delete this;
 }
 }
 
 
 void PlatformWindowSDL::defaultRender()
 void PlatformWindowSDL::defaultRender()
 {
 {
-	// TODO SDL
+   // TODO SDL
 }
 }
 
 
 void PlatformWindowSDL::_triggerMouseLocationNotify(const SDL_Event& evt)
 void PlatformWindowSDL::_triggerMouseLocationNotify(const SDL_Event& evt)
@@ -615,7 +615,7 @@ void PlatformWindowSDL::setMouseLocked( bool enable )
    if (mOffscreenRender)
    if (mOffscreenRender)
       return;
       return;
 
 
-	mMouseLocked = enable;
+   mMouseLocked = enable;
    
    
    SDL_SetWindowGrab( mWindowHandle, SDL_bool(enable) );
    SDL_SetWindowGrab( mWindowHandle, SDL_bool(enable) );
    SDL_SetRelativeMouseMode( SDL_bool(enable) );
    SDL_SetRelativeMouseMode( SDL_bool(enable) );

Some files were not shown because too many files changed in this diff