mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-29 00:05:40 +00:00
Merge remote-tracking branch 'devhead/Preview4_0' into tsneo
# Conflicts: # Templates/BaseGame/game/data/ui/guis/loadingGui.gui # Templates/BaseGame/game/data/ui/guis/mainMenu.gui # Templates/BaseGame/game/tools/MainEditor/guis/MainEditorWindow.gui # Templates/BaseGame/game/tools/assetBrowser/guis/assetPreviewButtonsTemplate.gui # Templates/BaseGame/game/tools/forestEditor/brushes.tscript
This commit is contained in:
commit
717c7acca9
2266 changed files with 48780 additions and 26034 deletions
|
|
@ -34,7 +34,7 @@ namespace VPersistence
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
template <>
|
||||
bool write( TiXmlElement *pElement, VController *pObject )
|
||||
bool write( tinyxml2::XMLElement *pElement, VController *pObject )
|
||||
{
|
||||
// Write Properties.
|
||||
if ( !writeProperties( pElement, pObject ) )
|
||||
|
|
@ -53,7 +53,7 @@ namespace VPersistence
|
|||
}
|
||||
|
||||
template <>
|
||||
bool read( TiXmlElement *pElement, VController *pObject )
|
||||
bool read( tinyxml2::XMLElement *pElement, VController *pObject )
|
||||
{
|
||||
// Read Properties.
|
||||
if ( !readProperties( pElement, pObject ) )
|
||||
|
|
@ -87,10 +87,10 @@ namespace VPersistence
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
template <>
|
||||
bool write( TiXmlElement *pElement, VObject *pObject )
|
||||
bool write( tinyxml2::XMLElement *pElement, VObject *pObject )
|
||||
{
|
||||
// Create Element.
|
||||
TiXmlElement *objectElement = new TiXmlElement( "VObject" );
|
||||
tinyxml2::XMLElement *objectElement = pElement->GetDocument()->NewElement( "VObject" );
|
||||
pElement->LinkEndChild( objectElement );
|
||||
|
||||
// Attributes.
|
||||
|
|
@ -107,7 +107,7 @@ namespace VPersistence
|
|||
}
|
||||
|
||||
template <>
|
||||
bool read( TiXmlElement *pElement, VObject *pObject )
|
||||
bool read( tinyxml2::XMLElement *pElement, VObject *pObject )
|
||||
{
|
||||
// Read Properties.
|
||||
if ( !readProperties( pElement, pObject ) )
|
||||
|
|
@ -134,4 +134,4 @@ namespace VPersistence
|
|||
// Valid Read.
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
#define _VT_VPERSISTENCE_H_
|
||||
|
||||
#ifndef TINYXML_INCLUDED
|
||||
#include "tinyxml/tinyxml.h"
|
||||
#include "tinyxml/tinyxml2.h"
|
||||
#endif
|
||||
|
||||
#ifndef _SIMOBJECT_H_
|
||||
|
|
@ -34,6 +34,7 @@
|
|||
#ifndef _VT_VOBJECT_H_
|
||||
#include "Verve/Core/VObject.h"
|
||||
#endif
|
||||
#include "persistence/taml/fsTinyXml.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
|
@ -48,17 +49,17 @@ namespace VPersistence
|
|||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
template <class T> bool write( TiXmlElement *pElement, T *pObject );
|
||||
template <class T> bool write( tinyxml2::XMLElement *pElement, T *pObject );
|
||||
|
||||
template <class T> bool writeFile( const char* pFileName, T *pObject )
|
||||
{
|
||||
// Create Doc.
|
||||
TiXmlDocument xmlDocument;
|
||||
TiXmlDeclaration *xmlDeclaration = new TiXmlDeclaration( "1.0", "", "" );
|
||||
VfsXMLDocument xmlDocument;
|
||||
tinyxml2::XMLDeclaration *xmlDeclaration = xmlDocument.NewDeclaration();
|
||||
xmlDocument.LinkEndChild( xmlDeclaration );
|
||||
|
||||
// Create Root.
|
||||
TiXmlElement *xmlRoot = new TiXmlElement( "VerveControllerSequence" );
|
||||
tinyxml2::XMLElement *xmlRoot = xmlDocument.NewElement( "VerveControllerSequence" );
|
||||
xmlDocument.LinkEndChild( xmlRoot );
|
||||
|
||||
// Write Version.
|
||||
|
|
@ -76,13 +77,13 @@ namespace VPersistence
|
|||
};
|
||||
|
||||
|
||||
template <class T> bool writeProperties( TiXmlElement *pElement, T *pObject )
|
||||
template <class T> bool writeProperties( tinyxml2::XMLElement *pElement, T *pObject )
|
||||
{
|
||||
const AbstractClassRep::FieldList &fieldList = pObject->getFieldList();
|
||||
const AbstractClassRep::Field *field = NULL;
|
||||
|
||||
// Create Property Root.
|
||||
TiXmlElement *propertyRoot = new TiXmlElement( "Properties" );
|
||||
tinyxml2::XMLElement *propertyRoot = pElement->GetDocument()->NewElement( "Properties" );
|
||||
pElement->LinkEndChild( propertyRoot );
|
||||
|
||||
const S32 fieldCount = fieldList.size();
|
||||
|
|
@ -111,10 +112,10 @@ namespace VPersistence
|
|||
if ( fieldValue )
|
||||
{
|
||||
// Create Element.
|
||||
TiXmlElement *propertyElement = new TiXmlElement( fieldName );
|
||||
tinyxml2::XMLElement *propertyElement = pElement->GetDocument()->NewElement( fieldName );
|
||||
|
||||
// Apply Value.
|
||||
propertyElement->InsertEndChild( TiXmlText( fieldValue ) );
|
||||
propertyElement->InsertNewText( fieldValue );
|
||||
|
||||
// Add.
|
||||
propertyRoot->LinkEndChild( propertyElement );
|
||||
|
|
@ -125,7 +126,7 @@ namespace VPersistence
|
|||
return true;
|
||||
};
|
||||
|
||||
template <class T> bool writeObjects( TiXmlElement *pElement, T *pObject )
|
||||
template <class T> bool writeObjects( tinyxml2::XMLElement *pElement, T *pObject )
|
||||
{
|
||||
for ( ITreeNode *node = pObject->mChildNode; node != NULL; node = node->mSiblingNextNode )
|
||||
{
|
||||
|
|
@ -143,18 +144,18 @@ namespace VPersistence
|
|||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
template <class T> bool read( TiXmlElement *pElement, T *pObject );
|
||||
template <class T> bool read( tinyxml2::XMLElement *pElement, T *pObject );
|
||||
|
||||
template <class T> bool readFile( const char* pFileName, T *pObject )
|
||||
{
|
||||
TiXmlDocument xmlDocument;
|
||||
VfsXMLDocument xmlDocument;
|
||||
if ( !xmlDocument.LoadFile( pFileName ) )
|
||||
{
|
||||
Con::errorf( "VPersistence::readFile() - Unable to load file '%s'.", pFileName );
|
||||
return false;
|
||||
}
|
||||
|
||||
TiXmlElement *rootElement = xmlDocument.RootElement();
|
||||
tinyxml2::XMLElement *rootElement = xmlDocument.RootElement();
|
||||
if ( !rootElement )
|
||||
{
|
||||
Con::errorf( "VPersistence::readFile() - Invalid Document '%s'.", pFileName );
|
||||
|
|
@ -179,12 +180,12 @@ namespace VPersistence
|
|||
return true;
|
||||
};
|
||||
|
||||
template <class T> bool readProperties( TiXmlElement *pElement, T *pObject )
|
||||
template <class T> bool readProperties( tinyxml2::XMLElement *pElement, T *pObject )
|
||||
{
|
||||
TiXmlElement *propertyRoot = pElement->FirstChildElement( "Properties" );
|
||||
tinyxml2::XMLElement *propertyRoot = pElement->FirstChildElement( "Properties" );
|
||||
if ( propertyRoot )
|
||||
{
|
||||
for ( TiXmlElement *child = propertyRoot->FirstChildElement(); child != NULL; child = child->NextSiblingElement() )
|
||||
for ( tinyxml2::XMLElement *child = propertyRoot->FirstChildElement(); child != NULL; child = child->NextSiblingElement() )
|
||||
{
|
||||
// Get Field Data.
|
||||
const char *fieldName = child->Value();
|
||||
|
|
@ -211,9 +212,9 @@ namespace VPersistence
|
|||
return true;
|
||||
};
|
||||
|
||||
template <class T> bool readObjects( TiXmlElement *pElement, T *pObject )
|
||||
template <class T> bool readObjects( tinyxml2::XMLElement *pElement, T *pObject )
|
||||
{
|
||||
for ( TiXmlElement *child = pElement->FirstChildElement( "VObject" ); child != NULL; child = child->NextSiblingElement( "VObject" ) )
|
||||
for ( tinyxml2::XMLElement *child = pElement->FirstChildElement( "VObject" ); child != NULL; child = child->NextSiblingElement( "VObject" ) )
|
||||
{
|
||||
// Get Object Type.
|
||||
const char *type = child->Attribute( "Type" );
|
||||
|
|
|
|||
|
|
@ -606,10 +606,10 @@ void VController::sort( void )
|
|||
// Write the DataTable out to a TinyXML document.
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
bool VController::writeDataTable( TiXmlElement *pElement )
|
||||
bool VController::writeDataTable( tinyxml2::XMLElement *pElement )
|
||||
{
|
||||
// Create Data Table Root.
|
||||
TiXmlElement *dataTableRoot = new TiXmlElement( "DataTable" );
|
||||
tinyxml2::XMLElement *dataTableRoot = pElement->GetDocument()->NewElement( "DataTable" );
|
||||
pElement->LinkEndChild( dataTableRoot );
|
||||
|
||||
for ( VDataTable::VDataMap::Iterator itr = mDataTable.mDataMap.begin(); itr != mDataTable.mDataMap.end(); ++itr )
|
||||
|
|
@ -618,11 +618,11 @@ bool VController::writeDataTable( TiXmlElement *pElement )
|
|||
VDataTable::sDataItem *data = &itr->value;
|
||||
|
||||
// Create Element.
|
||||
TiXmlElement *dataElement = new TiXmlElement( "DataItem" );
|
||||
tinyxml2::XMLElement* dataElement = pElement->GetDocument()->NewElement( "DataItem" );
|
||||
|
||||
// Apply Attributes.
|
||||
dataElement->SetAttribute( "Type", VDataTable::getDataTypeDescription( data->Type ) );
|
||||
dataElement->SetAttribute( "Name", data->FieldName );
|
||||
dataElement->SetAttribute( "Name", data->FieldName.c_str() );
|
||||
dataElement->SetAttribute( "Value", getDataField( StringTable->insert( data->FieldName.c_str() ), NULL ) );
|
||||
|
||||
// Add.
|
||||
|
|
@ -645,12 +645,12 @@ bool VController::writeDataTable( TiXmlElement *pElement )
|
|||
// Read the DataTable from a TinyXML document.
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
bool VController::readDataTable( TiXmlElement *pElement )
|
||||
bool VController::readDataTable( tinyxml2::XMLElement *pElement )
|
||||
{
|
||||
TiXmlElement *dataTableRoot = pElement->FirstChildElement( "DataTable" );
|
||||
tinyxml2::XMLElement *dataTableRoot = pElement->FirstChildElement( "DataTable" );
|
||||
if ( dataTableRoot )
|
||||
{
|
||||
for ( TiXmlElement *child = dataTableRoot->FirstChildElement(); child != NULL; child = child->NextSiblingElement() )
|
||||
for ( tinyxml2::XMLElement *child = dataTableRoot->FirstChildElement(); child != NULL; child = child->NextSiblingElement() )
|
||||
{
|
||||
// Get Field Data.
|
||||
const char *fieldType = child->Attribute( "Type" );
|
||||
|
|
|
|||
|
|
@ -198,11 +198,11 @@ public:
|
|||
|
||||
// Saving.
|
||||
|
||||
bool writeDataTable( TiXmlElement *pElement );
|
||||
bool writeDataTable( tinyxml2::XMLElement *pElement );
|
||||
|
||||
// Reading.
|
||||
|
||||
bool readDataTable( TiXmlElement *pElement );
|
||||
bool readDataTable( tinyxml2::XMLElement *pElement );
|
||||
|
||||
// Console Declaration.
|
||||
|
||||
|
|
@ -243,4 +243,4 @@ protected:
|
|||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#endif // _VT_VCONTROLLER_H_
|
||||
#endif // _VT_VCONTROLLER_H_
|
||||
|
|
|
|||
|
|
@ -45,10 +45,6 @@
|
|||
#include "Verve/Core/VTreeNode.h"
|
||||
#endif
|
||||
|
||||
#ifndef TINYXML_INCLUDED
|
||||
#include "tinyxml/tinyxml.h"
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
class VController;
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -123,4 +119,4 @@ public:
|
|||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#endif // _VT_VOBJECT_H_
|
||||
#endif // _VT_VOBJECT_H_
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue