Browse Source

- TAML schema (adding in custom TAML).

MelvMay-GG 12 years ago
parent
commit
2e16ca5

+ 5 - 20
engine/source/2d/assets/ImageAsset.cc

@@ -111,13 +111,11 @@ IMPLEMENT_CONOBJECT(ImageAsset);
 
 //------------------------------------------------------------------------------
 
-static bool explicitCellPropertiesInitialized = false;
-
-static StringTableEntry cellCustomNodeName;
-static StringTableEntry cellNodeName;
-static StringTableEntry cellOffsetName;
-static StringTableEntry cellWidthName;
-static StringTableEntry cellHeightName;
+static StringTableEntry cellCustomNodeName          = StringTable->insert( "Cells" );
+static StringTableEntry cellNodeName                = StringTable->insert( "Cell" );
+static StringTableEntry cellOffsetName              = StringTable->insert( "Offset" );
+static StringTableEntry cellWidthName               = StringTable->insert( "Width" );
+static StringTableEntry cellHeightName              = StringTable->insert( "Height" );
 
 //------------------------------------------------------------------------------
 
@@ -181,19 +179,6 @@ ImageAsset::ImageAsset() :  mImageFile(StringTable->EmptyString),
     // Set Vector Associations.
     VECTOR_SET_ASSOCIATION( mFrames );
     VECTOR_SET_ASSOCIATION( mExplicitFrames );
-
-    // Initialize explicit cell field names.
-    if ( !explicitCellPropertiesInitialized )
-    {
-        cellCustomNodeName          = StringTable->insert( "Cells" );
-        cellNodeName                = StringTable->insert( "Cell" );
-        cellOffsetName              = StringTable->insert( "Offset" );
-        cellWidthName               = StringTable->insert( "Width" );
-        cellHeightName              = StringTable->insert( "Height" );
-
-        // Flag as initialized.
-        explicitCellPropertiesInitialized = true;
-    }
 }
 
 //------------------------------------------------------------------------------

+ 11 - 32
engine/source/2d/assets/ParticleAssetField.cc

@@ -40,19 +40,17 @@
 
 //-----------------------------------------------------------------------------
 
-static bool particleAssetFieldPropertiesInitialized = false;
-
-static StringTableEntry particleAssetFieldRepeatTimeName;
-static StringTableEntry particleAssetFieldMaxTimeName;
-static StringTableEntry particleAssetFieldMinValueName;
-static StringTableEntry particleAssetFieldMaxValueName;
-static StringTableEntry particleAssetFieldDefaultValueName;
-static StringTableEntry particleAssetFieldValueScaleName;
-static StringTableEntry particleAssetFieldDataKeysName;
-
-static StringTableEntry particleAssetFieldDataKeyName;
-static StringTableEntry particleAssetFieldDataKeyTimeName;
-static StringTableEntry particleAssetFieldDataKeyValueName;
+static StringTableEntry particleAssetFieldRepeatTimeName   = StringTable->insert( "RepeatTime" );
+static StringTableEntry particleAssetFieldMaxTimeName      = StringTable->insert( "MaxTime" );
+static StringTableEntry particleAssetFieldMinValueName     = StringTable->insert( "MinValue" );
+static StringTableEntry particleAssetFieldMaxValueName     = StringTable->insert( "MaxValue" );
+static StringTableEntry particleAssetFieldDefaultValueName = StringTable->insert( "DefaultValue" );
+static StringTableEntry particleAssetFieldValueScaleName   = StringTable->insert( "ValueScale" );
+static StringTableEntry particleAssetFieldDataKeysName     = StringTable->insert( "Keys" );
+
+static StringTableEntry particleAssetFieldDataKeyName      = StringTable->insert( "Key" );
+static StringTableEntry particleAssetFieldDataKeyTimeName  = StringTable->insert( "Time" );
+static StringTableEntry particleAssetFieldDataKeyValueName = StringTable->insert( "Value" );
 
 ParticleAssetField::DataKey ParticleAssetField::BadDataKey( -1.0f, 0.0f );
 
@@ -70,25 +68,6 @@ ParticleAssetField::ParticleAssetField() :
 {
     // Set Vector Associations.
     VECTOR_SET_ASSOCIATION( mDataKeys );
-
-    // Initialize names.
-    if ( !particleAssetFieldPropertiesInitialized )
-    {
-        particleAssetFieldRepeatTimeName   = StringTable->insert( "RepeatTime" );
-        particleAssetFieldMaxTimeName      = StringTable->insert( "MaxTime" );
-        particleAssetFieldMinValueName     = StringTable->insert( "MinValue" );
-        particleAssetFieldMaxValueName     = StringTable->insert( "MaxValue" );
-        particleAssetFieldDefaultValueName = StringTable->insert( "DefaultValue" );
-        particleAssetFieldValueScaleName   = StringTable->insert( "ValueScale" );
-        particleAssetFieldDataKeysName     = StringTable->insert( "Keys" );
-
-        particleAssetFieldDataKeyName      = StringTable->insert( "Key" );
-        particleAssetFieldDataKeyTimeName  = StringTable->insert( "Time" );
-        particleAssetFieldDataKeyValueName = StringTable->insert( "Value" );
-
-        // Flag as initialized.
-        particleAssetFieldPropertiesInitialized = true;
-    }
 }
 
 //-----------------------------------------------------------------------------

+ 2 - 3
engine/source/2d/assets/ParticleAssetFieldCollection.cc

@@ -24,15 +24,14 @@
 
 //-----------------------------------------------------------------------------
 
-static StringTableEntry particleAssetFieldNodeName;
+    // Set custom property name.
+static StringTableEntry particleAssetFieldNodeName = StringTable->insert("Fields");
 
 //-----------------------------------------------------------------------------
 
 ParticleAssetFieldCollection::ParticleAssetFieldCollection() :
                                     mpSelectedField( NULL )
 {
-    // Set custom property name.
-    particleAssetFieldNodeName = StringTable->insert("Fields");
 }
 
 //-----------------------------------------------------------------------------

+ 20 - 52
engine/source/2d/core/SpriteBatchItem.cc

@@ -34,63 +34,31 @@
 
 //-----------------------------------------------------------------------------
 
-static bool spriteBatchItemPropertiesInitialized = false;
-
-static StringTableEntry spriteLogicalPositionName;
-static StringTableEntry spriteVisibleName;
-static StringTableEntry spriteLocalPositionName;
-static StringTableEntry spriteLocalAngleName;
-static StringTableEntry spriteDepthName;
-static StringTableEntry spriteSizeName;
-static StringTableEntry spriteFlipXName;
-static StringTableEntry spriteFlipYName;
-static StringTableEntry spriteSortPointName;
-static StringTableEntry spriteRenderGroupName;
-static StringTableEntry spriteBlendModeName;
-static StringTableEntry spriteSrcBlendFactorName;
-static StringTableEntry spriteDstBlendFactorName;
-static StringTableEntry spriteBlendColorName;
-static StringTableEntry spriteAlphaTestName;
-static StringTableEntry spriteImageName;
-static StringTableEntry spriteImageFrameName;
-static StringTableEntry spriteAnimationName;
-static StringTableEntry spriteDataObjectName;
-static StringTableEntry spriteNameName;
+static StringTableEntry spriteNameName              = StringTable->insert("Name");
+static StringTableEntry spriteLogicalPositionName   = StringTable->insert("LogicalPosition");
+static StringTableEntry spriteVisibleName           = StringTable->insert("Visible");
+static StringTableEntry spriteLocalPositionName     = StringTable->insert("Position");
+static StringTableEntry spriteLocalAngleName        = StringTable->insert("Angle");
+static StringTableEntry spriteSizeName              = StringTable->insert("Size");
+static StringTableEntry spriteDepthName             = StringTable->insert("Depth");
+static StringTableEntry spriteFlipXName             = StringTable->insert("FlipX");
+static StringTableEntry spriteFlipYName             = StringTable->insert("FlipY");
+static StringTableEntry spriteSortPointName         = StringTable->insert("SortPoint");
+static StringTableEntry spriteRenderGroupName       = StringTable->insert("RenderGroup");
+static StringTableEntry spriteBlendModeName         = StringTable->insert("BlendMode");
+static StringTableEntry spriteSrcBlendFactorName    = StringTable->insert("SrcBlendFactor");
+static StringTableEntry spriteDstBlendFactorName    = StringTable->insert("DstBlendFactor");
+static StringTableEntry spriteBlendColorName        = StringTable->insert("BlendColor");
+static StringTableEntry spriteAlphaTestName         = StringTable->insert("AlphaTest");
+static StringTableEntry spriteImageName             = StringTable->insert("Image");
+static StringTableEntry spriteImageFrameName        = StringTable->insert("Frame");
+static StringTableEntry spriteAnimationName         = StringTable->insert("Animation");
+static StringTableEntry spriteDataObjectName        = StringTable->insert("DataObject");
 
 //------------------------------------------------------------------------------
 
 SpriteBatchItem::SpriteBatchItem() : mProxyId( SpriteBatch::INVALID_SPRITE_PROXY )
 {
-    // Are the sprite batch item properties initialized?
-    if ( !spriteBatchItemPropertiesInitialized )
-    {
-        // No, so initialize...
-
-        spriteNameName              = StringTable->insert("Name");
-        spriteLogicalPositionName   = StringTable->insert("LogicalPosition");
-        spriteVisibleName           = StringTable->insert("Visible");
-        spriteLocalPositionName     = StringTable->insert("Position");
-        spriteLocalAngleName        = StringTable->insert("Angle");
-        spriteSizeName              = StringTable->insert("Size");
-        spriteDepthName             = StringTable->insert("Depth");
-        spriteFlipXName             = StringTable->insert("FlipX");
-        spriteFlipYName             = StringTable->insert("FlipY");
-        spriteSortPointName         = StringTable->insert("SortPoint");
-        spriteRenderGroupName       = StringTable->insert("RenderGroup");
-        spriteBlendModeName         = StringTable->insert("BlendMode");
-        spriteSrcBlendFactorName    = StringTable->insert("SrcBlendFactor");
-        spriteDstBlendFactorName    = StringTable->insert("DstBlendFactor");
-        spriteBlendColorName        = StringTable->insert("BlendColor");
-        spriteAlphaTestName         = StringTable->insert("AlphaTest");
-        spriteImageName             = StringTable->insert("Image");
-        spriteImageFrameName        = StringTable->insert("Frame");
-        spriteAnimationName         = StringTable->insert("Animation");
-        spriteDataObjectName        = StringTable->insert("DataObject");
-
-        // Flag as initialized.
-        spriteBatchItemPropertiesInitialized = true;
-    }
-
     resetState();
 }
 

+ 148 - 145
engine/source/2d/scene/Scene.cc

@@ -68,84 +68,80 @@ SimObjectPtr<Scene> Scene::LoadingScene = NULL;
 
 //------------------------------------------------------------------------------
 
-IMPLEMENT_CONOBJECT_CHILDREN(Scene);
-
-//------------------------------------------------------------------------------
-
 static ContactFilter mContactFilter;
 
 // Scene counter.
 static U32 sSceneCount = 0;
 static U32 sSceneMasterIndex = 0;
 
-static bool tamlPropertiesInitialized = false;
-
-// Joint property names.
-static StringTableEntry jointCustomNodeName;
-static StringTableEntry jointCollideConnectedName;
-static StringTableEntry jointLocalAnchorAName;
-static StringTableEntry jointLocalAnchorBName;
-
-static StringTableEntry jointDistanceNodeName;
-static StringTableEntry jointDistanceLengthName;
-static StringTableEntry jointDistanceFrequencyName;
-static StringTableEntry jointDistanceDampingRatioName;
-
-static StringTableEntry jointRopeNodeName;
-static StringTableEntry jointRopeMaxLengthName;
-
-static StringTableEntry jointRevoluteNodeName;
-static StringTableEntry jointRevoluteLimitLowerAngleName;
-static StringTableEntry jointRevoluteLimitUpperAngleName;
-static StringTableEntry jointRevoluteMotorSpeedName;
-static StringTableEntry jointRevoluteMotorMaxTorqueName;
-
-static StringTableEntry jointWeldNodeName;
-static StringTableEntry jointWeldFrequencyName;
-static StringTableEntry jointWeldDampingRatioName;
-
-static StringTableEntry jointWheelNodeName;
-static StringTableEntry jointWheelWorldAxisName;
-static StringTableEntry jointWheelMotorSpeedName;
-static StringTableEntry jointWheelMotorMaxTorqueName;
-static StringTableEntry jointWheelFrequencyName;
-static StringTableEntry jointWheelDampingRatioName;
-
-static StringTableEntry jointFrictionNodeName;
-static StringTableEntry jointFrictionMaxForceName;
-static StringTableEntry jointFrictionMaxTorqueName;
-
-static StringTableEntry jointPrismaticNodeName;
-static StringTableEntry jointPrismaticWorldAxisName;
-static StringTableEntry jointPrismaticLimitLowerTransName;
-static StringTableEntry jointPrismaticLimitUpperTransName;
-static StringTableEntry jointPrismaticMotorSpeedName;
-static StringTableEntry jointPrismaticMotorMaxForceName;
-
-static StringTableEntry jointPulleyNodeName;
-static StringTableEntry jointPulleyGroundAnchorAName;
-static StringTableEntry jointPulleyGroundAnchorBName;
-static StringTableEntry jointPulleyLengthAName;
-static StringTableEntry jointPulleyLengthBName;
-static StringTableEntry jointPulleyRatioName;
-
-static StringTableEntry jointTargetNodeName;
-static StringTableEntry jointTargetWorldTargetName;
-static StringTableEntry jointTargetMaxForceName;
-static StringTableEntry jointTargetFrequencyName;
-static StringTableEntry jointTargetDampingRatioName;
-
-static StringTableEntry jointMotorNodeName;
-static StringTableEntry jointMotorLinearOffsetName;
-static StringTableEntry jointMotorAngularOffsetName;
-static StringTableEntry jointMotorMaxForceName;
-static StringTableEntry jointMotorMaxTorqueName;
-static StringTableEntry jointMotorCorrectionFactorName;
-
-static StringTableEntry controllerCustomNodeName;
-
-static StringTableEntry assetPreloadNodeName;
-static StringTableEntry assetNodeName;
+// Joint custom node names.
+static StringTableEntry jointCustomNodeName               = StringTable->insert( "Joints" );
+static StringTableEntry jointCollideConnectedName         = StringTable->insert( "CollideConnected" );
+static StringTableEntry jointLocalAnchorAName             = StringTable->insert( "LocalAnchorA" );
+static StringTableEntry jointLocalAnchorBName             = StringTable->insert( "LocalAnchorB" );
+
+static StringTableEntry jointDistanceNodeName             = StringTable->insert( "Distance" );
+static StringTableEntry jointDistanceLengthName           = StringTable->insert( "Length" );
+static StringTableEntry jointDistanceFrequencyName        = StringTable->insert( "Frequency" );
+static StringTableEntry jointDistanceDampingRatioName     = StringTable->insert( "DampingRatio" );
+
+static StringTableEntry jointRopeNodeName                 = StringTable->insert( "Rope" );
+static StringTableEntry jointRopeMaxLengthName            = StringTable->insert( "MaxLength" );
+
+static StringTableEntry jointRevoluteNodeName             = StringTable->insert( "Revolute" );
+static StringTableEntry jointRevoluteLimitLowerAngleName  = StringTable->insert( "LowerAngle" );
+static StringTableEntry jointRevoluteLimitUpperAngleName  = StringTable->insert( "UpperAngle" );
+static StringTableEntry jointRevoluteMotorSpeedName       = StringTable->insert( "MotorSpeed" );
+static StringTableEntry jointRevoluteMotorMaxTorqueName   = StringTable->insert( "MaxTorque" );
+
+static StringTableEntry jointWeldNodeName                 = StringTable->insert( "Weld" );
+static StringTableEntry jointWeldFrequencyName            = jointDistanceFrequencyName;
+static StringTableEntry jointWeldDampingRatioName         = jointDistanceDampingRatioName;
+
+static StringTableEntry jointWheelNodeName                = StringTable->insert( "Wheel" );
+static StringTableEntry jointWheelWorldAxisName           = StringTable->insert( "WorldAxis" );
+static StringTableEntry jointWheelMotorSpeedName          = StringTable->insert( "MotorSpeed" );
+static StringTableEntry jointWheelMotorMaxTorqueName      = jointRevoluteMotorMaxTorqueName;
+static StringTableEntry jointWheelFrequencyName           = jointDistanceFrequencyName;
+static StringTableEntry jointWheelDampingRatioName        = jointDistanceDampingRatioName;
+
+static StringTableEntry jointFrictionNodeName             = StringTable->insert( "Friction" );
+static StringTableEntry jointFrictionMaxForceName         = StringTable->insert( "MaxForce" );
+static StringTableEntry jointFrictionMaxTorqueName        = jointRevoluteMotorMaxTorqueName;
+
+static StringTableEntry jointPrismaticNodeName            = StringTable->insert( "Prismatic" );
+static StringTableEntry jointPrismaticWorldAxisName       = jointWheelWorldAxisName;
+static StringTableEntry jointPrismaticLimitLowerTransName = StringTable->insert( "LowerTranslation" );
+static StringTableEntry jointPrismaticLimitUpperTransName = StringTable->insert( "UpperTranslation" );
+static StringTableEntry jointPrismaticMotorSpeedName      = jointRevoluteMotorSpeedName;
+static StringTableEntry jointPrismaticMotorMaxForceName   = jointFrictionMaxForceName;
+
+static StringTableEntry jointPulleyNodeName               = StringTable->insert( "Pulley" );
+static StringTableEntry jointPulleyGroundAnchorAName      = StringTable->insert( "GroundAnchorA" );
+static StringTableEntry jointPulleyGroundAnchorBName      = StringTable->insert( "GroundAnchorB" );
+static StringTableEntry jointPulleyLengthAName            = StringTable->insert( "LengthA" );
+static StringTableEntry jointPulleyLengthBName            = StringTable->insert( "LengthB" );
+static StringTableEntry jointPulleyRatioName              = StringTable->insert( "Ratio" );
+
+static StringTableEntry jointTargetNodeName               = StringTable->insert( "Target" );
+static StringTableEntry jointTargetWorldTargetName        = StringTable->insert( "WorldTarget" );
+static StringTableEntry jointTargetMaxForceName           = StringTable->insert( jointFrictionMaxForceName );
+static StringTableEntry jointTargetFrequencyName          = jointDistanceFrequencyName;
+static StringTableEntry jointTargetDampingRatioName       = jointDistanceDampingRatioName;
+
+static StringTableEntry jointMotorNodeName                = StringTable->insert( "Motor" );
+static StringTableEntry jointMotorLinearOffsetName        = StringTable->insert( "LinearOffset" );
+static StringTableEntry jointMotorAngularOffsetName       = StringTable->insert( "AngularOffset" );
+static StringTableEntry jointMotorMaxForceName            = jointFrictionMaxForceName;
+static StringTableEntry jointMotorMaxTorqueName           = jointRevoluteMotorMaxTorqueName;
+static StringTableEntry jointMotorCorrectionFactorName    = StringTable->insert( "CorrectionFactor" );
+
+// Controller custom node names.
+static StringTableEntry controllerCustomNodeName	      = StringTable->insert( "Controllers" );
+
+// Asset preload custom node names.
+static StringTableEntry assetPreloadNodeName              = StringTable->insert( "AssetPreloads" );
+static StringTableEntry assetNodeName                     = StringTable->insert( "Asset" );
 
 //-----------------------------------------------------------------------------
 
@@ -176,79 +172,6 @@ Scene::Scene() :
     mRenderCallback(false),
     mSceneIndex(0)
 {
-    // Initialize Taml property names.
-    if ( !tamlPropertiesInitialized )
-    {
-        jointCustomNodeName               = StringTable->insert( "Joints" );
-        jointCollideConnectedName         = StringTable->insert( "CollideConnected" );
-        jointLocalAnchorAName             = StringTable->insert( "LocalAnchorA" );
-        jointLocalAnchorBName             = StringTable->insert( "LocalAnchorB" );
-
-        jointDistanceNodeName             = StringTable->insert( "Distance" );
-        jointDistanceLengthName           = StringTable->insert( "Length" );
-        jointDistanceFrequencyName        = StringTable->insert( "Frequency" );
-        jointDistanceDampingRatioName     = StringTable->insert( "DampingRatio" );
-
-        jointRopeNodeName                 = StringTable->insert( "Rope" );
-        jointRopeMaxLengthName            = StringTable->insert( "MaxLength" );
-
-        jointRevoluteNodeName             = StringTable->insert( "Revolute" );
-        jointRevoluteLimitLowerAngleName  = StringTable->insert( "LowerAngle" );
-        jointRevoluteLimitUpperAngleName  = StringTable->insert( "UpperAngle" );
-        jointRevoluteMotorSpeedName       = StringTable->insert( "MotorSpeed" );
-        jointRevoluteMotorMaxTorqueName   = StringTable->insert( "MaxTorque" );
-
-        jointWeldNodeName                 = StringTable->insert( "Weld" );
-        jointWeldFrequencyName            = jointDistanceFrequencyName;
-        jointWeldDampingRatioName         = jointDistanceDampingRatioName;
-
-        jointWheelNodeName                = StringTable->insert( "Wheel" );
-        jointWheelWorldAxisName           = StringTable->insert( "WorldAxis" );
-        jointWheelMotorSpeedName          = StringTable->insert( "MotorSpeed" );
-        jointWheelMotorMaxTorqueName      = jointRevoluteMotorMaxTorqueName;
-        jointWheelFrequencyName           = jointDistanceFrequencyName;
-        jointWheelDampingRatioName        = jointDistanceDampingRatioName;
-
-        jointFrictionNodeName             = StringTable->insert( "Friction" );
-        jointFrictionMaxForceName         = StringTable->insert( "MaxForce" );
-        jointFrictionMaxTorqueName        = jointRevoluteMotorMaxTorqueName;
-
-        jointPrismaticNodeName            = StringTable->insert( "Prismatic" );
-        jointPrismaticWorldAxisName       = jointWheelWorldAxisName;
-        jointPrismaticLimitLowerTransName = StringTable->insert( "LowerTranslation" );
-        jointPrismaticLimitUpperTransName = StringTable->insert( "UpperTranslation" );
-        jointPrismaticMotorSpeedName      = jointRevoluteMotorSpeedName;
-        jointPrismaticMotorMaxForceName   = jointFrictionMaxForceName;
-
-        jointPulleyNodeName               = StringTable->insert( "Pulley" );
-        jointPulleyGroundAnchorAName      = StringTable->insert( "GroundAnchorA" );
-        jointPulleyGroundAnchorBName      = StringTable->insert( "GroundAnchorB" );
-        jointPulleyLengthAName            = StringTable->insert( "LengthA" );
-        jointPulleyLengthBName            = StringTable->insert( "LengthB" );
-        jointPulleyRatioName              = StringTable->insert( "Ratio" );
-
-        jointTargetNodeName               = StringTable->insert( "Target" );
-        jointTargetWorldTargetName        = StringTable->insert( "WorldTarget" );
-        jointTargetMaxForceName           = StringTable->insert( jointFrictionMaxForceName );
-        jointTargetFrequencyName          = jointDistanceFrequencyName;
-        jointTargetDampingRatioName       = jointDistanceDampingRatioName;
-
-        jointMotorNodeName                = StringTable->insert( "Motor" );
-        jointMotorLinearOffsetName        = StringTable->insert( "LinearOffset" );
-        jointMotorAngularOffsetName       = StringTable->insert( "AngularOffset" );
-        jointMotorMaxForceName            = jointFrictionMaxForceName;
-        jointMotorMaxTorqueName           = jointRevoluteMotorMaxTorqueName;
-        jointMotorCorrectionFactorName    = StringTable->insert( "CorrectionFactor" );
-
-        controllerCustomNodeName	      = StringTable->insert( "Controllers" );
-
-        assetPreloadNodeName              = StringTable->insert( "AssetPreloads" );
-        assetNodeName                     = StringTable->insert( "Asset" );
-
-        // Flag as initialized.
-        tamlPropertiesInitialized = true;
-    }
-
     // Set Vector Associations.
     VECTOR_SET_ASSOCIATION( mSceneObjects );
     VECTOR_SET_ASSOCIATION( mDeleteRequests );
@@ -5425,3 +5348,83 @@ const char* Scene::getPickModeDescription( Scene::PickMode pickMode )
     return StringTable->EmptyString;
 }
 
+//-----------------------------------------------------------------------------
+
+static void WriteCustomTamlSchema( const AbstractClassRep* pClassRep, TiXmlElement* pParentElement )
+{
+    char buffer[1024];
+
+    // Create joints node element.
+    TiXmlElement* pJointsNodeElement = new TiXmlElement( "xs:element" );
+    dSprintf( buffer, sizeof(buffer), "%s.%s", pClassRep->getClassName(), jointCustomNodeName );
+    pJointsNodeElement->SetAttribute( "name", buffer );
+    pJointsNodeElement->SetAttribute( "minOccurs", 0 );
+    pJointsNodeElement->SetAttribute( "maxOccurs", 1 );
+    pParentElement->LinkEndChild( pJointsNodeElement );
+    
+    // Create complex type.
+    TiXmlElement* pJointsNodeComplexTypeElement = new TiXmlElement( "xs:complexType" );
+    pJointsNodeElement->LinkEndChild( pJointsNodeComplexTypeElement );
+    
+    // Create choice element.
+    TiXmlElement* pJointsNodeChoiceElement = new TiXmlElement( "xs:choice" );
+    pJointsNodeChoiceElement->SetAttribute( "minOccurs", 0 );
+    pJointsNodeChoiceElement->SetAttribute( "maxOccurs", "unbounded" );
+    pJointsNodeComplexTypeElement->LinkEndChild( pJointsNodeChoiceElement );
+
+    // ********************************************************************************
+    // Create Distance Joint Element.
+    // ********************************************************************************
+    TiXmlElement* pDistanceJointElement = new TiXmlElement( "xs:element" );
+    pDistanceJointElement->SetAttribute( "name", jointDistanceNodeName );
+    pDistanceJointElement->SetAttribute( "minOccurs", 0 );
+    pDistanceJointElement->SetAttribute( "maxOccurs", 1 );
+    pJointsNodeChoiceElement->LinkEndChild( pDistanceJointElement );
+
+    // Create complex type Element.
+    TiXmlElement* pDistanceJointComplexTypeElement = new TiXmlElement( "xs:complexType" );
+    pDistanceJointElement->LinkEndChild( pDistanceJointComplexTypeElement );
+
+    // Create "Length" attribute.
+    TiXmlElement* pDistanceJointElementA = new TiXmlElement( "xs:attribute" );
+    pDistanceJointElementA->SetAttribute( "name", jointDistanceLengthName );
+    pDistanceJointComplexTypeElement->LinkEndChild( pDistanceJointElementA );
+    TiXmlElement* pDistanceJointElementB = new TiXmlElement( "xs:simpleType" );
+    pDistanceJointElementA->LinkEndChild( pDistanceJointElementB );
+    TiXmlElement* pDistanceJointElementC = new TiXmlElement( "xs:restriction" );
+    pDistanceJointElementC->SetAttribute( "base", "xs:float" );
+    pDistanceJointElementB->LinkEndChild( pDistanceJointElementC );
+    TiXmlElement* pDistanceJointElementD = new TiXmlElement( "xs:minInclusive" );
+    pDistanceJointElementD->SetAttribute( "value", "0" );
+    pDistanceJointElementC->LinkEndChild( pDistanceJointElementD );
+
+    // Create "Frequency" attribute.
+    pDistanceJointElementA = new TiXmlElement( "xs:attribute" );
+    pDistanceJointElementA->SetAttribute( "name", jointDistanceFrequencyName );
+    pDistanceJointComplexTypeElement->LinkEndChild( pDistanceJointElementA );
+    pDistanceJointElementB = new TiXmlElement( "xs:simpleType" );
+    pDistanceJointElementA->LinkEndChild( pDistanceJointElementB );
+    pDistanceJointElementC = new TiXmlElement( "xs:restriction" );
+    pDistanceJointElementC->SetAttribute( "base", "xs:float" );
+    pDistanceJointElementB->LinkEndChild( pDistanceJointElementC );
+    pDistanceJointElementD = new TiXmlElement( "xs:minInclusive" );
+    pDistanceJointElementD->SetAttribute( "value", "0" );
+    pDistanceJointElementC->LinkEndChild( pDistanceJointElementD );
+
+    // Create "Damping Ratio" attribute.
+    pDistanceJointElementA = new TiXmlElement( "xs:attribute" );
+    pDistanceJointElementA->SetAttribute( "name", jointDistanceDampingRatioName );
+    pDistanceJointComplexTypeElement->LinkEndChild( pDistanceJointElementA );
+    pDistanceJointElementB = new TiXmlElement( "xs:simpleType" );
+    pDistanceJointElementA->LinkEndChild( pDistanceJointElementB );
+    pDistanceJointElementC = new TiXmlElement( "xs:restriction" );
+    pDistanceJointElementC->SetAttribute( "base", "xs:float" );
+    pDistanceJointElementB->LinkEndChild( pDistanceJointElementC );
+    pDistanceJointElementD = new TiXmlElement( "xs:minInclusive" );
+    pDistanceJointElementD->SetAttribute( "value", "0" );
+    pDistanceJointElementC->LinkEndChild( pDistanceJointElementD );
+}
+
+//------------------------------------------------------------------------------
+
+IMPLEMENT_CONOBJECT_CHILDREN_SCHEMA(Scene, WriteCustomTamlSchema);

+ 77 - 46
engine/source/2d/sceneobject/SceneObject.cc

@@ -76,33 +76,26 @@
 
 //-----------------------------------------------------------------------------
 
-IMPLEMENT_CONOBJECT(SceneObject);
-
-//-----------------------------------------------------------------------------
-
 // Scene-Object counter.
 static U32 sGlobalSceneObjectCount = 0;
 static U32 sSceneObjectMasterSerialId = 0;
 
-// Collision shape property names.
-static bool collisionShapePropertiesInitialized = false;
-
-static StringTableEntry shapeCustomNodeName;
-
-static StringTableEntry shapeDensityName;
-static StringTableEntry shapeFrictionName;
-static StringTableEntry shapeRestitutionName;
-static StringTableEntry shapeSensorName;
-static StringTableEntry shapePointName;
-static StringTableEntry shapePrevPointName;
-static StringTableEntry shapeNextPointName;
-
-static StringTableEntry circleTypeName;
-static StringTableEntry circleRadiusName;
-static StringTableEntry circleOffsetName;
-static StringTableEntry polygonTypeName;
-static StringTableEntry chainTypeName;
-static StringTableEntry edgeTypeName;
+// Collision shapes custom node names.
+static StringTableEntry shapeCustomNodeName     = StringTable->insert( "CollisionShapes" );
+
+static StringTableEntry shapeDensityName        = StringTable->insert( "Density" );
+static StringTableEntry shapeFrictionName       = StringTable->insert( "Friction" );
+static StringTableEntry shapeRestitutionName    = StringTable->insert( "Restitution" );
+static StringTableEntry shapeSensorName         = StringTable->insert( "Sensor" );
+static StringTableEntry shapePointName          = StringTable->insert( "Point" );
+static StringTableEntry shapePrevPointName      = StringTable->insert( "PreviousPoint" );
+static StringTableEntry shapeNextPointName      = StringTable->insert( "NextPoint" );
+static StringTableEntry circleTypeName          = StringTable->insert( "Circle" );
+static StringTableEntry circleRadiusName        = StringTable->insert( "Radius" );
+static StringTableEntry circleOffsetName        = StringTable->insert( "Offset" );
+static StringTableEntry polygonTypeName         = StringTable->insert( "Polygon" );
+static StringTableEntry chainTypeName           = StringTable->insert( "Chain" );
+static StringTableEntry edgeTypeName            = StringTable->insert( "Edge" );
 
 //------------------------------------------------------------------------------
 
@@ -194,29 +187,6 @@ SceneObject::SceneObject() :
     mSerialId(0),
     mRenderGroup( StringTable->EmptyString )
 {
-    // Initialize collision shape field names.
-    if ( !collisionShapePropertiesInitialized )
-    {
-        shapeCustomNodeName     = StringTable->insert( "CollisionShapes" );
-
-        shapeDensityName        = StringTable->insert( "Density" );
-        shapeFrictionName       = StringTable->insert( "Friction" );
-        shapeRestitutionName    = StringTable->insert( "Restitution" );
-        shapeSensorName         = StringTable->insert( "Sensor" );
-        shapePointName          = StringTable->insert( "Point" );
-        shapePrevPointName      = StringTable->insert( "PreviousPoint" );
-        shapeNextPointName      = StringTable->insert( "NextPoint" );
-        circleTypeName          = StringTable->insert( "Circle" );
-        circleRadiusName        = StringTable->insert( "Radius" );
-        circleOffsetName        = StringTable->insert( "Offset" );
-        polygonTypeName         = StringTable->insert( "Polygon" );
-        chainTypeName           = StringTable->insert( "Chain" );
-        edgeTypeName            = StringTable->insert( "Edge" );
-
-        // Flag as initialized.
-        collisionShapePropertiesInitialized = true;
-    }
-
     // Set Vector Associations.
     VECTOR_SET_ASSOCIATION( mDestroyNotifyList );
     VECTOR_SET_ASSOCIATION( mCollisionFixtureDefs );
@@ -4126,3 +4096,64 @@ const char* SceneObject::getDstBlendFactorDescription(const GLenum factor)
 
     return StringTable->EmptyString;
 }
+
+//-----------------------------------------------------------------------------
+
+static void WriteCustomTamlSchema( const AbstractClassRep* pClassRep, TiXmlElement* pParentElement )
+{
+    char buffer[1024];
+
+    // Create shapes node element.
+    TiXmlElement* pShapesNodeElement = new TiXmlElement( "xs:element" );
+    dSprintf( buffer, sizeof(buffer), "%s.%s", pClassRep->getClassName(), shapeCustomNodeName );
+    pShapesNodeElement->SetAttribute( "name", buffer );
+    pShapesNodeElement->SetAttribute( "minOccurs", 0 );
+    pShapesNodeElement->SetAttribute( "maxOccurs", 1 );
+    pParentElement->LinkEndChild( pShapesNodeElement );
+    
+    // Create complex type.
+    TiXmlElement* pShapesNodeComplexTypeElement = new TiXmlElement( "xs:complexType" );
+    pShapesNodeElement->LinkEndChild( pShapesNodeComplexTypeElement );
+    
+    // Create choice element.
+    TiXmlElement* pShapesNodeChoiceElement = new TiXmlElement( "xs:choice" );
+    pShapesNodeChoiceElement->SetAttribute( "minOccurs", 0 );
+    pShapesNodeChoiceElement->SetAttribute( "maxOccurs", "unbounded" );
+    pShapesNodeComplexTypeElement->LinkEndChild( pShapesNodeChoiceElement );
+
+    // ********************************************************************************
+    // Create Circle
+    // ********************************************************************************
+    TiXmlElement* pCircleElement = new TiXmlElement( "xs:element" );
+    pCircleElement->SetAttribute( "name", circleTypeName );
+    pCircleElement->SetAttribute( "minOccurs", 0 );
+    pCircleElement->SetAttribute( "maxOccurs", 1 );
+    pShapesNodeChoiceElement->LinkEndChild( pCircleElement );
+
+    // Create complex type Element.
+    TiXmlElement* pCircleComplexTypeElement = new TiXmlElement( "xs:complexType" );
+    pCircleElement->LinkEndChild( pCircleComplexTypeElement );
+
+    // Create "Radius" attribute.
+    TiXmlElement* pCircleElementA = new TiXmlElement( "xs:attribute" );
+    pCircleElementA->SetAttribute( "name", circleRadiusName );
+    pCircleComplexTypeElement->LinkEndChild( pCircleElementA );
+    TiXmlElement* pCircleElementB = new TiXmlElement( "xs:simpleType" );
+    pCircleElementA->LinkEndChild( pCircleElementB );
+    TiXmlElement* pCircleElementC = new TiXmlElement( "xs:restriction" );
+    pCircleElementC->SetAttribute( "base", "xs:float" );
+    pCircleElementB->LinkEndChild( pCircleElementC );
+    TiXmlElement* pCircleElementD = new TiXmlElement( "xs:minExclusive" );
+    pCircleElementD->SetAttribute( "value", "0" );
+    pCircleElementC->LinkEndChild( pCircleElementD );
+
+    // Create "Offset" attribute.
+    pCircleElementA = new TiXmlElement( "xs:attribute" );
+    pCircleElementA->SetAttribute( "name", circleOffsetName );
+    pCircleElementA->SetAttribute( "type", "Vector2_ConsoleType" );
+    pCircleComplexTypeElement->LinkEndChild( pCircleElementA );
+}
+
+//-----------------------------------------------------------------------------
+
+IMPLEMENT_CONOBJECT_SCHEMA(SceneObject, WriteCustomTamlSchema);

+ 558 - 503
engine/source/console/consoleObject.h

@@ -38,40 +38,56 @@
 #ifndef _CONSOLE_H_
 #include "console/console.h"
 #endif
+#ifndef TINYXML_INCLUDED
+#include "persistence/tinyXML/tinyxml.h"
+#endif
+
+//-----------------------------------------------------------------------------
 
 class Namespace;
 class ConsoleObject;
 
+//-----------------------------------------------------------------------------
+
 enum NetClassTypes {
-   NetClassTypeObject = 0,
-   NetClassTypeDataBlock,
-   NetClassTypeEvent,
-   NetClassTypesCount,
+    NetClassTypeObject = 0,
+    NetClassTypeDataBlock,
+    NetClassTypeEvent,
+    NetClassTypesCount,
 };
 
+//-----------------------------------------------------------------------------
+
 enum NetClassGroups {
-   NetClassGroupGame = 0,
-   NetClassGroupCommunity,
-   NetClassGroup3,
-   NetClassGroup4,
-   NetClassGroupsCount,
+    NetClassGroupGame = 0,
+    NetClassGroupCommunity,
+    NetClassGroup3,
+    NetClassGroup4,
+    NetClassGroupsCount,
 };
 
+//-----------------------------------------------------------------------------
+
 enum NetClassMasks {
-   NetClassGroupGameMask      = BIT(NetClassGroupGame),
-   NetClassGroupCommunityMask = BIT(NetClassGroupCommunity),
+    NetClassGroupGameMask      = BIT(NetClassGroupGame),
+    NetClassGroupCommunityMask = BIT(NetClassGroupCommunity),
 };
 
+//-----------------------------------------------------------------------------
+
 enum NetDirection
 {
-   NetEventDirAny,
-   NetEventDirServerToClient,
-   NetEventDirClientToServer,
+    NetEventDirAny,
+    NetEventDirServerToClient,
+    NetEventDirClientToServer,
 };
 
+//-----------------------------------------------------------------------------
+
 class SimObject;
 class ConsoleTypeValidator;
 
+//-----------------------------------------------------------------------------
 /// Core functionality for class manipulation.
 ///
 /// @section AbstractClassRep_intro Introduction (or, Why AbstractClassRep?)
@@ -164,212 +180,200 @@ class ConsoleTypeValidator;
 ///        bit allocations for network ID fields.
 ///
 /// @nosubgrouping
+//-----------------------------------------------------------------------------
+
 class AbstractClassRep
 {
-   friend class ConsoleObject;
+    friend class ConsoleObject;
 
 public:
+    /// This is a function pointer typedef to support get/set callbacks for fields
+    typedef bool (*SetDataNotify)( void *obj, const char *data );
+    typedef const char *(*GetDataNotify)( void *obj, const char *data );
 
-   /// @name 'Tructors
-   /// @{
-
-   AbstractClassRep() 
-   {
-      VECTOR_SET_ASSOCIATION(mFieldList);
-      parentClass  = NULL;
-   }
-   virtual ~AbstractClassRep() { }
-
-   /// @}
-
-   /// @name Representation Interface
-   /// @{
-
-   S32 mClassGroupMask;                ///< Mask indicating in which NetGroups this object belongs.
-   S32 mClassType;                     ///< Stores the NetClass of this class.
-   S32 mNetEventDir;                   ///< Stores the NetDirection of this class.
-   S32 mClassId[NetClassGroupsCount];  ///< Stores the IDs assigned to this class for each group.
-
-   S32                        getClassId  (U32 netClassGroup)   const;
-   static U32                 getClassCRC (U32 netClassGroup);
-   const char*                getClassName() const;
-   static AbstractClassRep*   getClassList();
-   Namespace*                 getNameSpace();
-   AbstractClassRep*          getNextClass();
-   AbstractClassRep*          getParentClass();
-   virtual AbstractClassRep*  getContainerChildClass( const bool recurse ) = 0;
-
-   /// Helper class to see if we are a given class, or a subclass thereof.
-   bool                       isClass(AbstractClassRep  *acr)
-   {
-      AbstractClassRep  *walk = this;
+    /// This is a function pointer typedef to support optional writing for fields.
+    typedef bool (*WriteDataNotify)( void* obj, const char* pFieldName );
 
-      //  Walk up parents, checking for equivalence.
-      while(walk)
-      {
-         if(walk == acr)
-            return true;
-
-         walk = walk->parentClass;
-      };
-
-      return false;
-   }
-
-   virtual ConsoleObject*     create      () const = 0;
+    /// Allows the writing of a custom TAML schema.
+    typedef void (*WriteCustomTamlSchema)( const AbstractClassRep* pClassRep, TiXmlElement* pParentElement );
 
 protected:
-   virtual void init() const = 0;
-
-   const char *       mClassName;
-   AbstractClassRep * nextClass;
-   AbstractClassRep * parentClass;
-   Namespace *        mNamespace;
+    const char *       mClassName;
+    AbstractClassRep * nextClass;
+    AbstractClassRep * parentClass;
+    Namespace *        mNamespace;
 
-   /// @}
+    static AbstractClassRep ** classTable[NetClassGroupsCount][NetClassTypesCount];
+    static AbstractClassRep *  classLinkList;
+    static U32                 classCRC[NetClassGroupsCount];
+    static bool                initialized;
 
+    static ConsoleObject* create(const char*  in_pClassName);
+    static ConsoleObject* create(const U32 groupId, const U32 typeId, const U32 in_classId);
 
-   /// @name Fields
-   /// @{
 public:
+    enum ACRFieldTypes
+    {
+        StartGroupFieldType = 0xFFFFFFFD,
+        EndGroupFieldType   = 0xFFFFFFFE,
+        DepricatedFieldType = 0xFFFFFFFF
+    };
+
+    struct Field {
+        const char* pFieldname;    ///< Name of the field.
+        const char* pGroupname;      ///< Optionally filled field containing the group name.
+        ///
+        ///  This is filled when type is StartField or EndField
+
+        const char*    pFieldDocs;    ///< Documentation about this field; see consoleDoc.cc.
+        bool           groupExpand;   ///< Flag to track expanded/not state of this group in the editor.
+        U32            type;          ///< A type ID. @see ACRFieldTypes
+        U32            offset;        ///< Memory offset from beginning of class for this field.
+        S32            elementCount;  ///< Number of elements, if this is an array.
+        EnumTable *    table;         ///< If this is an enum, this points to the table defining it.
+        BitSet32       flag;          ///< Stores various flags
+        ConsoleTypeValidator *validator;     ///< Validator, if any.
+        SetDataNotify  setDataFn;     ///< Set data notify Fn
+        GetDataNotify  getDataFn;     ///< Get data notify Fn
+        WriteDataNotify writeDataFn;   ///< Function to determine whether data should be written or not.
+    };
+    typedef Vector<Field> FieldList;
+
+    FieldList mFieldList;
+
+    bool mDynamicGroupExpand;
+
+    static U32  NetClassCount [NetClassGroupsCount][NetClassTypesCount];
+    static U32  NetClassBitSize[NetClassGroupsCount][NetClassTypesCount];
+
+    static void registerClassRep(AbstractClassRep*);
+    static AbstractClassRep* findClassRep(const char* in_pClassName);
+    static void initialize(); // Called from Con::init once on startup
+    static void destroyFieldValidators(AbstractClassRep::FieldList &mFieldList);
 
-   /// This is a function pointer typedef to support get/set callbacks for fields
-   typedef bool (*SetDataNotify)( void *obj, const char *data );
-   typedef const char *(*GetDataNotify)( void *obj, const char *data );
-
-   /// This is a function pointer typedef to support optional writing for fields.
-   typedef bool (*WriteDataNotify)( void* obj, const char* pFieldName );
-
-   enum ACRFieldTypes
-   {
-      StartGroupFieldType = 0xFFFFFFFD,
-      EndGroupFieldType   = 0xFFFFFFFE,
-      DepricatedFieldType = 0xFFFFFFFF
-   };
-
-   struct Field {
-      const char* pFieldname;    ///< Name of the field.
-      const char* pGroupname;      ///< Optionally filled field containing the group name.
-                                 ///
-                                 ///  This is filled when type is StartField or EndField
-
-      const char*    pFieldDocs;    ///< Documentation about this field; see consoleDoc.cc.
-      bool           groupExpand;   ///< Flag to track expanded/not state of this group in the editor.
-      U32            type;          ///< A type ID. @see ACRFieldTypes
-      U32            offset;        ///< Memory offset from beginning of class for this field.
-      S32            elementCount;  ///< Number of elements, if this is an array.
-      EnumTable *    table;         ///< If this is an enum, this points to the table defining it.
-      BitSet32       flag;          ///< Stores various flags
-      ConsoleTypeValidator *validator;     ///< Validator, if any.
-      SetDataNotify  setDataFn;     ///< Set data notify Fn
-      GetDataNotify  getDataFn;     ///< Get data notify Fn
-      WriteDataNotify writeDataFn;   ///< Function to determine whether data should be written or not.
-   };
-   typedef Vector<Field> FieldList;
-
-   FieldList mFieldList;
-
-   bool mDynamicGroupExpand;
-
-   const Field *findField(StringTableEntry fieldName) const;
-
-   AbstractClassRep* findFieldRoot( StringTableEntry fieldName );
-
-   AbstractClassRep* findContainerChildRoot( AbstractClassRep* pChild );
-   
-   /// @}
+public:
+    AbstractClassRep() 
+    {
+        VECTOR_SET_ASSOCIATION(mFieldList);
+        parentClass  = NULL;
+    }
+    virtual ~AbstractClassRep() { }
+
+    S32 mClassGroupMask;                ///< Mask indicating in which NetGroups this object belongs.
+    S32 mClassType;                     ///< Stores the NetClass of this class.
+    S32 mNetEventDir;                   ///< Stores the NetDirection of this class.
+    S32 mClassId[NetClassGroupsCount];  ///< Stores the IDs assigned to this class for each group.
+
+    S32                          getClassId  (U32 netClassGroup)   const;
+    static U32                   getClassCRC (U32 netClassGroup);
+    const char*                  getClassName() const;
+    static AbstractClassRep*     getClassList();
+    Namespace*                   getNameSpace();
+    AbstractClassRep*            getNextClass();
+    AbstractClassRep*            getParentClass();
+    virtual AbstractClassRep*    getContainerChildClass( const bool recurse ) = 0;
+    virtual WriteCustomTamlSchema getCustomTamlSchema( void ) = 0;
+
+    /// Helper class to see if we are a given class, or a subclass thereof.
+    bool                       isClass(AbstractClassRep  *acr)
+    {
+        AbstractClassRep  *walk = this;
 
-   /// @name Abstract Class Database
-   /// @{
+        //  Walk up parents, checking for equivalence.
+        while(walk)
+        {
+            if(walk == acr)
+                return true;
 
-protected:
-   static AbstractClassRep ** classTable[NetClassGroupsCount][NetClassTypesCount];
-   static AbstractClassRep *  classLinkList;
-   static U32                 classCRC[NetClassGroupsCount];
-   static bool                initialized;
+            walk = walk->parentClass;
+        };
 
-   static ConsoleObject* create(const char*  in_pClassName);
-   static ConsoleObject* create(const U32 groupId, const U32 typeId, const U32 in_classId);
+        return false;
+    }
 
 public:
-   static U32  NetClassCount [NetClassGroupsCount][NetClassTypesCount];
-   static U32  NetClassBitSize[NetClassGroupsCount][NetClassTypesCount];
-
-   static void registerClassRep(AbstractClassRep*);
-   static AbstractClassRep* findClassRep(const char* in_pClassName);
-   static void initialize(); // Called from Con::init once on startup
-   static void destroyFieldValidators(AbstractClassRep::FieldList &mFieldList);
+    virtual ConsoleObject* create() const = 0;
+    const Field *findField(StringTableEntry fieldName) const;
+    AbstractClassRep* findFieldRoot( StringTableEntry fieldName );
+    AbstractClassRep* findContainerChildRoot( AbstractClassRep* pChild );
 
-
-   /// @}
+protected:
+    virtual void init() const = 0;
 };
 
+//-----------------------------------------------------------------------------
+
 inline AbstractClassRep *AbstractClassRep::getClassList()
 {
-   return classLinkList;
+    return classLinkList;
 }
 
+//-----------------------------------------------------------------------------
+
 inline U32 AbstractClassRep::getClassCRC(U32 group)
 {
-   return classCRC[group];
+    return classCRC[group];
 }
 
+//-----------------------------------------------------------------------------
+
 inline AbstractClassRep *AbstractClassRep::getNextClass()
 {
-   return nextClass;
+    return nextClass;
 }
 
+//-----------------------------------------------------------------------------
+
 inline AbstractClassRep *AbstractClassRep::getParentClass()
 {
-   return parentClass;
+    return parentClass;
 }
 
+
+//-----------------------------------------------------------------------------
 inline S32 AbstractClassRep::getClassId(U32 group) const
 {
-   return mClassId[group];
+    return mClassId[group];
 }
 
+//-----------------------------------------------------------------------------
+
 inline const char* AbstractClassRep::getClassName() const
 {
-   return mClassName;
+    return mClassName;
 }
 
+//-----------------------------------------------------------------------------
+
 inline Namespace *AbstractClassRep::getNameSpace()
 {
-   return mNamespace;
+    return mNamespace;
 }
 
-//------------------------------------------------------------------------------
-//-------------------------------------- ConcreteClassRep
-//
-
+//-----------------------------------------------------------------------------
 
-/// Helper class for AbstractClassRep.
-///
-/// @see AbtractClassRep
-/// @see ConsoleObject
 template <class T>
 class ConcreteClassRep : public AbstractClassRep
 {
 public:
-   ConcreteClassRep(const char *name, S32 netClassGroupMask, S32 netClassType, S32 netEventDir, AbstractClassRep *parent )
-   {
-      // name is a static compiler string so no need to worry about copying or deleting
-      mClassName = name;
+    ConcreteClassRep(const char *name, S32 netClassGroupMask, S32 netClassType, S32 netEventDir, AbstractClassRep *parent )
+    {
+        // name is a static compiler string so no need to worry about copying or deleting
+        mClassName = name;
 
-      // Clean up mClassId
-      for(U32 i = 0; i < NetClassGroupsCount; i++)
-         mClassId[i] = -1;
+        // Clean up mClassId
+        for(U32 i = 0; i < NetClassGroupsCount; i++)
+            mClassId[i] = -1;
 
-      // Set properties for this ACR
-      mClassType      = netClassType;
-      mClassGroupMask = netClassGroupMask;
-      mNetEventDir    = netEventDir;
-      parentClass     = parent;
+        // Set properties for this ACR
+        mClassType      = netClassType;
+        mClassGroupMask = netClassGroupMask;
+        mNetEventDir    = netEventDir;
+        parentClass     = parent;
 
-      // Finally, register ourselves.
-      registerClassRep(this);
-   };
+        // Finally, register ourselves.
+        registerClassRep(this);
+    };
 
     virtual AbstractClassRep* getContainerChildClass( const bool recurse )
     {
@@ -387,33 +391,40 @@ public:
         return pParent->getContainerChildClass( recurse );
     }
 
-   /// Perform class specific initialization tasks.
-   ///
-   /// Link namespaces, call initPersistFields() and consoleInit().
-   void init() const
-   {
-      // Get handle to our parent class, if any, and ourselves (we are our parent's child).
-      AbstractClassRep *parent      = T::getParentStaticClassRep();
-      AbstractClassRep *child       = T::getStaticClassRep();
-
-      // If we got reps, then link those namespaces! (To get proper inheritance.)
-      if(parent && child)
-         Con::classLinkNamespaces(parent->getNameSpace(), child->getNameSpace());
-
-      // Finally, do any class specific initialization...
-      T::initPersistFields();
-      T::consoleInit();
-   }
-
-   /// Wrap constructor.
-   ConsoleObject* create() const { return new T; }
+    virtual WriteCustomTamlSchema getCustomTamlSchema( void )
+    {
+        return T::getStaticWriteCustomTamlSchema();
+    }
+
+    /// Perform class specific initialization tasks.
+    ///
+    /// Link namespaces, call initPersistFields() and consoleInit().
+    void init() const
+    {
+        // Get handle to our parent class, if any, and ourselves (we are our parent's child).
+        AbstractClassRep *parent      = T::getParentStaticClassRep();
+        AbstractClassRep *child       = T::getStaticClassRep();
+
+        // If we got reps, then link those namespaces! (To get proper inheritance.)
+        if(parent && child)
+            Con::classLinkNamespaces(parent->getNameSpace(), child->getNameSpace());
+
+        // Finally, do any class specific initialization...
+        T::initPersistFields();
+        T::consoleInit();
+    }
+
+    /// Wrap constructor.
+    ConsoleObject* create() const { return new T; }
 };
 
-//------------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+
 // Forward declarations so they can be used in the class
 const char *defaultProtectedGetFn( void *obj, const char *data );
 bool defaultProtectedWriteFn( void* obj, StringTableEntry pFieldName );
 
+//-----------------------------------------------------------------------------
 /// Interface class to the console.
 ///
 /// @section ConsoleObject_basics The Basics
@@ -464,407 +475,451 @@ bool defaultProtectedWriteFn( void* obj, StringTableEntry pFieldName );
 ///
 /// @see AbstractClassRep for gory implementation details.
 /// @nosubgrouping
+//-----------------------------------------------------------------------------
+
 class ConsoleObject
 {
 protected:
-   /// @deprecated This is disallowed.
-   ConsoleObject() { /* disallowed */ }
-   /// @deprecated This is disallowed.
-   ConsoleObject(const ConsoleObject&);
+    /// @deprecated This is disallowed.
+    ConsoleObject() { /* disallowed */ }
+    /// @deprecated This is disallowed.
+    ConsoleObject(const ConsoleObject&);
 
 public:
-   /// Get a reference to a field by name.
-   const AbstractClassRep::Field* findField(StringTableEntry fieldName) const;
+    /// Get a reference to a field by name.
+    const AbstractClassRep::Field* findField(StringTableEntry fieldName) const;
 
-   /// Gets the ClassRep.
-   virtual AbstractClassRep* getClassRep() const;
+    /// Gets the ClassRep.
+    virtual AbstractClassRep* getClassRep() const;
 
-   /// Set the value of a field.
-   bool setField(const char *fieldName, const char *value);
-   virtual ~ConsoleObject();
+    /// Set the value of a field.
+    bool setField(const char *fieldName, const char *value);
+    virtual ~ConsoleObject();
 
 public:
-   /// @name Object Creation
-   /// @{
-   static ConsoleObject* create(const char*  in_pClassName);
-   static ConsoleObject* create(const U32 groupId, const U32 typeId, const U32 in_classId);
-   /// @}
+    /// @name Object Creation
+    /// @{
+    static ConsoleObject* create(const char*  in_pClassName);
+    static ConsoleObject* create(const U32 groupId, const U32 typeId, const U32 in_classId);
+    /// @}
 
 public:
-   /// Get the classname from a class tag.
-   static const char* lookupClassName(const U32 in_classTag);
+    /// Get the classname from a class tag.
+    static const char* lookupClassName(const U32 in_classTag);
 
 protected:
-   /// @name Fields
-   /// @{
-
-   /// Mark the beginning of a group of fields.
-   ///
-   /// This is used in the consoleDoc system.
-   /// @see console_autodoc
-   static void addGroup(const char*  in_pGroupname, const char* in_pGroupDocs = NULL);
-
-   /// Mark the end of a group of fields.
-   ///
-   /// This is used in the consoleDoc system.
-   /// @see console_autodoc
-   static void endGroup(const char*  in_pGroupname);
-
-   /// Register a complex field.
-   ///
-   /// @param  in_pFieldname     Name of the field.
-   /// @param  in_fieldType      Type of the field. @see ConsoleDynamicTypes
-   /// @param  in_fieldOffset    Offset to  the field from the start of the class; calculated using the Offset() macro.
-   /// @param  in_elementCount   Number of elements in this field. Arrays of elements are assumed to be contiguous in memory.
-   /// @param  in_table          An EnumTable, if this is an enumerated field.
-   /// @param  in_pFieldDocs     Usage string for this field. @see console_autodoc
-   static void addField(const char*   in_pFieldname,
-      const U32     in_fieldType,
-      const dsize_t in_fieldOffset,
-      const U32     in_elementCount = 1,
-      EnumTable *   in_table        = NULL,
-      const char*   in_pFieldDocs   = NULL);
-
-   /// Register a complex field with a write notify.
-   ///
-   /// @param  in_pFieldname     Name of the field.
-   /// @param  in_fieldType      Type of the field. @see ConsoleDynamicTypes
-   /// @param  in_fieldOffset    Offset to  the field from the start of the class; calculated using the Offset() macro.
-   /// @param  in_writeDataFn    This method will return whether the field should be written or not.
-   /// @param  in_elementCount   Number of elements in this field. Arrays of elements are assumed to be contiguous in memory.
-   /// @param  in_table          An EnumTable, if this is an enumerated field.
-   /// @param  in_pFieldDocs     Usage string for this field. @see console_autodoc
-   static void addField(const char*   in_pFieldname,
-      const U32     in_fieldType,
-      const dsize_t in_fieldOffset,
-      AbstractClassRep::WriteDataNotify in_writeDataFn,
-      const U32     in_elementCount = 1,
-      EnumTable *   in_table        = NULL,
-      const char*   in_pFieldDocs   = NULL);
-
-   /// Register a simple field.
-   ///
-   /// @param  in_pFieldname  Name of the field.
-   /// @param  in_fieldType   Type of the field. @see ConsoleDynamicTypes
-   /// @param  in_fieldOffset Offset to  the field from the start of the class; calculated using the Offset() macro.
-   /// @param  in_pFieldDocs  Usage string for this field. @see console_autodoc
-   static void addField(const char*   in_pFieldname,
-      const U32     in_fieldType,
-      const dsize_t in_fieldOffset,
-      const char*   in_pFieldDocs);
-
-
-   /// Register a simple field with a write notify.
-   ///
-   /// @param  in_pFieldname  Name of the field.
-   /// @param  in_fieldType   Type of the field. @see ConsoleDynamicTypes
-   /// @param  in_fieldOffset Offset to  the field from the start of the class; calculated using the Offset() macro.
-   /// @param  in_writeDataFn    This method will return whether the field should be written or not.
-   /// @param  in_pFieldDocs  Usage string for this field. @see console_autodoc
-   static void addField(const char*   in_pFieldname,
-      const U32     in_fieldType,
-      const dsize_t in_fieldOffset,
-      AbstractClassRep::WriteDataNotify in_writeDataFn,
-      const char*   in_pFieldDocs );
-
-   /// Register a validated field.
-   ///
-   /// A validated field is just like a normal field except that you can't
-   /// have it be an array, and that you give it a pointer to a ConsoleTypeValidator
-   /// subclass, which is then used to validate any value placed in it. Invalid
-   /// values are ignored and an error is printed to the console.
-   ///
-   /// @see addField
-   /// @see typeValidators.h
-   static void addFieldV(const char*   in_pFieldname,
-      const U32      in_fieldType,
-      const dsize_t  in_fieldOffset,
-      ConsoleTypeValidator *v,
-      const char *   in_pFieldDocs = NULL);
-
-   /// Register a complex protected field.
-   ///
-   /// @param  in_pFieldname     Name of the field.
-   /// @param  in_fieldType      Type of the field. @see ConsoleDynamicTypes
-   /// @param  in_fieldOffset    Offset to  the field from the start of the class; calculated using the Offset() macro.
-   /// @param  in_setDataFn      When this field gets set, it will call the callback provided. @see console_protected
-   /// @param  in_getDataFn      When this field is accessed for it's data, it will return the value of this function
-   /// @param  in_elementCount   Number of elements in this field. Arrays of elements are assumed to be contiguous in memory.
-   /// @param  in_table          An EnumTable, if this is an enumerated field.
-   /// @param  in_pFieldDocs     Usage string for this field. @see console_autodoc
-   static void addProtectedField(const char*   in_pFieldname,
-      const U32     in_fieldType,
-      const dsize_t in_fieldOffset,
-      AbstractClassRep::SetDataNotify in_setDataFn,
-      AbstractClassRep::GetDataNotify in_getDataFn = &defaultProtectedGetFn,
-      const U32     in_elementCount = 1,
-      EnumTable *   in_table        = NULL,
-      const char*   in_pFieldDocs   = NULL);
-
-   /// Register a complex protected field.
-   ///
-   /// @param  in_pFieldname     Name of the field.
-   /// @param  in_fieldType      Type of the field. @see ConsoleDynamicTypes
-   /// @param  in_fieldOffset    Offset to  the field from the start of the class; calculated using the Offset() macro.
-   /// @param  in_setDataFn      When this field gets set, it will call the callback provided. @see console_protected
-   /// @param  in_getDataFn      When this field is accessed for it's data, it will return the value of this function
-   /// @param  in_writeDataFn    This method will return whether the field should be written or not.
-   /// @param  in_elementCount   Number of elements in this field. Arrays of elements are assumed to be contiguous in memory.
-   /// @param  in_table          An EnumTable, if this is an enumerated field.
-   /// @param  in_pFieldDocs     Usage string for this field. @see console_autodoc
-   static void addProtectedField(const char*   in_pFieldname,
-      const U32     in_fieldType,
-      const dsize_t in_fieldOffset,
-      AbstractClassRep::SetDataNotify in_setDataFn,
-      AbstractClassRep::GetDataNotify in_getDataFn = &defaultProtectedGetFn,
-      AbstractClassRep::WriteDataNotify in_writeDataFn = &defaultProtectedWriteFn,
-      const U32     in_elementCount = 1,
-      EnumTable *   in_table        = NULL,
-      const char*   in_pFieldDocs   = NULL);
-
-   /// Register a simple protected field.
-   ///
-   /// @param  in_pFieldname  Name of the field.
-   /// @param  in_fieldType   Type of the field. @see ConsoleDynamicTypes
-   /// @param  in_fieldOffset Offset to  the field from the start of the class; calculated using the Offset() macro.
-   /// @param  in_setDataFn   When this field gets set, it will call the callback provided. @see console_protected
-   /// @param  in_getDataFn   When this field is accessed for it's data, it will return the value of this function
-   /// @param  in_pFieldDocs  Usage string for this field. @see console_autodoc
-   static void addProtectedField(const char*   in_pFieldname,
-      const U32     in_fieldType,
-      const dsize_t in_fieldOffset,
-      AbstractClassRep::SetDataNotify in_setDataFn,
-      AbstractClassRep::GetDataNotify in_getDataFn = &defaultProtectedGetFn,
-      const char*   in_pFieldDocs = NULL);
-
-   /// Register a simple protected field.
-   ///
-   /// @param  in_pFieldname  Name of the field.
-   /// @param  in_fieldType   Type of the field. @see ConsoleDynamicTypes
-   /// @param  in_fieldOffset Offset to  the field from the start of the class; calculated using the Offset() macro.
-   /// @param  in_setDataFn   When this field gets set, it will call the callback provided. @see console_protected
-   /// @param  in_getDataFn   When this field is accessed for it's data, it will return the value of this function
-   /// @param  in_writeDataFn    This method will return whether the field should be written or not.
-   /// @param  in_pFieldDocs  Usage string for this field. @see console_autodoc
-   static void addProtectedField(const char*   in_pFieldname,
-      const U32     in_fieldType,
-      const dsize_t in_fieldOffset,
-      AbstractClassRep::SetDataNotify in_setDataFn,
-      AbstractClassRep::GetDataNotify in_getDataFn = &defaultProtectedGetFn,
-      AbstractClassRep::WriteDataNotify in_writeDataFn = &defaultProtectedWriteFn,
-      const char*   in_pFieldDocs = NULL);
-
-   /// Add a deprecated field.
-   ///
-   /// A deprecated field will always be undefined, even if you assign a value to it. This
-   /// is useful when you need to make sure that a field is not being used anymore.
-   static void addDepricatedField(const char *fieldName);
-
-   /// Remove a field.
-   ///
-   /// Sometimes, you just have to remove a field!
-   /// @returns True on success.
-   static bool removeField(const char* in_pFieldname);
-
-   /// @}
+    /// @name Fields
+    /// @{
+
+    /// Mark the beginning of a group of fields.
+    ///
+    /// This is used in the consoleDoc system.
+    /// @see console_autodoc
+    static void addGroup(const char*  in_pGroupname, const char* in_pGroupDocs = NULL);
+
+    /// Mark the end of a group of fields.
+    ///
+    /// This is used in the consoleDoc system.
+    /// @see console_autodoc
+    static void endGroup(const char*  in_pGroupname);
+
+    /// Register a complex field.
+    ///
+    /// @param  in_pFieldname     Name of the field.
+    /// @param  in_fieldType      Type of the field. @see ConsoleDynamicTypes
+    /// @param  in_fieldOffset    Offset to  the field from the start of the class; calculated using the Offset() macro.
+    /// @param  in_elementCount   Number of elements in this field. Arrays of elements are assumed to be contiguous in memory.
+    /// @param  in_table          An EnumTable, if this is an enumerated field.
+    /// @param  in_pFieldDocs     Usage string for this field. @see console_autodoc
+    static void addField(const char*   in_pFieldname,
+        const U32     in_fieldType,
+        const dsize_t in_fieldOffset,
+        const U32     in_elementCount = 1,
+        EnumTable *   in_table        = NULL,
+        const char*   in_pFieldDocs   = NULL);
+
+    /// Register a complex field with a write notify.
+    ///
+    /// @param  in_pFieldname     Name of the field.
+    /// @param  in_fieldType      Type of the field. @see ConsoleDynamicTypes
+    /// @param  in_fieldOffset    Offset to  the field from the start of the class; calculated using the Offset() macro.
+    /// @param  in_writeDataFn    This method will return whether the field should be written or not.
+    /// @param  in_elementCount   Number of elements in this field. Arrays of elements are assumed to be contiguous in memory.
+    /// @param  in_table          An EnumTable, if this is an enumerated field.
+    /// @param  in_pFieldDocs     Usage string for this field. @see console_autodoc
+    static void addField(const char*   in_pFieldname,
+        const U32     in_fieldType,
+        const dsize_t in_fieldOffset,
+        AbstractClassRep::WriteDataNotify in_writeDataFn,
+        const U32     in_elementCount = 1,
+        EnumTable *   in_table        = NULL,
+        const char*   in_pFieldDocs   = NULL);
+
+    /// Register a simple field.
+    ///
+    /// @param  in_pFieldname  Name of the field.
+    /// @param  in_fieldType   Type of the field. @see ConsoleDynamicTypes
+    /// @param  in_fieldOffset Offset to  the field from the start of the class; calculated using the Offset() macro.
+    /// @param  in_pFieldDocs  Usage string for this field. @see console_autodoc
+    static void addField(const char*   in_pFieldname,
+        const U32     in_fieldType,
+        const dsize_t in_fieldOffset,
+        const char*   in_pFieldDocs);
+
+
+    /// Register a simple field with a write notify.
+    ///
+    /// @param  in_pFieldname  Name of the field.
+    /// @param  in_fieldType   Type of the field. @see ConsoleDynamicTypes
+    /// @param  in_fieldOffset Offset to  the field from the start of the class; calculated using the Offset() macro.
+    /// @param  in_writeDataFn    This method will return whether the field should be written or not.
+    /// @param  in_pFieldDocs  Usage string for this field. @see console_autodoc
+    static void addField(const char*   in_pFieldname,
+        const U32     in_fieldType,
+        const dsize_t in_fieldOffset,
+        AbstractClassRep::WriteDataNotify in_writeDataFn,
+        const char*   in_pFieldDocs );
+
+    /// Register a validated field.
+    ///
+    /// A validated field is just like a normal field except that you can't
+    /// have it be an array, and that you give it a pointer to a ConsoleTypeValidator
+    /// subclass, which is then used to validate any value placed in it. Invalid
+    /// values are ignored and an error is printed to the console.
+    ///
+    /// @see addField
+    /// @see typeValidators.h
+    static void addFieldV(const char*   in_pFieldname,
+        const U32      in_fieldType,
+        const dsize_t  in_fieldOffset,
+        ConsoleTypeValidator *v,
+        const char *   in_pFieldDocs = NULL);
+
+    /// Register a complex protected field.
+    ///
+    /// @param  in_pFieldname     Name of the field.
+    /// @param  in_fieldType      Type of the field. @see ConsoleDynamicTypes
+    /// @param  in_fieldOffset    Offset to  the field from the start of the class; calculated using the Offset() macro.
+    /// @param  in_setDataFn      When this field gets set, it will call the callback provided. @see console_protected
+    /// @param  in_getDataFn      When this field is accessed for it's data, it will return the value of this function
+    /// @param  in_elementCount   Number of elements in this field. Arrays of elements are assumed to be contiguous in memory.
+    /// @param  in_table          An EnumTable, if this is an enumerated field.
+    /// @param  in_pFieldDocs     Usage string for this field. @see console_autodoc
+    static void addProtectedField(const char*   in_pFieldname,
+        const U32     in_fieldType,
+        const dsize_t in_fieldOffset,
+        AbstractClassRep::SetDataNotify in_setDataFn,
+        AbstractClassRep::GetDataNotify in_getDataFn = &defaultProtectedGetFn,
+        const U32     in_elementCount = 1,
+        EnumTable *   in_table        = NULL,
+        const char*   in_pFieldDocs   = NULL);
+
+    /// Register a complex protected field.
+    ///
+    /// @param  in_pFieldname     Name of the field.
+    /// @param  in_fieldType      Type of the field. @see ConsoleDynamicTypes
+    /// @param  in_fieldOffset    Offset to  the field from the start of the class; calculated using the Offset() macro.
+    /// @param  in_setDataFn      When this field gets set, it will call the callback provided. @see console_protected
+    /// @param  in_getDataFn      When this field is accessed for it's data, it will return the value of this function
+    /// @param  in_writeDataFn    This method will return whether the field should be written or not.
+    /// @param  in_elementCount   Number of elements in this field. Arrays of elements are assumed to be contiguous in memory.
+    /// @param  in_table          An EnumTable, if this is an enumerated field.
+    /// @param  in_pFieldDocs     Usage string for this field. @see console_autodoc
+    static void addProtectedField(const char*   in_pFieldname,
+        const U32     in_fieldType,
+        const dsize_t in_fieldOffset,
+        AbstractClassRep::SetDataNotify in_setDataFn,
+        AbstractClassRep::GetDataNotify in_getDataFn = &defaultProtectedGetFn,
+        AbstractClassRep::WriteDataNotify in_writeDataFn = &defaultProtectedWriteFn,
+        const U32     in_elementCount = 1,
+        EnumTable *   in_table        = NULL,
+        const char*   in_pFieldDocs   = NULL);
+
+    /// Register a simple protected field.
+    ///
+    /// @param  in_pFieldname  Name of the field.
+    /// @param  in_fieldType   Type of the field. @see ConsoleDynamicTypes
+    /// @param  in_fieldOffset Offset to  the field from the start of the class; calculated using the Offset() macro.
+    /// @param  in_setDataFn   When this field gets set, it will call the callback provided. @see console_protected
+    /// @param  in_getDataFn   When this field is accessed for it's data, it will return the value of this function
+    /// @param  in_pFieldDocs  Usage string for this field. @see console_autodoc
+    static void addProtectedField(const char*   in_pFieldname,
+        const U32     in_fieldType,
+        const dsize_t in_fieldOffset,
+        AbstractClassRep::SetDataNotify in_setDataFn,
+        AbstractClassRep::GetDataNotify in_getDataFn = &defaultProtectedGetFn,
+        const char*   in_pFieldDocs = NULL);
+
+    /// Register a simple protected field.
+    ///
+    /// @param  in_pFieldname  Name of the field.
+    /// @param  in_fieldType   Type of the field. @see ConsoleDynamicTypes
+    /// @param  in_fieldOffset Offset to  the field from the start of the class; calculated using the Offset() macro.
+    /// @param  in_setDataFn   When this field gets set, it will call the callback provided. @see console_protected
+    /// @param  in_getDataFn   When this field is accessed for it's data, it will return the value of this function
+    /// @param  in_writeDataFn    This method will return whether the field should be written or not.
+    /// @param  in_pFieldDocs  Usage string for this field. @see console_autodoc
+    static void addProtectedField(const char*   in_pFieldname,
+        const U32     in_fieldType,
+        const dsize_t in_fieldOffset,
+        AbstractClassRep::SetDataNotify in_setDataFn,
+        AbstractClassRep::GetDataNotify in_getDataFn = &defaultProtectedGetFn,
+        AbstractClassRep::WriteDataNotify in_writeDataFn = &defaultProtectedWriteFn,
+        const char*   in_pFieldDocs = NULL);
+
+    /// Add a deprecated field.
+    ///
+    /// A deprecated field will always be undefined, even if you assign a value to it. This
+    /// is useful when you need to make sure that a field is not being used anymore.
+    static void addDepricatedField(const char *fieldName);
+
+    /// Remove a field.
+    ///
+    /// Sometimes, you just have to remove a field!
+    /// @returns True on success.
+    static bool removeField(const char* in_pFieldname);
+
+    /// @}
 public:
-   /// Register dynamic fields in a subclass of ConsoleObject.
-   ///
-   /// @see addField(), addFieldV(), addDepricatedField(), addGroup(), endGroup()
-   static void initPersistFields();
-
-   /// Register global constant variables and do other one-time initialization tasks in
-   /// a subclass of ConsoleObject.
-   ///
-   /// @deprecated You should use ConsoleMethod and ConsoleFunction, not this, to
-   ///             register methods or commands.
-   /// @see console
-   static void consoleInit();
-
-   /// @name Field List
-   /// @{
-
-   /// Get a list of all the fields. This information cannot be modified.
-   const AbstractClassRep::FieldList& getFieldList() const;
-
-   /// Get a list of all the fields, set up so we can modify them.
-   ///
-   /// @note This is a bad trick to pull if you aren't very careful,
-   ///       since you can blast field data!
-   AbstractClassRep::FieldList& getModifiableFieldList();
-
-   /// Get a handle to a boolean telling us if we expanded the dynamic group.
-   ///
-   /// @see GuiInspector::Inspect()
-   bool& getDynamicGroupExpand();
-   /// @}
-
-   /// @name ConsoleObject Implementation
-   ///
-   /// These functions are implemented in every subclass of
-   /// ConsoleObject by an IMPLEMENT_CONOBJECT or IMPLEMENT_CO_* macro.
-   /// @{
-
-   /// Get the abstract class information for this class.
-   static AbstractClassRep *getStaticClassRep() { return NULL; }
-
-   /// Get the abstract class information for this class's superclass.
-   static AbstractClassRep *getParentStaticClassRep() { return NULL; }
-
-   /// Get our network-layer class id.
-   ///
-   /// @param  netClassGroup  The net class for which we want our ID.
-   /// @see
-   S32 getClassId(U32 netClassGroup) const;
-
-   /// Get our compiler and platform independent class name.
-   ///
-   /// @note This name can be used to instantiate another instance using create()
-   const char *getClassName() const;
-
-   /// @}
+    /// Register dynamic fields in a subclass of ConsoleObject.
+    ///
+    /// @see addField(), addFieldV(), addDepricatedField(), addGroup(), endGroup()
+    static void initPersistFields();
+
+    /// Register global constant variables and do other one-time initialization tasks in
+    /// a subclass of ConsoleObject.
+    ///
+    /// @deprecated You should use ConsoleMethod and ConsoleFunction, not this, to
+    ///             register methods or commands.
+    /// @see console
+    static void consoleInit();
+
+    /// @name Field List
+    /// @{
+
+    /// Get a list of all the fields. This information cannot be modified.
+    const AbstractClassRep::FieldList& getFieldList() const;
+
+    /// Get a list of all the fields, set up so we can modify them.
+    ///
+    /// @note This is a bad trick to pull if you aren't very careful,
+    ///       since you can blast field data!
+    AbstractClassRep::FieldList& getModifiableFieldList();
+
+    /// Get a handle to a boolean telling us if we expanded the dynamic group.
+    ///
+    /// @see GuiInspector::Inspect()
+    bool& getDynamicGroupExpand();
+    /// @}
+
+    /// @name ConsoleObject Implementation
+    ///
+    /// These functions are implemented in every subclass of
+    /// ConsoleObject by an IMPLEMENT_CONOBJECT or IMPLEMENT_CO_* macro.
+    /// @{
+
+    /// Get the abstract class information for this class.
+    static AbstractClassRep *getStaticClassRep() { return NULL; }
+
+    /// Get the abstract class information for this class's superclass.
+    static AbstractClassRep *getParentStaticClassRep() { return NULL; }
+
+    /// Get our network-layer class id.
+    ///
+    /// @param  netClassGroup  The net class for which we want our ID.
+    /// @see
+    S32 getClassId(U32 netClassGroup) const;
+
+    /// Get our compiler and platform independent class name.
+    ///
+    /// @note This name can be used to instantiate another instance using create()
+    const char *getClassName() const;
+
+    /// @}
 };
 
-// Deprecated? -pw
+//-----------------------------------------------------------------------------
+
 #define addNamedField(fieldName,type,className) addField(#fieldName, type, Offset(fieldName,className))
 #define addNamedFieldV(fieldName,type,className, validator) addFieldV(#fieldName, type, Offset(fieldName,className), validator)
 
-//------------------------------------------------------------------------------
-//-------------------------------------- Inlines
-//
+//-----------------------------------------------------------------------------
+
 inline S32 ConsoleObject::getClassId(U32 netClassGroup) const
 {
-   AssertFatal(getClassRep() != NULL,"Cannot get tag from non-declared dynamic class!");
-   return getClassRep()->getClassId(netClassGroup);
+    AssertFatal(getClassRep() != NULL,"Cannot get tag from non-declared dynamic class!");
+    return getClassRep()->getClassId(netClassGroup);
 }
 
+//-----------------------------------------------------------------------------
+
 inline const char * ConsoleObject::getClassName() const
 {
-   AssertFatal(getClassRep() != NULL,
-      "Cannot get tag from non-declared dynamic class");
-   return getClassRep()->getClassName();
+    AssertFatal(getClassRep() != NULL,
+        "Cannot get tag from non-declared dynamic class");
+    return getClassRep()->getClassName();
 }
 
+//-----------------------------------------------------------------------------
+
 inline const AbstractClassRep::Field * ConsoleObject::findField(StringTableEntry name) const
 {
-   AssertFatal(getClassRep() != NULL,
-      avar("Cannot get field '%s' from non-declared dynamic class.", name));
-   return getClassRep()->findField(name);
+    AssertFatal(getClassRep() != NULL,
+        avar("Cannot get field '%s' from non-declared dynamic class.", name));
+    return getClassRep()->findField(name);
 }
 
+//-----------------------------------------------------------------------------
+
 inline bool ConsoleObject::setField(const char *fieldName, const char *value)
 {
-   //sanity check
-   if ((! fieldName) || (! fieldName[0]) || (! value))
-      return false;
+    //sanity check
+    if ((! fieldName) || (! fieldName[0]) || (! value))
+        return false;
 
-   if (! getClassRep())
-      return false;
+    if (! getClassRep())
+        return false;
 
-   const AbstractClassRep::Field *myField = getClassRep()->findField(StringTable->insert(fieldName));
+    const AbstractClassRep::Field *myField = getClassRep()->findField(StringTable->insert(fieldName));
 
-   if (! myField)
-      return false;
+    if (! myField)
+        return false;
 
-   Con::setData(
-      myField->type,
-      (void *) (((const char *)(this)) + myField->offset),
-      0,
-      1,
-      &value,
-      myField->table,
-      myField->flag);
+    Con::setData(
+        myField->type,
+        (void *) (((const char *)(this)) + myField->offset),
+        0,
+        1,
+        &value,
+        myField->table,
+        myField->flag);
 
-   return true;
+    return true;
 }
 
+//-----------------------------------------------------------------------------
+
 inline ConsoleObject* ConsoleObject::create(const char* in_pClassName)
 {
-   return AbstractClassRep::create(in_pClassName);
+    return AbstractClassRep::create(in_pClassName);
 }
 
+//-----------------------------------------------------------------------------
+
 inline ConsoleObject* ConsoleObject::create(const U32 groupId, const U32 typeId, const U32 in_classId)
 {
-   return AbstractClassRep::create(groupId, typeId, in_classId);
+    return AbstractClassRep::create(groupId, typeId, in_classId);
 }
 
+//-----------------------------------------------------------------------------
+
 inline const AbstractClassRep::FieldList& ConsoleObject::getFieldList() const
 {
-   return getClassRep()->mFieldList;
+    return getClassRep()->mFieldList;
 }
 
+//-----------------------------------------------------------------------------
+
 inline AbstractClassRep::FieldList& ConsoleObject::getModifiableFieldList()
 {
-   return getClassRep()->mFieldList;
+    return getClassRep()->mFieldList;
 }
 
+//-----------------------------------------------------------------------------
+
 inline bool& ConsoleObject::getDynamicGroupExpand()
 {
-   return getClassRep()->mDynamicGroupExpand;
+    return getClassRep()->mDynamicGroupExpand;
 }
 
-/// @name ConsoleObject Macros
-/// @{
-
-#define DECLARE_CONOBJECT(className)                    \
-   static ConcreteClassRep<className> dynClassRep;      \
-   static AbstractClassRep* getParentStaticClassRep();  \
-   static AbstractClassRep* getContainerChildStaticClassRep();      \
-   static AbstractClassRep* getStaticClassRep();        \
-   virtual AbstractClassRep* getClassRep() const
+//-----------------------------------------------------------------------------
 
-#define IMPLEMENT_CONOBJECT(className)                                                              \
-   AbstractClassRep* className::getClassRep() const { return &className::dynClassRep; }             \
-   AbstractClassRep* className::getStaticClassRep() { return &dynClassRep; }                        \
-   AbstractClassRep* className::getParentStaticClassRep() { return Parent::getStaticClassRep(); }   \
-   AbstractClassRep* className::getContainerChildStaticClassRep() { return NULL; }                  \
-   ConcreteClassRep<className> className::dynClassRep(#className, 0, -1, 0, className::getParentStaticClassRep())
+#define DECLARE_CONOBJECT(className)                                                                                \
+    static ConcreteClassRep<className> dynClassRep;                                                                 \
+    static AbstractClassRep* getParentStaticClassRep();                                                             \
+    static AbstractClassRep* getContainerChildStaticClassRep();                                                     \
+    static AbstractClassRep* getStaticClassRep();                                                                   \
+    static AbstractClassRep::WriteCustomTamlSchema className::getStaticWriteCustomTamlSchema();                     \
+    virtual AbstractClassRep* getClassRep() const
+
+#define IMPLEMENT_CONOBJECT(className)                                                                              \
+    AbstractClassRep* className::getClassRep() const { return &className::dynClassRep; }                            \
+    AbstractClassRep* className::getStaticClassRep() { return &dynClassRep; }                                       \
+    AbstractClassRep* className::getParentStaticClassRep() { return Parent::getStaticClassRep(); }                  \
+    AbstractClassRep* className::getContainerChildStaticClassRep() { return NULL; }                                 \
+    AbstractClassRep::WriteCustomTamlSchema className::getStaticWriteCustomTamlSchema() { return NULL; }            \
+    ConcreteClassRep<className> className::dynClassRep(#className, 0, -1, 0, className::getParentStaticClassRep())
 
 #define IMPLEMENT_CONOBJECT_CHILDREN(className)                                                                     \
-   AbstractClassRep* className::getClassRep() const { return &className::dynClassRep; }                             \
-   AbstractClassRep* className::getStaticClassRep() { return &dynClassRep; }                                        \
-   AbstractClassRep* className::getParentStaticClassRep() { return Parent::getStaticClassRep(); }                   \
-   AbstractClassRep* className::getContainerChildStaticClassRep() { return Children::getStaticClassRep(); }         \
-   ConcreteClassRep<className> className::dynClassRep(#className, 0, -1, 0, className::getParentStaticClassRep())
-
-#define IMPLEMENT_CO_NETOBJECT_V1(className)                    \
-   AbstractClassRep* className::getClassRep() const { return &className::dynClassRep; }                 \
-   AbstractClassRep* className::getStaticClassRep() { return &dynClassRep; }                            \
-   AbstractClassRep* className::getParentStaticClassRep() { return Parent::getStaticClassRep(); }       \
-   AbstractClassRep* className::getContainerChildStaticClassRep() { return NULL; }                      \
-   ConcreteClassRep<className> className::dynClassRep(#className, NetClassGroupGameMask, NetClassTypeObject, 0, className::getParentStaticClassRep())
-
-#define IMPLEMENT_CO_DATABLOCK_V1(className)                                                            \
-   AbstractClassRep* className::getClassRep() const { return &className::dynClassRep; }                 \
-   AbstractClassRep* className::getStaticClassRep() { return &dynClassRep; }                            \
-   AbstractClassRep* className::getParentStaticClassRep() { return Parent::getStaticClassRep(); }       \
-   AbstractClassRep* className::getContainerChildStaticClassRep() {return NULL; }                       \
-   ConcreteClassRep<className> className::dynClassRep(#className, NetClassGroupGameMask, NetClassTypeDataBlock, 0, className::getParentStaticClassRep())
-
-/// @}
-
-//------------------------------------------------------------------------------
+    AbstractClassRep* className::getClassRep() const { return &className::dynClassRep; }                            \
+    AbstractClassRep* className::getStaticClassRep() { return &dynClassRep; }                                       \
+    AbstractClassRep* className::getParentStaticClassRep() { return Parent::getStaticClassRep(); }                  \
+    AbstractClassRep* className::getContainerChildStaticClassRep() { return Children::getStaticClassRep(); }        \
+    AbstractClassRep::WriteCustomTamlSchema className::getStaticWriteCustomTamlSchema() { return NULL; }            \
+    ConcreteClassRep<className> className::dynClassRep(#className, 0, -1, 0, className::getParentStaticClassRep())
+
+#define IMPLEMENT_CONOBJECT_SCHEMA(className, schema)                                                               \
+    AbstractClassRep* className::getClassRep() const { return &className::dynClassRep; }                            \
+    AbstractClassRep* className::getStaticClassRep() { return &dynClassRep; }                                       \
+    AbstractClassRep* className::getParentStaticClassRep() { return Parent::getStaticClassRep(); }                  \
+    AbstractClassRep* className::getContainerChildStaticClassRep() { return NULL; }                                 \
+    AbstractClassRep::WriteCustomTamlSchema className::getStaticWriteCustomTamlSchema() { return schema; }          \
+    ConcreteClassRep<className> className::dynClassRep(#className, 0, -1, 0, className::getParentStaticClassRep())
+
+#define IMPLEMENT_CONOBJECT_CHILDREN_SCHEMA(className, schema)                                                      \
+    AbstractClassRep* className::getClassRep() const { return &className::dynClassRep; }                            \
+    AbstractClassRep* className::getStaticClassRep() { return &dynClassRep; }                                       \
+    AbstractClassRep* className::getParentStaticClassRep() { return Parent::getStaticClassRep(); }                  \
+    AbstractClassRep* className::getContainerChildStaticClassRep() { return Children::getStaticClassRep(); }        \
+    AbstractClassRep::WriteCustomTamlSchema className::getStaticWriteCustomTamlSchema() { return schema; }          \
+    ConcreteClassRep<className> className::dynClassRep(#className, 0, -1, 0, className::getParentStaticClassRep())
+
+#define IMPLEMENT_CO_NETOBJECT_V1(className)                                                                        \
+    AbstractClassRep* className::getClassRep() const { return &className::dynClassRep; }                            \
+    AbstractClassRep* className::getStaticClassRep() { return &dynClassRep; }                                       \
+    AbstractClassRep* className::getParentStaticClassRep() { return Parent::getStaticClassRep(); }                  \
+    AbstractClassRep* className::getContainerChildStaticClassRep() { return NULL; }                                 \
+    AbstractClassRep::WriteCustomTamlSchema className::getStaticWriteCustomTamlSchema() { return NULL; }            \
+    ConcreteClassRep<className> className::dynClassRep(#className, NetClassGroupGameMask, NetClassTypeObject, 0, className::getParentStaticClassRep())
+
+#define IMPLEMENT_CO_DATABLOCK_V1(className)                                                                        \
+    AbstractClassRep* className::getClassRep() const { return &className::dynClassRep; }                            \
+    AbstractClassRep* className::getStaticClassRep() { return &dynClassRep; }                                       \
+    AbstractClassRep* className::getParentStaticClassRep() { return Parent::getStaticClassRep(); }                  \
+    AbstractClassRep* className::getContainerChildStaticClassRep() {return NULL; }                                  \
+    AbstractClassRep::WriteCustomTamlSchema className::getStaticWriteCustomTamlSchema() { return NULL; }            \
+    ConcreteClassRep<className> className::dynClassRep(#className, NetClassGroupGameMask, NetClassTypeDataBlock, 0, className::getParentStaticClassRep())
+
+//-----------------------------------------------------------------------------
 
 inline bool defaultProtectedSetFn( void *obj, const char *data )
 {
-   return true;
+    return true;
 }
 
+//-----------------------------------------------------------------------------
+
 inline const char *defaultProtectedGetFn( void *obj, const char *data )
 {
-   return data;
+    return data;
 }
 
+//-----------------------------------------------------------------------------
+
 inline bool defaultProtectedWriteFn( void* obj, StringTableEntry pFieldName )
 {
     return true;
 }
 
+//-----------------------------------------------------------------------------
+
 inline bool defaultProtectedNotSetFn(void* obj, const char* data)
 {
     return false;
 }
 
+//-----------------------------------------------------------------------------
+
 inline bool defaultProtectedNotWriteFn( void* obj, StringTableEntry pFieldName )
 {
     return false;

File diff suppressed because it is too large
+ 573 - 567
engine/source/network/netConnection.h


+ 76 - 35
engine/source/persistence/taml/taml.cc

@@ -859,7 +859,28 @@ bool Taml::generateTamlSchema( const char* pFilename )
     // Reset scratch state.
     char buffer[1024];
 
-    // Generate the type elements.
+    // *************************************************************
+    // Generate console type elements.
+    // *************************************************************
+
+    // Vector2.
+    TiXmlComment* pVector2Comment = new TiXmlComment( "Vector2 Console Type" );
+    pSchemaElement->LinkEndChild( pVector2Comment );
+    TiXmlElement* pVector2TypeElement = new TiXmlElement( "xs:simpleType" );
+    pVector2TypeElement->SetAttribute( "name", "Vector2_ConsoleType" );
+    pSchemaElement->LinkEndChild( pVector2TypeElement );
+    TiXmlElement* pVector2ElementA = new TiXmlElement( "xs:restriction" );
+    pVector2ElementA->SetAttribute( "base", "xs:string" );
+    pVector2TypeElement->LinkEndChild( pVector2ElementA );
+    TiXmlElement* pVector2ElementB = new TiXmlElement( "xs:pattern" );
+    pVector2ElementB->SetAttribute( "value", "([-]?(\\b[0-9]+)?\\.)?[0-9]+\\b ([-]?(\\b[0-9]+)?\\.)?[0-9]+\\b" );   
+    pVector2ElementA->LinkEndChild( pVector2ElementB );
+
+    // *************************************************************
+    // Generate engine type elements.
+    // *************************************************************
+
+    // Generate the engine type elements.
     TiXmlComment* pComment = new TiXmlComment( "Type Elements" );
     pSchemaElement->LinkEndChild( pComment );
     for ( AbstractClassRep* pType = pRootType; pType != NULL; pType = pType->getNextClass() )
@@ -872,7 +893,9 @@ bool Taml::generateTamlSchema( const char* pFilename )
         pSchemaElement->LinkEndChild( pTypeElement );
     }
 
-    // Generate the complex types.
+    // *************************************************************
+    // Generate the engine complex types.
+    // *************************************************************
     for ( AbstractClassRep* pType = pRootType; pType != NULL; pType = pType->getNextClass() )
     {
         // Add complex type comment.
@@ -884,53 +907,54 @@ bool Taml::generateTamlSchema( const char* pFilename )
         TiXmlElement* pComplexTypeElement = new TiXmlElement( "xs:complexType" );
         dSprintf( buffer, sizeof(buffer), "%s_Type", pType->getClassName() );
         pComplexTypeElement->SetAttribute( "name", buffer );
-        pComplexTypeElement->SetAttribute( "mixed", "true" );
         pSchemaElement->LinkEndChild( pComplexTypeElement );
 
+        // Add sequence.
+        TiXmlElement* pSequenceElement = new TiXmlElement( "xs:sequence" );
+        pComplexTypeElement->LinkEndChild( pSequenceElement );
+
         // Fetch container child class.
         AbstractClassRep* pContainerChildClass = pType->getContainerChildClass( false );
 
         // Is the type allowed children?
         if ( pContainerChildClass != NULL )
         {
-            // Yes, so add group comment.
-            dSprintf( buffer, sizeof(buffer), " %s Children Group ", pType->getClassName() );
-            TiXmlComment* pComment = new TiXmlComment( buffer );
-            pSchemaElement->LinkEndChild( pComment );
-
-            // Format the group name.
-            dSprintf( buffer, sizeof(buffer), "%s_ChildGroup", pType->getClassName() );
-                
-            // Add group.
-            TiXmlElement* pGroupElement = new TiXmlElement( "xs:group" );
-            pGroupElement->SetAttribute( "name", buffer );
-            pSchemaElement->LinkEndChild( pGroupElement );
-            TiXmlElement* pGroupChoiceElement = new TiXmlElement( "xs:choice" );
-            pGroupElement->LinkEndChild( pGroupChoiceElement );
-
-            // Add group reference.
-            TiXmlElement* pGroupReferenceElement = new TiXmlElement( "xs:group" );
-            pGroupReferenceElement->SetAttribute( "ref", buffer );
-            pGroupReferenceElement->SetAttribute( "minOccurs", "0" );
-            pGroupReferenceElement->SetAttribute( "maxOccurs", "unbounded" );
-            pComplexTypeElement->LinkEndChild( pGroupReferenceElement );
-
-            // Add group members.
-            for ( AbstractClassRep* pGroupType = pRootType; pGroupType != NULL; pGroupType = pGroupType->getNextClass() )
+            // Yes, so add choice element.
+            TiXmlElement* pChoiceElement = new TiXmlElement( "xs:choice" );
+            pChoiceElement->SetAttribute( "minOccurs", 0 );
+            pChoiceElement->SetAttribute( "maxOccurs", "unbounded" );
+            pSequenceElement->LinkEndChild( pChoiceElement );
+
+            // Add choice members.
+            for ( AbstractClassRep* pChoiceType = pRootType; pChoiceType != NULL; pChoiceType = pChoiceType->getNextClass() )
             {
                 // Skip if not derived from the container child class.
-                if ( !pGroupType->isClass( pContainerChildClass ) )
+                if ( !pChoiceType->isClass( pContainerChildClass ) )
                     continue;
 
-                // Add group member.
-                TiXmlElement* pGroupMemberElement = new TiXmlElement( "xs:element" );
-                pGroupMemberElement->SetAttribute( "name", pGroupType->getClassName() );
-                dSprintf( buffer, sizeof(buffer), "%s_Type", pGroupType->getClassName() );
-                pGroupMemberElement->SetAttribute( "type", buffer );
-                pGroupChoiceElement->LinkEndChild( pGroupMemberElement );
+                // Add choice member.
+                TiXmlElement* pChoiceMemberElement = new TiXmlElement( "xs:element" );
+                pChoiceMemberElement->SetAttribute( "name", pChoiceType->getClassName() );
+                dSprintf( buffer, sizeof(buffer), "%s_Type", pChoiceType->getClassName() );
+                pChoiceMemberElement->SetAttribute( "type", buffer );
+                pChoiceElement->LinkEndChild( pChoiceMemberElement );
             }
         }
 
+        // Generate the custom Taml schema.
+        for ( AbstractClassRep* pCustomSchemaType = pType; pCustomSchemaType != NULL; pCustomSchemaType = pCustomSchemaType->getParentClass() )
+        {
+            // Fetch the types custom TAML schema function.
+            AbstractClassRep::WriteCustomTamlSchema customSchemaFn = pCustomSchemaType->getCustomTamlSchema();
+
+            // Skip if no function avilable.
+            if ( customSchemaFn == NULL )
+                continue;
+
+            // Call schema generation function.
+            customSchemaFn( pType, pSequenceElement );
+        }
+
         // Iterate static fields.
         const AbstractClassRep::FieldList& fields = pType->mFieldList;
         for( AbstractClassRep::FieldList::const_iterator fieldItr = fields.begin(); fieldItr != fields.end(); ++fieldItr )
@@ -947,7 +971,24 @@ bool Taml::generateTamlSchema( const char* pFilename )
             // Add attribute element.
             TiXmlElement* pAttributeElement = new TiXmlElement( "xs:attribute" );
             pAttributeElement->SetAttribute( "name", field.pFieldname );
-            pAttributeElement->SetAttribute( "type", "xs:string" );
+
+            // Handle the console type appropriately.
+            const S32 fieldType = (S32)field.type;
+            char* pFieldTypeDescription = "xs:string";
+            if( fieldType == TypeF32 )
+            {
+                pFieldTypeDescription = "xs:float";
+            }
+            else if( fieldType == TypeS8 || fieldType == TypeS32 )
+            {
+                pFieldTypeDescription = "xs:int";
+            }
+            else if( fieldType == TypeBool || fieldType == TypeFlag )
+            {
+                pFieldTypeDescription = "xs:boolean";
+            }
+            pAttributeElement->SetAttribute( "type", pFieldTypeDescription );
+
             pAttributeElement->SetAttribute( "use", "optional" );
             pComplexTypeElement->LinkEndChild( pAttributeElement );
         }

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