Browse Source

Function name unification and cleanup. ChildElement -> Child. RootElement -> Root. ScriptedChildren -> ChildrenWithScript.

Lasse Öörni 14 years ago
parent
commit
af2b4311dc
43 changed files with 475 additions and 475 deletions
  1. 1 1
      Bin/Data/Scripts/AIController.as
  2. 8 8
      Bin/Data/Scripts/NinjaSnowWar.as
  3. 2 2
      Docs/GettingStarted.dox
  4. 32 32
      Docs/ScriptAPI.dox
  5. 3 3
      Engine/Audio/Sound.cpp
  6. 5 5
      Engine/Engine/APITemplates.h
  7. 2 2
      Engine/Engine/Console.cpp
  8. 2 2
      Engine/Engine/DebugHud.cpp
  9. 24 24
      Engine/Engine/ResourceAPI.cpp
  10. 2 2
      Engine/Engine/UIAPI.cpp
  11. 3 3
      Engine/Graphics/Direct3D9/D3D9Texture.cpp
  12. 3 3
      Engine/Graphics/Direct3D9/D3D9TextureCube.cpp
  13. 13 13
      Engine/Graphics/Material.cpp
  14. 49 49
      Engine/Graphics/ParticleEmitter.cpp
  15. 3 3
      Engine/Graphics/Technique.cpp
  16. 15 15
      Engine/Resource/XMLElement.cpp
  17. 7 7
      Engine/Resource/XMLElement.h
  18. 3 3
      Engine/Resource/XMLFile.cpp
  19. 2 2
      Engine/Resource/XMLFile.h
  20. 6 6
      Engine/Scene/Node.cpp
  21. 6 6
      Engine/Scene/Scene.cpp
  22. 3 3
      Engine/Scene/Serializable.cpp
  23. 8 8
      Engine/UI/BorderImage.cpp
  24. 6 6
      Engine/UI/Button.cpp
  25. 2 2
      Engine/UI/CheckBox.cpp
  26. 2 2
      Engine/UI/Cursor.cpp
  27. 11 11
      Engine/UI/DropDownList.cpp
  28. 2 2
      Engine/UI/FileSelector.cpp
  29. 16 16
      Engine/UI/LineEdit.cpp
  30. 16 16
      Engine/UI/ListView.cpp
  31. 6 6
      Engine/UI/Menu.cpp
  32. 13 13
      Engine/UI/ScrollBar.cpp
  33. 12 12
      Engine/UI/ScrollView.cpp
  34. 5 5
      Engine/UI/Slider.cpp
  35. 18 18
      Engine/UI/Text.cpp
  36. 4 4
      Engine/UI/UI.cpp
  37. 1 1
      Engine/UI/UI.h
  38. 61 61
      Engine/UI/UIElement.cpp
  39. 1 1
      Engine/UI/UIElement.h
  40. 6 6
      Engine/UI/Window.cpp
  41. 8 8
      Tools/AssetImporter/AssetImporter.cpp
  42. 69 69
      Tools/OgreImporter/OgreImporter.cpp
  43. 14 14
      Tools/ShaderCompiler/ShaderCompiler.cpp

+ 1 - 1
Bin/Data/Scripts/AIController.as

@@ -43,7 +43,7 @@ class AIController
         // Get closest ninja on the player's side
         // Get closest ninja on the player's side
         Node@ targetNode;
         Node@ targetNode;
         Ninja@ targetNinja;
         Ninja@ targetNinja;
-        Array<Node@> nodes = scene.GetScriptedChildren("Ninja", true);
+        Array<Node@> nodes = scene.GetChildrenWithScript("Ninja", true);
         float closestDistance = M_INFINITY;
         float closestDistance = M_INFINITY;
         for (uint i = 0; i < nodes.length; ++i)
         for (uint i = 0; i < nodes.length; ++i)
         {
         {

+ 8 - 8
Bin/Data/Scripts/NinjaSnowWar.as

@@ -173,7 +173,7 @@ void CreateOverlays()
     sight.texture = cache.GetResource("Texture2D", "Textures/Sight.png");
     sight.texture = cache.GetResource("Texture2D", "Textures/Sight.png");
     sight.SetAlignment(HA_CENTER, VA_CENTER);
     sight.SetAlignment(HA_CENTER, VA_CENTER);
     sight.SetSize(height, height);
     sight.SetSize(height, height);
-    ui.rootElement.AddChild(sight);
+    ui.root.AddChild(sight);
 
 
     Font@ font = cache.GetResource("Font", "Fonts/BlueHighway.ttf");
     Font@ font = cache.GetResource("Font", "Fonts/BlueHighway.ttf");
 
 
@@ -183,7 +183,7 @@ void CreateOverlays()
     scoreText.SetPosition(5, 5);
     scoreText.SetPosition(5, 5);
     scoreText.colors[C_BOTTOMLEFT] = Color(1, 1, 0.25);
     scoreText.colors[C_BOTTOMLEFT] = Color(1, 1, 0.25);
     scoreText.colors[C_BOTTOMRIGHT] = Color(1, 1, 0.25);
     scoreText.colors[C_BOTTOMRIGHT] = Color(1, 1, 0.25);
-    ui.rootElement.AddChild(scoreText);
+    ui.root.AddChild(scoreText);
 
 
     @hiscoreText = Text();
     @hiscoreText = Text();
     hiscoreText.SetFont(font, 17);
     hiscoreText.SetFont(font, 17);
@@ -191,21 +191,21 @@ void CreateOverlays()
     hiscoreText.SetPosition(-5, 5);
     hiscoreText.SetPosition(-5, 5);
     hiscoreText.colors[C_BOTTOMLEFT] = Color(1, 1, 0.25);
     hiscoreText.colors[C_BOTTOMLEFT] = Color(1, 1, 0.25);
     hiscoreText.colors[C_BOTTOMRIGHT] = Color(1, 1, 0.25);
     hiscoreText.colors[C_BOTTOMRIGHT] = Color(1, 1, 0.25);
-    ui.rootElement.AddChild(hiscoreText);
+    ui.root.AddChild(hiscoreText);
 
 
     @messageText = Text();
     @messageText = Text();
     messageText.SetFont(font, 17);
     messageText.SetFont(font, 17);
     messageText.SetAlignment(HA_CENTER, VA_CENTER);
     messageText.SetAlignment(HA_CENTER, VA_CENTER);
     messageText.SetPosition(0, -height * 2);
     messageText.SetPosition(0, -height * 2);
     messageText.color = Color(1, 0, 0);
     messageText.color = Color(1, 0, 0);
-    ui.rootElement.AddChild(messageText);
+    ui.root.AddChild(messageText);
 
 
     BorderImage@ healthBorder = BorderImage();
     BorderImage@ healthBorder = BorderImage();
     healthBorder.texture = cache.GetResource("Texture2D", "Textures/HealthBarBorder.png");
     healthBorder.texture = cache.GetResource("Texture2D", "Textures/HealthBarBorder.png");
     healthBorder.SetAlignment(HA_CENTER, VA_TOP);
     healthBorder.SetAlignment(HA_CENTER, VA_TOP);
     healthBorder.SetPosition(0, 8);
     healthBorder.SetPosition(0, 8);
     healthBorder.SetSize(120, 20);
     healthBorder.SetSize(120, 20);
-    ui.rootElement.AddChild(healthBorder);
+    ui.root.AddChild(healthBorder);
 
 
     healthBar = BorderImage();
     healthBar = BorderImage();
     healthBar.texture = cache.GetResource("Texture2D", "Textures/HealthBarInside.png");
     healthBar.texture = cache.GetResource("Texture2D", "Textures/HealthBarInside.png");
@@ -224,7 +224,7 @@ void StartGame()
 {
 {
     // Clear the scene of all existing scripted objects
     // Clear the scene of all existing scripted objects
     {
     {
-        Array<Node@> scriptedNodes = gameScene.GetScriptedChildren(true);
+        Array<Node@> scriptedNodes = gameScene.GetChildrenWithScript(true);
         for (uint i = 0; i < scriptedNodes.length; ++i)
         for (uint i = 0; i < scriptedNodes.length; ++i)
             scriptedNodes[i].Remove();
             scriptedNodes[i].Remove();
     }
     }
@@ -343,7 +343,7 @@ void SpawnObjects(float timeStep)
     if (powerupSpawnTimer >= powerupSpawnRate)
     if (powerupSpawnTimer >= powerupSpawnRate)
     {
     {
         powerupSpawnTimer = 0;
         powerupSpawnTimer = 0;
-        int numPowerups = gameScene.GetScriptedChildren("SnowCrate", true).length + gameScene.GetScriptedChildren("Potion", true).length;
+        int numPowerups = gameScene.GetChildrenWithScript("SnowCrate", true).length + gameScene.GetChildrenWithScript("Potion", true).length;
 
 
         if (numPowerups < maxPowerups)
         if (numPowerups < maxPowerups)
         {
         {
@@ -364,7 +364,7 @@ void SpawnObjects(float timeStep)
     {
     {
         enemySpawnTimer = 0;
         enemySpawnTimer = 0;
         // Take the player ninja into account
         // Take the player ninja into account
-        int numEnemies = gameScene.GetScriptedChildren("Ninja", true).length - 1;
+        int numEnemies = gameScene.GetChildrenWithScript("Ninja", true).length - 1;
 
 
         if (numEnemies < maxEnemies)
         if (numEnemies < maxEnemies)
         {
         {

+ 2 - 2
Docs/GettingStarted.dox

@@ -243,7 +243,7 @@ void CreateText()
     helloText.horizontalAlignment = HA_CENTER;
     helloText.horizontalAlignment = HA_CENTER;
     helloText.verticalAlignment = VA_CENTER;
     helloText.verticalAlignment = VA_CENTER;
 
 
-    ui.rootElement.AddChild(helloText);
+    ui.root.AddChild(helloText);
 }
 }
 \endcode
 \endcode
 
 
@@ -442,7 +442,7 @@ void HelloWorld::CreateText()
     helloText->SetHorizontalAlignment(HA_CENTER);
     helloText->SetHorizontalAlignment(HA_CENTER);
     helloText->SetVerticalAlignment(VA_CENTER);
     helloText->SetVerticalAlignment(VA_CENTER);
 
 
-    GetSubsystem<UI>()->GetRootElement()->AddChild(helloText);
+    GetSubsystem<UI>()->GetRoot()->AddChild(helloText);
 }
 }
 \endcode
 \endcode
 
 

+ 32 - 32
Docs/ScriptAPI.dox

@@ -879,8 +879,8 @@ XMLFile
 Methods:<br>
 Methods:<br>
 - bool Load(File@)
 - bool Load(File@)
 - bool Save(File@)
 - bool Save(File@)
-- XMLElement CreateRootElement(const String&)
-- XMLElement GetRootElement(const String&)
+- XMLElement CreateRoot(const String&)
+- XMLElement GetRoot(const String&)
 
 
 Properties:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - ShortStringHash type (readonly)
@@ -888,17 +888,17 @@ Properties:<br>
 - String& name
 - String& name
 - uint memoryUse (readonly)
 - uint memoryUse (readonly)
 - uint useTimer (readonly)
 - uint useTimer (readonly)
-- XMLElement rootElement (readonly)
+- XMLElement root (readonly)
 
 
 
 
 XMLElement
 XMLElement
 
 
 Methods:<br>
 Methods:<br>
 - XMLElement CreateChildElement(const String&)
 - XMLElement CreateChildElement(const String&)
-- bool RemoveChildElement()
-- bool RemoveChildElement(const String&, bool)
-- bool RemoveChildElements()
-- bool RemoveChildElements(const String&)
+- bool RemoveChild()
+- bool RemoveChild(const String&, bool)
+- bool RemoveChildren()
+- bool RemoveChildren(const String&)
 - bool SetAttribute(const String&, const String&)
 - bool SetAttribute(const String&, const String&)
 - bool SetBool(const String&, bool)
 - bool SetBool(const String&, bool)
 - bool SetBoundingBox(const BoundingBox&)
 - bool SetBoundingBox(const BoundingBox&)
@@ -919,11 +919,11 @@ Methods:<br>
 - bool HasAttribute(const String&) const
 - bool HasAttribute(const String&) const
 - String GetAttributes(const String&) const
 - String GetAttributes(const String&) const
 - String[]@ GetAttributeNames() const
 - String[]@ GetAttributeNames() const
-- bool HasChildElement(const String&) const
-- XMLElement GetChildElement() const
-- XMLElement GetChildElement(const String&) const
-- XMLElement GetNextElement() const
-- XMLElement GetNextElement(const String&) const
+- bool HasChild(const String&) const
+- XMLElement GetChild() const
+- XMLElement GetChild(const String&) const
+- XMLElement GetNext() const
+- XMLElement GetNext(const String&) const
 - bool GetBool(const String&) const
 - bool GetBool(const String&) const
 - BoundingBox GetBoundingBox() const
 - BoundingBox GetBoundingBox() const
 - Color GetColor(const String&) const
 - Color GetColor(const String&) const
@@ -1020,8 +1020,8 @@ Methods:<br>
 - Component@ GetOrCreateComponent(const String&, bool arg1 = false)
 - Component@ GetOrCreateComponent(const String&, bool arg1 = false)
 - Node@[]@ GetChildren(bool arg0 = false) const
 - Node@[]@ GetChildren(bool arg0 = false) const
 - Node@[]@ GetChildrenWithComponent(const String&, bool arg1 = false) const
 - Node@[]@ GetChildrenWithComponent(const String&, bool arg1 = false) const
-- Node@[]@ GetScriptedChildren(bool arg0 = false) const
-- Node@[]@ GetScriptedChildren(const String&, bool arg1 = false) const
+- Node@[]@ GetChildrenWithScript(bool arg0 = false) const
+- Node@[]@ GetChildrenWithScript(const String&, bool arg1 = false) const
 - Node@ GetChild(const String&, bool arg1 = false) const
 - Node@ GetChild(const String&, bool arg1 = false) const
 - Component@[]@ GetComponents(const String&) const
 - Component@[]@ GetComponents(const String&) const
 - Component@ GetComponent(const String&, uint arg1 = 0) const
 - Component@ GetComponent(const String&, uint arg1 = 0) const
@@ -1088,8 +1088,8 @@ Methods:<br>
 - Component@ GetOrCreateComponent(const String&, bool arg1 = false)
 - Component@ GetOrCreateComponent(const String&, bool arg1 = false)
 - Node@[]@ GetChildren(bool arg0 = false) const
 - Node@[]@ GetChildren(bool arg0 = false) const
 - Node@[]@ GetChildrenWithComponent(const String&, bool arg1 = false) const
 - Node@[]@ GetChildrenWithComponent(const String&, bool arg1 = false) const
-- Node@[]@ GetScriptedChildren(bool arg0 = false) const
-- Node@[]@ GetScriptedChildren(const String&, bool arg1 = false) const
+- Node@[]@ GetChildrenWithScript(bool arg0 = false) const
+- Node@[]@ GetChildrenWithScript(const String&, bool arg1 = false) const
 - Node@ GetChild(const String&, bool arg1 = false) const
 - Node@ GetChild(const String&, bool arg1 = false) const
 - Component@[]@ GetComponents(const String&) const
 - Component@[]@ GetComponents(const String&) const
 - Component@ GetComponent(const String&, uint arg1 = 0) const
 - Component@ GetComponent(const String&, uint arg1 = 0) const
@@ -2191,7 +2191,7 @@ Properties:<br>
 - uint[] numChildren (readonly)
 - uint[] numChildren (readonly)
 - UIElement@[] children (readonly)
 - UIElement@[] children (readonly)
 - UIElement@ parent (readonly)
 - UIElement@ parent (readonly)
-- UIElement@ rootElement (readonly)
+- UIElement@ root (readonly)
 - IntVector2 screenPosition (readonly)
 - IntVector2 screenPosition (readonly)
 - float derivedOpacity (readonly)
 - float derivedOpacity (readonly)
 - IntRect combinedScreenRect (readonly)
 - IntRect combinedScreenRect (readonly)
@@ -2269,7 +2269,7 @@ Properties:<br>
 - uint[] numChildren (readonly)
 - uint[] numChildren (readonly)
 - UIElement@[] children (readonly)
 - UIElement@[] children (readonly)
 - UIElement@ parent (readonly)
 - UIElement@ parent (readonly)
-- UIElement@ rootElement (readonly)
+- UIElement@ root (readonly)
 - IntVector2 screenPosition (readonly)
 - IntVector2 screenPosition (readonly)
 - float derivedOpacity (readonly)
 - float derivedOpacity (readonly)
 - IntRect combinedScreenRect (readonly)
 - IntRect combinedScreenRect (readonly)
@@ -2354,7 +2354,7 @@ Properties:<br>
 - uint[] numChildren (readonly)
 - uint[] numChildren (readonly)
 - UIElement@[] children (readonly)
 - UIElement@[] children (readonly)
 - UIElement@ parent (readonly)
 - UIElement@ parent (readonly)
-- UIElement@ rootElement (readonly)
+- UIElement@ root (readonly)
 - IntVector2 screenPosition (readonly)
 - IntVector2 screenPosition (readonly)
 - float derivedOpacity (readonly)
 - float derivedOpacity (readonly)
 - IntRect combinedScreenRect (readonly)
 - IntRect combinedScreenRect (readonly)
@@ -2441,7 +2441,7 @@ Properties:<br>
 - uint[] numChildren (readonly)
 - uint[] numChildren (readonly)
 - UIElement@[] children (readonly)
 - UIElement@[] children (readonly)
 - UIElement@ parent (readonly)
 - UIElement@ parent (readonly)
-- UIElement@ rootElement (readonly)
+- UIElement@ root (readonly)
 - IntVector2 screenPosition (readonly)
 - IntVector2 screenPosition (readonly)
 - float derivedOpacity (readonly)
 - float derivedOpacity (readonly)
 - IntRect combinedScreenRect (readonly)
 - IntRect combinedScreenRect (readonly)
@@ -2526,7 +2526,7 @@ Properties:<br>
 - uint[] numChildren (readonly)
 - uint[] numChildren (readonly)
 - UIElement@[] children (readonly)
 - UIElement@[] children (readonly)
 - UIElement@ parent (readonly)
 - UIElement@ parent (readonly)
-- UIElement@ rootElement (readonly)
+- UIElement@ root (readonly)
 - IntVector2 screenPosition (readonly)
 - IntVector2 screenPosition (readonly)
 - float derivedOpacity (readonly)
 - float derivedOpacity (readonly)
 - IntRect combinedScreenRect (readonly)
 - IntRect combinedScreenRect (readonly)
@@ -2610,7 +2610,7 @@ Properties:<br>
 - uint[] numChildren (readonly)
 - uint[] numChildren (readonly)
 - UIElement@[] children (readonly)
 - UIElement@[] children (readonly)
 - UIElement@ parent (readonly)
 - UIElement@ parent (readonly)
-- UIElement@ rootElement (readonly)
+- UIElement@ root (readonly)
 - IntVector2 screenPosition (readonly)
 - IntVector2 screenPosition (readonly)
 - float derivedOpacity (readonly)
 - float derivedOpacity (readonly)
 - IntRect combinedScreenRect (readonly)
 - IntRect combinedScreenRect (readonly)
@@ -2697,7 +2697,7 @@ Properties:<br>
 - uint[] numChildren (readonly)
 - uint[] numChildren (readonly)
 - UIElement@[] children (readonly)
 - UIElement@[] children (readonly)
 - UIElement@ parent (readonly)
 - UIElement@ parent (readonly)
-- UIElement@ rootElement (readonly)
+- UIElement@ root (readonly)
 - IntVector2 screenPosition (readonly)
 - IntVector2 screenPosition (readonly)
 - float derivedOpacity (readonly)
 - float derivedOpacity (readonly)
 - IntRect combinedScreenRect (readonly)
 - IntRect combinedScreenRect (readonly)
@@ -2784,7 +2784,7 @@ Properties:<br>
 - uint[] numChildren (readonly)
 - uint[] numChildren (readonly)
 - UIElement@[] children (readonly)
 - UIElement@[] children (readonly)
 - UIElement@ parent (readonly)
 - UIElement@ parent (readonly)
-- UIElement@ rootElement (readonly)
+- UIElement@ root (readonly)
 - IntVector2 screenPosition (readonly)
 - IntVector2 screenPosition (readonly)
 - float derivedOpacity (readonly)
 - float derivedOpacity (readonly)
 - IntRect combinedScreenRect (readonly)
 - IntRect combinedScreenRect (readonly)
@@ -2883,7 +2883,7 @@ Properties:<br>
 - uint[] numChildren (readonly)
 - uint[] numChildren (readonly)
 - UIElement@[] children (readonly)
 - UIElement@[] children (readonly)
 - UIElement@ parent (readonly)
 - UIElement@ parent (readonly)
-- UIElement@ rootElement (readonly)
+- UIElement@ root (readonly)
 - IntVector2 screenPosition (readonly)
 - IntVector2 screenPosition (readonly)
 - float derivedOpacity (readonly)
 - float derivedOpacity (readonly)
 - IntRect combinedScreenRect (readonly)
 - IntRect combinedScreenRect (readonly)
@@ -2981,7 +2981,7 @@ Properties:<br>
 - uint[] numChildren (readonly)
 - uint[] numChildren (readonly)
 - UIElement@[] children (readonly)
 - UIElement@[] children (readonly)
 - UIElement@ parent (readonly)
 - UIElement@ parent (readonly)
-- UIElement@ rootElement (readonly)
+- UIElement@ root (readonly)
 - IntVector2 screenPosition (readonly)
 - IntVector2 screenPosition (readonly)
 - float derivedOpacity (readonly)
 - float derivedOpacity (readonly)
 - IntRect combinedScreenRect (readonly)
 - IntRect combinedScreenRect (readonly)
@@ -3071,7 +3071,7 @@ Properties:<br>
 - uint[] numChildren (readonly)
 - uint[] numChildren (readonly)
 - UIElement@[] children (readonly)
 - UIElement@[] children (readonly)
 - UIElement@ parent (readonly)
 - UIElement@ parent (readonly)
-- UIElement@ rootElement (readonly)
+- UIElement@ root (readonly)
 - IntVector2 screenPosition (readonly)
 - IntVector2 screenPosition (readonly)
 - float derivedOpacity (readonly)
 - float derivedOpacity (readonly)
 - IntRect combinedScreenRect (readonly)
 - IntRect combinedScreenRect (readonly)
@@ -3168,7 +3168,7 @@ Properties:<br>
 - uint[] numChildren (readonly)
 - uint[] numChildren (readonly)
 - UIElement@[] children (readonly)
 - UIElement@[] children (readonly)
 - UIElement@ parent (readonly)
 - UIElement@ parent (readonly)
-- UIElement@ rootElement (readonly)
+- UIElement@ root (readonly)
 - IntVector2 screenPosition (readonly)
 - IntVector2 screenPosition (readonly)
 - float derivedOpacity (readonly)
 - float derivedOpacity (readonly)
 - IntRect combinedScreenRect (readonly)
 - IntRect combinedScreenRect (readonly)
@@ -3270,7 +3270,7 @@ Properties:<br>
 - uint[] numChildren (readonly)
 - uint[] numChildren (readonly)
 - UIElement@[] children (readonly)
 - UIElement@[] children (readonly)
 - UIElement@ parent (readonly)
 - UIElement@ parent (readonly)
-- UIElement@ rootElement (readonly)
+- UIElement@ root (readonly)
 - IntVector2 screenPosition (readonly)
 - IntVector2 screenPosition (readonly)
 - float derivedOpacity (readonly)
 - float derivedOpacity (readonly)
 - IntRect combinedScreenRect (readonly)
 - IntRect combinedScreenRect (readonly)
@@ -3366,7 +3366,7 @@ Properties:<br>
 - uint[] numChildren (readonly)
 - uint[] numChildren (readonly)
 - UIElement@[] children (readonly)
 - UIElement@[] children (readonly)
 - UIElement@ parent (readonly)
 - UIElement@ parent (readonly)
-- UIElement@ rootElement (readonly)
+- UIElement@ root (readonly)
 - IntVector2 screenPosition (readonly)
 - IntVector2 screenPosition (readonly)
 - float derivedOpacity (readonly)
 - float derivedOpacity (readonly)
 - IntRect combinedScreenRect (readonly)
 - IntRect combinedScreenRect (readonly)
@@ -3420,10 +3420,10 @@ Properties:<br>
 - ShortStringHash type (readonly)
 - ShortStringHash type (readonly)
 - String& typeName (readonly)
 - String& typeName (readonly)
 - Cursor@ cursor
 - Cursor@ cursor
+- IntVector2 cursorPosition (readonly)
 - UIElement@ focusElement
 - UIElement@ focusElement
-- UIElement@ rootElement (readonly)
 - UIElement@ frontElement (readonly)
 - UIElement@ frontElement (readonly)
-- IntVector2 cursorPosition (readonly)
+- UIElement@ root (readonly)
 
 
 
 
 Controls
 Controls

+ 3 - 3
Engine/Audio/Sound.cpp

@@ -385,8 +385,8 @@ void Sound::LoadParameters()
     if (!file)
     if (!file)
         return;
         return;
     
     
-    XMLElement rootElem = file->GetRootElement();
-    XMLElement paramElem = rootElem.GetChildElement("");
+    XMLElement rootElem = file->GetRoot();
+    XMLElement paramElem = rootElem.GetChild("");
     
     
     while (paramElem)
     while (paramElem)
     {
     {
@@ -412,6 +412,6 @@ void Sound::LoadParameters()
                 SetLoop(paramElem.GetInt("start"), paramElem.GetInt("end"));
                 SetLoop(paramElem.GetInt("start"), paramElem.GetInt("end"));
         }
         }
         
         
-        paramElem = paramElem.GetNextElement();
+        paramElem = paramElem.GetNext();
     }
     }
 }
 }

+ 5 - 5
Engine/Engine/APITemplates.h

@@ -445,14 +445,14 @@ static Node* NodeGetChild(unsigned index, Node* ptr)
         return children[index].Ptr();
         return children[index].Ptr();
 }
 }
 
 
-static CScriptArray* NodeGetScriptedChildren(bool recursive, Node* ptr)
+static CScriptArray* NodeGetChildrenWithScript(bool recursive, Node* ptr)
 {
 {
     PODVector<Node*> nodes;
     PODVector<Node*> nodes;
     ptr->GetChildrenWithComponent<ScriptInstance>(nodes, recursive);
     ptr->GetChildrenWithComponent<ScriptInstance>(nodes, recursive);
     return VectorToHandleArray<Node>(nodes, "Array<Node@>");
     return VectorToHandleArray<Node>(nodes, "Array<Node@>");
 }
 }
 
 
-static CScriptArray* NodeGetScriptedChildrenWithClassName(const String& className, bool recursive, Node* ptr)
+static CScriptArray* NodeGetChildrenWithClassName(const String& className, bool recursive, Node* ptr)
 {
 {
     PODVector<Node*> nodes;
     PODVector<Node*> nodes;
     PODVector<Node*> ret;
     PODVector<Node*> ret;
@@ -502,8 +502,8 @@ template <class T> void RegisterNode(asIScriptEngine* engine, const char* classN
     engine->RegisterObjectMethod(className, "Component@+ GetOrCreateComponent(const String&in, bool local = false)", asFUNCTION(NodeGetOrCreateComponent), asCALL_CDECL_OBJLAST);
     engine->RegisterObjectMethod(className, "Component@+ GetOrCreateComponent(const String&in, bool local = false)", asFUNCTION(NodeGetOrCreateComponent), asCALL_CDECL_OBJLAST);
     engine->RegisterObjectMethod(className, "Array<Node@>@ GetChildren(bool recursive = false) const", asFUNCTION(NodeGetChildren), asCALL_CDECL_OBJLAST);
     engine->RegisterObjectMethod(className, "Array<Node@>@ GetChildren(bool recursive = false) const", asFUNCTION(NodeGetChildren), asCALL_CDECL_OBJLAST);
     engine->RegisterObjectMethod(className, "Array<Node@>@ GetChildrenWithComponent(const String&in, bool recursive = false) const", asFUNCTION(NodeGetChildrenWithComponent), asCALL_CDECL_OBJLAST);
     engine->RegisterObjectMethod(className, "Array<Node@>@ GetChildrenWithComponent(const String&in, bool recursive = false) const", asFUNCTION(NodeGetChildrenWithComponent), asCALL_CDECL_OBJLAST);
-    engine->RegisterObjectMethod(className, "Array<Node@>@ GetScriptedChildren(bool recursive = false) const", asFUNCTION(NodeGetScriptedChildren), asCALL_CDECL_OBJLAST);
-    engine->RegisterObjectMethod(className, "Array<Node@>@ GetScriptedChildren(const String&in, bool recursive = false) const", asFUNCTION(NodeGetScriptedChildrenWithClassName), asCALL_CDECL_OBJLAST);
+    engine->RegisterObjectMethod(className, "Array<Node@>@ GetChildrenWithScript(bool recursive = false) const", asFUNCTION(NodeGetChildrenWithScript), asCALL_CDECL_OBJLAST);
+    engine->RegisterObjectMethod(className, "Array<Node@>@ GetChildrenWithScript(const String&in, bool recursive = false) const", asFUNCTION(NodeGetChildrenWithClassName), asCALL_CDECL_OBJLAST);
     engine->RegisterObjectMethod(className, "Node@+ GetChild(const String&in, bool recursive = false) const", asMETHODPR(T, GetChild, (const String&, bool) const, Node*), asCALL_THISCALL);
     engine->RegisterObjectMethod(className, "Node@+ GetChild(const String&in, bool recursive = false) const", asMETHODPR(T, GetChild, (const String&, bool) const, Node*), asCALL_THISCALL);
     engine->RegisterObjectMethod(className, "Array<Component@>@ GetComponents(const String&in) const", asFUNCTION(NodeGetComponentsWithType), asCALL_CDECL_OBJLAST);
     engine->RegisterObjectMethod(className, "Array<Component@>@ GetComponents(const String&in) const", asFUNCTION(NodeGetComponentsWithType), asCALL_CDECL_OBJLAST);
     engine->RegisterObjectMethod(className, "Component@+ GetComponent(const String&in, uint index = 0) const", asFUNCTION(NodeGetComponentWithTypeAndIndex), asCALL_CDECL_OBJLAST);
     engine->RegisterObjectMethod(className, "Component@+ GetComponent(const String&in, uint index = 0) const", asFUNCTION(NodeGetComponentWithTypeAndIndex), asCALL_CDECL_OBJLAST);
@@ -754,7 +754,7 @@ template <class T> void RegisterUIElement(asIScriptEngine* engine, const char* c
     engine->RegisterObjectMethod(className, "uint get_numChildren(bool) const", asMETHOD(T, GetNumChildren), asCALL_THISCALL);
     engine->RegisterObjectMethod(className, "uint get_numChildren(bool) const", asMETHOD(T, GetNumChildren), asCALL_THISCALL);
     engine->RegisterObjectMethod(className, "UIElement@+ get_children(uint) const", asMETHODPR(T, GetChild, (unsigned) const, UIElement*), asCALL_THISCALL);
     engine->RegisterObjectMethod(className, "UIElement@+ get_children(uint) const", asMETHODPR(T, GetChild, (unsigned) const, UIElement*), asCALL_THISCALL);
     engine->RegisterObjectMethod(className, "UIElement@+ get_parent() const", asMETHOD(T, GetParent), asCALL_THISCALL);
     engine->RegisterObjectMethod(className, "UIElement@+ get_parent() const", asMETHOD(T, GetParent), asCALL_THISCALL);
-    engine->RegisterObjectMethod(className, "UIElement@+ get_rootElement() const", asMETHOD(T, GetRootElement), asCALL_THISCALL);
+    engine->RegisterObjectMethod(className, "UIElement@+ get_root() const", asMETHOD(T, GetRoot), asCALL_THISCALL);
     engine->RegisterObjectMethod(className, "IntVector2 get_screenPosition()", asMETHOD(T, GetScreenPosition), asCALL_THISCALL);
     engine->RegisterObjectMethod(className, "IntVector2 get_screenPosition()", asMETHOD(T, GetScreenPosition), asCALL_THISCALL);
     engine->RegisterObjectMethod(className, "float get_derivedOpacity()", asMETHOD(T, GetDerivedOpacity), asCALL_THISCALL);
     engine->RegisterObjectMethod(className, "float get_derivedOpacity()", asMETHOD(T, GetDerivedOpacity), asCALL_THISCALL);
     engine->RegisterObjectMethod(className, "IntRect get_combinedScreenRect()", asMETHOD(T, GetCombinedScreenRect), asCALL_THISCALL);
     engine->RegisterObjectMethod(className, "IntRect get_combinedScreenRect()", asMETHOD(T, GetCombinedScreenRect), asCALL_THISCALL);

+ 2 - 2
Engine/Engine/Console.cpp

@@ -52,7 +52,7 @@ Console::Console(Context* context) :
     inLogMessage_(false)
     inLogMessage_(false)
 {
 {
     UI* ui = GetSubsystem<UI>();
     UI* ui = GetSubsystem<UI>();
-    UIElement* uiRoot = ui->GetRootElement();
+    UIElement* uiRoot = ui->GetRoot();
     
     
     background_ = new BorderImage(context_);
     background_ = new BorderImage(context_);
     background_->SetBringToBack(false);
     background_->SetBringToBack(false);
@@ -86,7 +86,7 @@ Console::~Console()
 {
 {
     UI* ui = GetSubsystem<UI>();
     UI* ui = GetSubsystem<UI>();
     if (ui)
     if (ui)
-        ui->GetRootElement()->RemoveChild(background_);
+        ui->GetRoot()->RemoveChild(background_);
 }
 }
 
 
 void Console::SetStyle(XMLFile* style)
 void Console::SetStyle(XMLFile* style)

+ 2 - 2
Engine/Engine/DebugHud.cpp

@@ -44,7 +44,7 @@ DebugHud::DebugHud(Context* context) :
     useRendererStats_(false)
     useRendererStats_(false)
 {
 {
     UI* ui = GetSubsystem<UI>();
     UI* ui = GetSubsystem<UI>();
-    UIElement* uiRoot = ui->GetRootElement();
+    UIElement* uiRoot = ui->GetRoot();
     
     
     statsText_ = new Text(context_);
     statsText_ = new Text(context_);
     statsText_->SetAlignment(HA_LEFT, VA_TOP);
     statsText_->SetAlignment(HA_LEFT, VA_TOP);
@@ -72,7 +72,7 @@ DebugHud::~DebugHud()
     UI* ui = GetSubsystem<UI>();
     UI* ui = GetSubsystem<UI>();
     if (ui)
     if (ui)
     {
     {
-        UIElement* uiRoot = ui->GetRootElement();
+        UIElement* uiRoot = ui->GetRoot();
         uiRoot->RemoveChild(statsText_);
         uiRoot->RemoveChild(statsText_);
         uiRoot->RemoveChild(modeText_);
         uiRoot->RemoveChild(modeText_);
         uiRoot->RemoveChild(profilerText_);
         uiRoot->RemoveChild(profilerText_);

+ 24 - 24
Engine/Engine/ResourceAPI.cpp

@@ -134,14 +134,14 @@ static void DestructXMLElement(XMLElement* ptr)
     ptr->~XMLElement();
     ptr->~XMLElement();
 }
 }
 
 
-static void XMLElementRemoveChildElementDefault(XMLElement* ptr)
+static void XMLElementRemoveChildDefault(XMLElement* ptr)
 {
 {
-    ptr->RemoveChildElement();
+    ptr->RemoveChild();
 }
 }
 
 
-static void XMLElementRemoveChildElementsDefault(XMLElement* ptr)
+static void XMLElementRemoveChildrenDefault(XMLElement* ptr)
 {
 {
-    ptr->RemoveChildElements();
+    ptr->RemoveChildren();
 }
 }
 
 
 static void XMLElementSetVariantVector(CScriptArray* value, XMLElement* ptr)
 static void XMLElementSetVariantVector(CScriptArray* value, XMLElement* ptr)
@@ -151,14 +151,14 @@ static void XMLElementSetVariantVector(CScriptArray* value, XMLElement* ptr)
     ptr->SetVariantVector(src);
     ptr->SetVariantVector(src);
 }
 }
 
 
-static XMLElement XMLElementGetChildElementDefault(XMLElement* ptr)
+static XMLElement XMLElementGetChildDefault(XMLElement* ptr)
 {
 {
-    return ptr->GetChildElement();
+    return ptr->GetChild();
 }
 }
 
 
-static XMLElement XMLElementGetNextElementDefault(XMLElement* ptr)
+static XMLElement XMLElementGetNextDefault(XMLElement* ptr)
 {
 {
-    return ptr->GetNextElement();
+    return ptr->GetNext();
 }
 }
 
 
 static CScriptArray* XMLElementGetAttributeNames(XMLElement* ptr)
 static CScriptArray* XMLElementGetAttributeNames(XMLElement* ptr)
@@ -179,11 +179,11 @@ static void RegisterXMLElement(asIScriptEngine* engine)
     engine->RegisterObjectBehaviour("XMLElement", asBEHAVE_CONSTRUCT, "void f(const XMLElement&in)", asFUNCTION(ConstructXMLElementCopy), asCALL_CDECL_OBJLAST);
     engine->RegisterObjectBehaviour("XMLElement", asBEHAVE_CONSTRUCT, "void f(const XMLElement&in)", asFUNCTION(ConstructXMLElementCopy), asCALL_CDECL_OBJLAST);
     engine->RegisterObjectBehaviour("XMLElement", asBEHAVE_DESTRUCT, "void f()", asFUNCTION(DestructXMLElement), asCALL_CDECL_OBJLAST);
     engine->RegisterObjectBehaviour("XMLElement", asBEHAVE_DESTRUCT, "void f()", asFUNCTION(DestructXMLElement), asCALL_CDECL_OBJLAST);
     engine->RegisterObjectMethod("XMLElement", "XMLElement &opAssign(const XMLElement&in)", asMETHOD(XMLElement, operator =), asCALL_THISCALL);
     engine->RegisterObjectMethod("XMLElement", "XMLElement &opAssign(const XMLElement&in)", asMETHOD(XMLElement, operator =), asCALL_THISCALL);
-    engine->RegisterObjectMethod("XMLElement", "XMLElement CreateChildElement(const String&in)", asMETHOD(XMLElement, CreateChildElement), asCALL_THISCALL);
-    engine->RegisterObjectMethod("XMLElement", "bool RemoveChildElement()", asFUNCTION(XMLElementRemoveChildElementDefault), asCALL_CDECL_OBJLAST);
-    engine->RegisterObjectMethod("XMLElement", "bool RemoveChildElement(const String&in, bool)", asMETHOD(XMLElement, RemoveChildElement), asCALL_THISCALL);
-    engine->RegisterObjectMethod("XMLElement", "bool RemoveChildElements()", asFUNCTION(XMLElementRemoveChildElementsDefault), asCALL_CDECL_OBJLAST);
-    engine->RegisterObjectMethod("XMLElement", "bool RemoveChildElements(const String&in)", asMETHOD(XMLElement,RemoveChildElements), asCALL_THISCALL);
+    engine->RegisterObjectMethod("XMLElement", "XMLElement CreateChild(const String&in)", asMETHOD(XMLElement, CreateChild), asCALL_THISCALL);
+    engine->RegisterObjectMethod("XMLElement", "bool RemoveChild()", asFUNCTION(XMLElementRemoveChildDefault), asCALL_CDECL_OBJLAST);
+    engine->RegisterObjectMethod("XMLElement", "bool RemoveChild(const String&in, bool)", asMETHOD(XMLElement, RemoveChild), asCALL_THISCALL);
+    engine->RegisterObjectMethod("XMLElement", "bool RemoveChildren()", asFUNCTION(XMLElementRemoveChildrenDefault), asCALL_CDECL_OBJLAST);
+    engine->RegisterObjectMethod("XMLElement", "bool RemoveChildren(const String&in)", asMETHOD(XMLElement,RemoveChildren), asCALL_THISCALL);
     engine->RegisterObjectMethod("XMLElement", "bool SetAttribute(const String&in, const String&in)", asMETHOD(XMLElement, SetAttribute), asCALL_THISCALL);
     engine->RegisterObjectMethod("XMLElement", "bool SetAttribute(const String&in, const String&in)", asMETHOD(XMLElement, SetAttribute), asCALL_THISCALL);
     engine->RegisterObjectMethod("XMLElement", "bool SetBool(const String&in, bool)", asMETHOD(XMLElement, SetBool), asCALL_THISCALL);
     engine->RegisterObjectMethod("XMLElement", "bool SetBool(const String&in, bool)", asMETHOD(XMLElement, SetBool), asCALL_THISCALL);
     engine->RegisterObjectMethod("XMLElement", "bool SetBoundingBox(const BoundingBox&in)", asMETHOD(XMLElement, SetBoundingBox), asCALL_THISCALL);
     engine->RegisterObjectMethod("XMLElement", "bool SetBoundingBox(const BoundingBox&in)", asMETHOD(XMLElement, SetBoundingBox), asCALL_THISCALL);
@@ -204,11 +204,11 @@ static void RegisterXMLElement(asIScriptEngine* engine)
     engine->RegisterObjectMethod("XMLElement", "bool HasAttribute(const String&in) const", asMETHOD(XMLElement, HasAttribute), asCALL_THISCALL);
     engine->RegisterObjectMethod("XMLElement", "bool HasAttribute(const String&in) const", asMETHOD(XMLElement, HasAttribute), asCALL_THISCALL);
     engine->RegisterObjectMethod("XMLElement", "String GetAttributes(const String&in) const", asMETHOD(XMLElement, GetAttribute), asCALL_THISCALL);
     engine->RegisterObjectMethod("XMLElement", "String GetAttributes(const String&in) const", asMETHOD(XMLElement, GetAttribute), asCALL_THISCALL);
     engine->RegisterObjectMethod("XMLElement", "Array<String>@ GetAttributeNames() const", asFUNCTION(XMLElementGetAttributeNames), asCALL_CDECL_OBJLAST);
     engine->RegisterObjectMethod("XMLElement", "Array<String>@ GetAttributeNames() const", asFUNCTION(XMLElementGetAttributeNames), asCALL_CDECL_OBJLAST);
-    engine->RegisterObjectMethod("XMLElement", "bool HasChildElement(const String&in) const", asMETHOD(XMLElement, HasChildElement), asCALL_THISCALL);
-    engine->RegisterObjectMethod("XMLElement", "XMLElement GetChildElement() const", asFUNCTION(XMLElementGetChildElementDefault), asCALL_CDECL_OBJLAST);
-    engine->RegisterObjectMethod("XMLElement", "XMLElement GetChildElement(const String&in) const", asMETHOD(XMLElement, GetChildElement), asCALL_THISCALL);
-    engine->RegisterObjectMethod("XMLElement", "XMLElement GetNextElement() const", asFUNCTION(XMLElementGetNextElementDefault), asCALL_CDECL_OBJLAST);
-    engine->RegisterObjectMethod("XMLElement", "XMLElement GetNextElement(const String&in) const", asMETHOD(XMLElement, GetNextElement), asCALL_THISCALL);
+    engine->RegisterObjectMethod("XMLElement", "bool HasChild(const String&in) const", asMETHOD(XMLElement, HasChild), asCALL_THISCALL);
+    engine->RegisterObjectMethod("XMLElement", "XMLElement GetChild() const", asFUNCTION(XMLElementGetChildDefault), asCALL_CDECL_OBJLAST);
+    engine->RegisterObjectMethod("XMLElement", "XMLElement GetChild(const String&in) const", asMETHOD(XMLElement, GetChild), asCALL_THISCALL);
+    engine->RegisterObjectMethod("XMLElement", "XMLElement GetNext() const", asFUNCTION(XMLElementGetNextDefault), asCALL_CDECL_OBJLAST);
+    engine->RegisterObjectMethod("XMLElement", "XMLElement GetNext(const String&in) const", asMETHOD(XMLElement, GetNext), asCALL_THISCALL);
     engine->RegisterObjectMethod("XMLElement", "bool GetBool(const String&in) const", asMETHOD(XMLElement, GetBool), asCALL_THISCALL);
     engine->RegisterObjectMethod("XMLElement", "bool GetBool(const String&in) const", asMETHOD(XMLElement, GetBool), asCALL_THISCALL);
     engine->RegisterObjectMethod("XMLElement", "BoundingBox GetBoundingBox() const", asMETHOD(XMLElement, GetBoundingBox), asCALL_THISCALL);
     engine->RegisterObjectMethod("XMLElement", "BoundingBox GetBoundingBox() const", asMETHOD(XMLElement, GetBoundingBox), asCALL_THISCALL);
     engine->RegisterObjectMethod("XMLElement", "Color GetColor(const String&in) const", asMETHOD(XMLElement, GetColor), asCALL_THISCALL);
     engine->RegisterObjectMethod("XMLElement", "Color GetColor(const String&in) const", asMETHOD(XMLElement, GetColor), asCALL_THISCALL);
@@ -230,20 +230,20 @@ static void RegisterXMLElement(asIScriptEngine* engine)
     engine->RegisterObjectMethod("XMLElement", "String get_text() const", asMETHOD(XMLElement, GetText), asCALL_THISCALL);
     engine->RegisterObjectMethod("XMLElement", "String get_text() const", asMETHOD(XMLElement, GetText), asCALL_THISCALL);
     engine->RegisterObjectMethod("XMLElement", "bool get_null() const", asMETHOD(XMLElement, IsNull), asCALL_THISCALL);
     engine->RegisterObjectMethod("XMLElement", "bool get_null() const", asMETHOD(XMLElement, IsNull), asCALL_THISCALL);
     engine->RegisterObjectMethod("XMLElement", "bool get_notNull() const", asMETHOD(XMLElement, NotNull), asCALL_THISCALL);
     engine->RegisterObjectMethod("XMLElement", "bool get_notNull() const", asMETHOD(XMLElement, NotNull), asCALL_THISCALL);
-    engine->RegisterObjectMethod("XMLElement", "XMLElement get_parent() const", asMETHOD(XMLElement, GetParentElement), asCALL_THISCALL);
+    engine->RegisterObjectMethod("XMLElement", "XMLElement get_parent() const", asMETHOD(XMLElement, GetParent), asCALL_THISCALL);
     engine->RegisterObjectMethod("XMLElement", "XMLFile@+ get_file() const", asMETHOD(XMLElement, GetFile), asCALL_THISCALL);
     engine->RegisterObjectMethod("XMLElement", "XMLFile@+ get_file() const", asMETHOD(XMLElement, GetFile), asCALL_THISCALL);
 }
 }
 
 
-static XMLElement XMLFileGetRootElementDefault(XMLFile* ptr)
+static XMLElement XMLFileGetRootDefault(XMLFile* ptr)
 {
 {
-    return ptr->GetRootElement();
+    return ptr->GetRoot();
 }
 }
 
 
 static void RegisterXMLFile(asIScriptEngine* engine)
 static void RegisterXMLFile(asIScriptEngine* engine)
 {
 {
-    engine->RegisterObjectMethod("XMLFile", "XMLElement CreateRootElement(const String&in)", asMETHOD(XMLFile, CreateRootElement), asCALL_THISCALL);
-    engine->RegisterObjectMethod("XMLFile", "XMLElement GetRootElement(const String&in)", asMETHOD(XMLFile, GetRootElement), asCALL_THISCALL);
-    engine->RegisterObjectMethod("XMLFile", "XMLElement get_rootElement()", asFUNCTION(XMLFileGetRootElementDefault), asCALL_CDECL_OBJLAST);
+    engine->RegisterObjectMethod("XMLFile", "XMLElement CreateRoot(const String&in)", asMETHOD(XMLFile, CreateRoot), asCALL_THISCALL);
+    engine->RegisterObjectMethod("XMLFile", "XMLElement GetRoot(const String&in)", asMETHOD(XMLFile, GetRoot), asCALL_THISCALL);
+    engine->RegisterObjectMethod("XMLFile", "XMLElement get_root()", asFUNCTION(XMLFileGetRootDefault), asCALL_CDECL_OBJLAST);
 }
 }
 
 
 void RegisterResourceAPI(asIScriptEngine* engine)
 void RegisterResourceAPI(asIScriptEngine* engine)

+ 2 - 2
Engine/Engine/UIAPI.cpp

@@ -439,11 +439,11 @@ static void RegisterUI(asIScriptEngine* engine)
     engine->RegisterObjectMethod("UI", "UIElement@+ GetElementAt(int, int, bool)", asMETHODPR(UI, GetElementAt, (int, int, bool), UIElement*), asCALL_THISCALL);
     engine->RegisterObjectMethod("UI", "UIElement@+ GetElementAt(int, int, bool)", asMETHODPR(UI, GetElementAt, (int, int, bool), UIElement*), asCALL_THISCALL);
     engine->RegisterObjectMethod("UI", "void set_cursor(Cursor@+)", asMETHOD(UI, SetCursor), asCALL_THISCALL);
     engine->RegisterObjectMethod("UI", "void set_cursor(Cursor@+)", asMETHOD(UI, SetCursor), asCALL_THISCALL);
     engine->RegisterObjectMethod("UI", "Cursor@+ get_cursor() const", asMETHOD(UI, GetCursor), asCALL_THISCALL);
     engine->RegisterObjectMethod("UI", "Cursor@+ get_cursor() const", asMETHOD(UI, GetCursor), asCALL_THISCALL);
+    engine->RegisterObjectMethod("UI", "IntVector2 get_cursorPosition()", asMETHOD(UI, GetCursorPosition), asCALL_THISCALL);
     engine->RegisterObjectMethod("UI", "void set_focusElement(UIElement@+)", asMETHOD(UI, SetFocusElement), asCALL_THISCALL);
     engine->RegisterObjectMethod("UI", "void set_focusElement(UIElement@+)", asMETHOD(UI, SetFocusElement), asCALL_THISCALL);
     engine->RegisterObjectMethod("UI", "UIElement@+ get_focusElement() const", asMETHOD(UI, GetFocusElement), asCALL_THISCALL);
     engine->RegisterObjectMethod("UI", "UIElement@+ get_focusElement() const", asMETHOD(UI, GetFocusElement), asCALL_THISCALL);
-    engine->RegisterObjectMethod("UI", "UIElement@+ get_rootElement() const", asMETHOD(UI, GetRootElement), asCALL_THISCALL);
     engine->RegisterObjectMethod("UI", "UIElement@+ get_frontElement() const", asMETHOD(UI, GetFrontElement), asCALL_THISCALL);
     engine->RegisterObjectMethod("UI", "UIElement@+ get_frontElement() const", asMETHOD(UI, GetFrontElement), asCALL_THISCALL);
-    engine->RegisterObjectMethod("UI", "IntVector2 get_cursorPosition()", asMETHOD(UI, GetCursorPosition), asCALL_THISCALL);
+    engine->RegisterObjectMethod("UI", "UIElement@+ get_root() const", asMETHOD(UI, GetRoot), asCALL_THISCALL);
     engine->RegisterGlobalFunction("UI@+ get_ui()", asFUNCTION(GetUI), asCALL_CDECL);
     engine->RegisterGlobalFunction("UI@+ get_ui()", asFUNCTION(GetUI), asCALL_CDECL);
 }
 }
 
 

+ 3 - 3
Engine/Graphics/Direct3D9/D3D9Texture.cpp

@@ -217,8 +217,8 @@ void Texture::LoadParameters(XMLFile* file)
     if (!file)
     if (!file)
         return;
         return;
     
     
-    XMLElement rootElem = file->GetRootElement();
-    XMLElement paramElem = rootElem.GetChildElement("");
+    XMLElement rootElem = file->GetRoot();
+    XMLElement paramElem = rootElem.GetChild("");
     
     
     while (paramElem)
     while (paramElem)
     {
     {
@@ -266,7 +266,7 @@ void Texture::LoadParameters(XMLFile* file)
             }
             }
         }
         }
         
         
-        paramElem = paramElem.GetNextElement();
+        paramElem = paramElem.GetNext();
     }
     }
 }
 }
 
 

+ 3 - 3
Engine/Graphics/Direct3D9/D3D9TextureCube.cpp

@@ -279,8 +279,8 @@ bool TextureCube::Load(Deserializer& source)
     
     
     LoadParameters(xml);
     LoadParameters(xml);
     
     
-    XMLElement textureElem = xml->GetRootElement();
-    XMLElement faceElem = textureElem.GetChildElement("face");
+    XMLElement textureElem = xml->GetRoot();
+    XMLElement faceElem = textureElem.GetChild("face");
     unsigned faces = 0;
     unsigned faces = 0;
     while (faceElem && faces < MAX_CUBEMAP_FACES)
     while (faceElem && faces < MAX_CUBEMAP_FACES)
     {
     {
@@ -296,7 +296,7 @@ bool TextureCube::Load(Deserializer& source)
         Load((CubeMapFace)faces, image);
         Load((CubeMapFace)faces, image);
         faces++;
         faces++;
         
         
-        faceElem = faceElem.GetNextElement("face");
+        faceElem = faceElem.GetNext("face");
     }
     }
     
     
     return true;
     return true;

+ 13 - 13
Engine/Graphics/Material.cpp

@@ -118,9 +118,9 @@ bool Material::Load(Deserializer& source)
     if (!xml->Load(source))
     if (!xml->Load(source))
         return false;
         return false;
     
     
-    XMLElement rootElem = xml->GetRootElement();
+    XMLElement rootElem = xml->GetRoot();
     
     
-    XMLElement techniqueElem = rootElem.GetChildElement("technique");
+    XMLElement techniqueElem = rootElem.GetChild("technique");
     techniques_.Clear();
     techniques_.Clear();
     while (techniqueElem)
     while (techniqueElem)
     {
     {
@@ -135,10 +135,10 @@ bool Material::Load(Deserializer& source)
                 newTechnique.lodDistance_ = techniqueElem.GetFloat("loddistance");
                 newTechnique.lodDistance_ = techniqueElem.GetFloat("loddistance");
             techniques_.Push(newTechnique);
             techniques_.Push(newTechnique);
         }
         }
-        techniqueElem = techniqueElem.GetNextElement("technique");
+        techniqueElem = techniqueElem.GetNext("technique");
     }
     }
     
     
-    XMLElement textureElem = rootElem.GetChildElement("texture");
+    XMLElement textureElem = rootElem.GetChild("texture");
     while (textureElem)
     while (textureElem)
     {
     {
         TextureUnit unit = TU_DIFFUSE;
         TextureUnit unit = TU_DIFFUSE;
@@ -166,24 +166,24 @@ bool Material::Load(Deserializer& source)
             else
             else
                 SetTexture(unit, cache->GetResource<Texture2D>(name));
                 SetTexture(unit, cache->GetResource<Texture2D>(name));
         }
         }
-        textureElem = textureElem.GetNextElement("texture");
+        textureElem = textureElem.GetNext("texture");
     }
     }
     
     
-    XMLElement parameterElem = rootElem.GetChildElement("parameter");
+    XMLElement parameterElem = rootElem.GetChild("parameter");
     while (parameterElem)
     while (parameterElem)
     {
     {
         String name = parameterElem.GetString("name");
         String name = parameterElem.GetString("name");
         Vector4 value = parameterElem.GetVector("value");
         Vector4 value = parameterElem.GetVector("value");
         SetShaderParameter(name, value);
         SetShaderParameter(name, value);
         
         
-        parameterElem = parameterElem.GetNextElement("parameter");
+        parameterElem = parameterElem.GetNext("parameter");
     }
     }
     
     
-    XMLElement cullElem = rootElem.GetChildElement("cull");
+    XMLElement cullElem = rootElem.GetChild("cull");
     if (cullElem)
     if (cullElem)
         SetCullMode((CullMode)GetStringListIndex(cullElem.GetString("value"), cullModeNames, CULL_CCW));
         SetCullMode((CullMode)GetStringListIndex(cullElem.GetString("value"), cullModeNames, CULL_CCW));
     
     
-    XMLElement shadowCullElem = rootElem.GetChildElement("shadowcull");
+    XMLElement shadowCullElem = rootElem.GetChild("shadowcull");
     if (shadowCullElem)
     if (shadowCullElem)
         SetShadowCullMode((CullMode)GetStringListIndex(shadowCullElem.GetString("value"), cullModeNames, CULL_CCW));
         SetShadowCullMode((CullMode)GetStringListIndex(shadowCullElem.GetString("value"), cullModeNames, CULL_CCW));
     
     
@@ -206,7 +206,7 @@ bool Material::Save(Serializer& dest)
         return false;
         return false;
     
     
     SharedPtr<XMLFile> xml(new XMLFile(context_));
     SharedPtr<XMLFile> xml(new XMLFile(context_));
-    XMLElement materialElem = xml->CreateRootElement("material");
+    XMLElement materialElem = xml->CreateRoot("material");
     
     
     // Write techniques
     // Write techniques
     for (unsigned i = 0; i < techniques_.Size(); ++i)
     for (unsigned i = 0; i < techniques_.Size(); ++i)
@@ -215,7 +215,7 @@ bool Material::Save(Serializer& dest)
         if (!entry.technique_)
         if (!entry.technique_)
             continue;
             continue;
         
         
-        XMLElement techniqueElem = materialElem.CreateChildElement("technique");
+        XMLElement techniqueElem = materialElem.CreateChild("technique");
         techniqueElem.SetString("name", entry.technique_->GetName());
         techniqueElem.SetString("name", entry.technique_->GetName());
         techniqueElem.SetInt("quality", entry.qualityLevel_);
         techniqueElem.SetInt("quality", entry.qualityLevel_);
         techniqueElem.SetFloat("loddistance", entry.lodDistance_);
         techniqueElem.SetFloat("loddistance", entry.lodDistance_);
@@ -227,7 +227,7 @@ bool Material::Save(Serializer& dest)
         Texture* texture = GetTexture((TextureUnit)j);
         Texture* texture = GetTexture((TextureUnit)j);
         if (texture)
         if (texture)
         {
         {
-            XMLElement textureElem = materialElem.CreateChildElement("texture");
+            XMLElement textureElem = materialElem.CreateChild("texture");
             textureElem.SetString("unit", textureUnitNames[j]);
             textureElem.SetString("unit", textureUnitNames[j]);
             textureElem.SetString("name", texture->GetName());
             textureElem.SetString("name", texture->GetName());
         }
         }
@@ -236,7 +236,7 @@ bool Material::Save(Serializer& dest)
     // Write shader parameters
     // Write shader parameters
     for (HashMap<StringHash, MaterialShaderParameter>::ConstIterator j = shaderParameters_.Begin(); j != shaderParameters_.End(); ++j)
     for (HashMap<StringHash, MaterialShaderParameter>::ConstIterator j = shaderParameters_.Begin(); j != shaderParameters_.End(); ++j)
     {
     {
-        XMLElement parameterElem = materialElem.CreateChildElement("parameter");
+        XMLElement parameterElem = materialElem.CreateChild("parameter");
         parameterElem.SetString("name", j->second_.name_);
         parameterElem.SetString("name", j->second_.name_);
         parameterElem.SetVector4("value", j->second_.value_);
         parameterElem.SetVector4("value", j->second_.value_);
     }
     }

+ 49 - 49
Engine/Graphics/ParticleEmitter.cpp

@@ -294,31 +294,31 @@ bool ParticleEmitter::LoadParameters(XMLFile* file)
         return false;
         return false;
     
     
     parameterSource_ = file;
     parameterSource_ = file;
-    XMLElement rootElem = parameterSource_->GetRootElement();
+    XMLElement rootElem = parameterSource_->GetRoot();
     if (!rootElem)
     if (!rootElem)
         return false;
         return false;
     
     
-    if (rootElem.HasChildElement("material"))
-        SetMaterial(cache->GetResource<Material>(rootElem.GetChildElement("material").GetString("name")));
+    if (rootElem.HasChild("material"))
+        SetMaterial(cache->GetResource<Material>(rootElem.GetChild("material").GetString("name")));
     
     
-    if (rootElem.HasChildElement("numparticles"))
-        SetNumParticles(rootElem.GetChildElement("numparticles").GetInt("value"));
+    if (rootElem.HasChild("numparticles"))
+        SetNumParticles(rootElem.GetChild("numparticles").GetInt("value"));
     
     
-    if (rootElem.HasChildElement("sorted"))
-        sorted_ = rootElem.GetChildElement("sorted").GetBool("enable");
+    if (rootElem.HasChild("sorted"))
+        sorted_ = rootElem.GetChild("sorted").GetBool("enable");
     
     
-    if (rootElem.HasChildElement("updateinvisible"))
-        updateInvisible_ = rootElem.GetChildElement("updateinvisible").GetBool("enable");
+    if (rootElem.HasChild("updateinvisible"))
+        updateInvisible_ = rootElem.GetChild("updateinvisible").GetBool("enable");
     
     
-    if (rootElem.HasChildElement("relative"))
-        relative_ = rootElem.GetChildElement("relative").GetBool("enable");
+    if (rootElem.HasChild("relative"))
+        relative_ = rootElem.GetChild("relative").GetBool("enable");
     
     
-    if (rootElem.HasChildElement("animlodbias"))
-        SetAnimationLodBias(rootElem.GetChildElement("relative").GetFloat("value"));
+    if (rootElem.HasChild("animlodbias"))
+        SetAnimationLodBias(rootElem.GetChild("relative").GetFloat("value"));
     
     
-    if (rootElem.HasChildElement("emittertype"))
+    if (rootElem.HasChild("emittertype"))
     {
     {
-        String type = rootElem.GetChildElement("emittertype").GetStringLower("value");
+        String type = rootElem.GetChild("emittertype").GetStringLower("value");
         if (type == "point")
         if (type == "point")
             emitterType_ = EMITTER_POINT;
             emitterType_ = EMITTER_POINT;
         else if (type == "box")
         else if (type == "box")
@@ -329,62 +329,62 @@ bool ParticleEmitter::LoadParameters(XMLFile* file)
             LOGERROR("Unknown particle emitter type " + type);
             LOGERROR("Unknown particle emitter type " + type);
     }
     }
     
     
-    if (rootElem.HasChildElement("emittersize"))
-        emitterSize_ = rootElem.GetChildElement("emittersize").GetVector3("value");
+    if (rootElem.HasChild("emittersize"))
+        emitterSize_ = rootElem.GetChild("emittersize").GetVector3("value");
     
     
-    if (rootElem.HasChildElement("direction"))
-        GetVector3MinMax(rootElem.GetChildElement("direction"), directionMin_, directionMax_);
+    if (rootElem.HasChild("direction"))
+        GetVector3MinMax(rootElem.GetChild("direction"), directionMin_, directionMax_);
     
     
-    if (rootElem.HasChildElement("constantforce"))
-        constanceForce_ = rootElem.GetChildElement("constantforce").GetVector3("value");
+    if (rootElem.HasChild("constantforce"))
+        constanceForce_ = rootElem.GetChild("constantforce").GetVector3("value");
     
     
-    if (rootElem.HasChildElement("dampingforce"))
-        dampingForce_ = rootElem.GetChildElement("dampingforce").GetFloat("value");
+    if (rootElem.HasChild("dampingforce"))
+        dampingForce_ = rootElem.GetChild("dampingforce").GetFloat("value");
     
     
-    if (rootElem.HasChildElement("activetime"))
-        activeTime_ = rootElem.GetChildElement("activetime").GetFloat("value");
+    if (rootElem.HasChild("activetime"))
+        activeTime_ = rootElem.GetChild("activetime").GetFloat("value");
     if (activeTime_ < 0.0f)
     if (activeTime_ < 0.0f)
         activeTime_ = M_INFINITY;
         activeTime_ = M_INFINITY;
     
     
-    if (rootElem.HasChildElement("inactivetime"))
-        inactiveTime_ = rootElem.GetChildElement("inactivetime").GetFloat("value");
+    if (rootElem.HasChild("inactivetime"))
+        inactiveTime_ = rootElem.GetChild("inactivetime").GetFloat("value");
     if (inactiveTime_ < 0.0f)
     if (inactiveTime_ < 0.0f)
         inactiveTime_ = M_INFINITY;
         inactiveTime_ = M_INFINITY;
     
     
-    if (rootElem.HasChildElement("interval"))
-        GetFloatMinMax(rootElem.GetChildElement("interval"), intervalMin_, intervalMax_);
+    if (rootElem.HasChild("interval"))
+        GetFloatMinMax(rootElem.GetChild("interval"), intervalMin_, intervalMax_);
     
     
-    if (rootElem.HasChildElement("particlesize"))
-        GetVector2MinMax(rootElem.GetChildElement("particlesize"), sizeMin_, sizeMax_);
+    if (rootElem.HasChild("particlesize"))
+        GetVector2MinMax(rootElem.GetChild("particlesize"), sizeMin_, sizeMax_);
     
     
-    if (rootElem.HasChildElement("timetolive"))
-        GetFloatMinMax(rootElem.GetChildElement("timetolive"), timeToLiveMin_, timeToLiveMax_);
+    if (rootElem.HasChild("timetolive"))
+        GetFloatMinMax(rootElem.GetChild("timetolive"), timeToLiveMin_, timeToLiveMax_);
     
     
-    if (rootElem.HasChildElement("velocity"))
-        GetFloatMinMax(rootElem.GetChildElement("velocity"), velocityMin_, velocityMax_);
+    if (rootElem.HasChild("velocity"))
+        GetFloatMinMax(rootElem.GetChild("velocity"), velocityMin_, velocityMax_);
     
     
-    if (rootElem.HasChildElement("rotation"))
-        GetFloatMinMax(rootElem.GetChildElement("rotation"), rotationMin_, rotationMax_);
+    if (rootElem.HasChild("rotation"))
+        GetFloatMinMax(rootElem.GetChild("rotation"), rotationMin_, rotationMax_);
     
     
-    if (rootElem.HasChildElement("rotationspeed"))
-        GetFloatMinMax(rootElem.GetChildElement("rotationspeed"), rotationSpeedMin_, rotationSpeedMax_);
+    if (rootElem.HasChild("rotationspeed"))
+        GetFloatMinMax(rootElem.GetChild("rotationspeed"), rotationSpeedMin_, rotationSpeedMax_);
     
     
-    if (rootElem.HasChildElement("sizedelta"))
+    if (rootElem.HasChild("sizedelta"))
     {
     {
-        XMLElement deltaElem = rootElem.GetChildElement("sizedelta");
+        XMLElement deltaElem = rootElem.GetChild("sizedelta");
         if (deltaElem.HasAttribute("add"))
         if (deltaElem.HasAttribute("add"))
             sizeAdd_ = deltaElem.GetFloat("add");
             sizeAdd_ = deltaElem.GetFloat("add");
         if (deltaElem.HasAttribute("mul"))
         if (deltaElem.HasAttribute("mul"))
             sizeMul_ = deltaElem.GetFloat("mul");
             sizeMul_ = deltaElem.GetFloat("mul");
     }
     }
     
     
-    if (rootElem.HasChildElement("color"))
-        SetParticleColor(rootElem.GetChildElement("color").GetColor("value"));
+    if (rootElem.HasChild("color"))
+        SetParticleColor(rootElem.GetChild("color").GetColor("value"));
     
     
-    if (rootElem.HasChildElement("colorfade"))
+    if (rootElem.HasChild("colorfade"))
     {
     {
         Vector<ColorFade> fades;
         Vector<ColorFade> fades;
-        XMLElement colorFadeElem = rootElem.GetChildElement("colorfade");
+        XMLElement colorFadeElem = rootElem.GetChild("colorfade");
         while (colorFadeElem)
         while (colorFadeElem)
         {
         {
             ColorFade fade;
             ColorFade fade;
@@ -392,22 +392,22 @@ bool ParticleEmitter::LoadParameters(XMLFile* file)
             fade.time_ = colorFadeElem.GetFloat("time");
             fade.time_ = colorFadeElem.GetFloat("time");
             fades.Push(fade);
             fades.Push(fade);
             
             
-            colorFadeElem = colorFadeElem.GetNextElement("colorfade");
+            colorFadeElem = colorFadeElem.GetNext("colorfade");
         }
         }
         SetParticleColors(fades);
         SetParticleColors(fades);
     }
     }
     
     
-    if (rootElem.HasChildElement("texanim"))
+    if (rootElem.HasChild("texanim"))
     {
     {
         Vector<TextureAnimation> animations;
         Vector<TextureAnimation> animations;
-        XMLElement animElem = rootElem.GetChildElement("texanim");
+        XMLElement animElem = rootElem.GetChild("texanim");
         while (animElem)
         while (animElem)
         {
         {
             TextureAnimation animation;
             TextureAnimation animation;
             animation.uv_ = animElem.GetRect("uv");
             animation.uv_ = animElem.GetRect("uv");
             animation.time_ = animElem.GetFloat("time");
             animation.time_ = animElem.GetFloat("time");
             animations.Push(animation);
             animations.Push(animation);
-            animElem = animElem.GetNextElement("texanim");
+            animElem = animElem.GetNext("texanim");
         }
         }
         textureAnimation_ = animations;
         textureAnimation_ = animations;
     }
     }

+ 3 - 3
Engine/Graphics/Technique.cpp

@@ -153,11 +153,11 @@ bool Technique::Load(Deserializer& source)
     if (!xml->Load(source))
     if (!xml->Load(source))
         return false;
         return false;
     
     
-    XMLElement rootElem = xml->GetRootElement();
+    XMLElement rootElem = xml->GetRoot();
     if (rootElem.HasAttribute("sm3"))
     if (rootElem.HasAttribute("sm3"))
         isSM3_ = rootElem.GetBool("sm3");
         isSM3_ = rootElem.GetBool("sm3");
     
     
-    XMLElement passElem = rootElem.GetChildElement("pass");
+    XMLElement passElem = rootElem.GetChild("pass");
     while (passElem)
     while (passElem)
     {
     {
         PassType type = MAX_PASSES;
         PassType type = MAX_PASSES;
@@ -206,7 +206,7 @@ bool Technique::Load(Deserializer& source)
                 newPass.SetDepthWrite(passElem.GetBool("depthwrite"));
                 newPass.SetDepthWrite(passElem.GetBool("depthwrite"));
         }
         }
         
         
-        passElem = passElem.GetNextElement("pass");
+        passElem = passElem.GetNext("pass");
     }
     }
     
     
     // Calculate memory use
     // Calculate memory use

+ 15 - 15
Engine/Resource/XMLElement.cpp

@@ -50,7 +50,7 @@ XMLElement::~XMLElement()
 {
 {
 }
 }
 
 
-XMLElement XMLElement::CreateChildElement(const String& name)
+XMLElement XMLElement::CreateChild(const String& name)
 {
 {
     if (!file_ || !element_)
     if (!file_ || !element_)
         return XMLElement();
         return XMLElement();
@@ -60,7 +60,7 @@ XMLElement XMLElement::CreateChildElement(const String& name)
     return XMLElement(file_, static_cast<TiXmlElement*>(element_->LastChild()));
     return XMLElement(file_, static_cast<TiXmlElement*>(element_->LastChild()));
 }
 }
 
 
-bool XMLElement::RemoveChildElement(const String& name, bool last)
+bool XMLElement::RemoveChild(const String& name, bool last)
 {
 {
     if (!file_ || !element_)
     if (!file_ || !element_)
         return false;
         return false;
@@ -90,7 +90,7 @@ bool XMLElement::RemoveChildElement(const String& name, bool last)
     return false;
     return false;
 }
 }
 
 
-bool XMLElement::RemoveChildElements(const String& name)
+bool XMLElement::RemoveChildren(const String& name)
 {
 {
     if (!file_ || !element_)
     if (!file_ || !element_)
         return false;
         return false;
@@ -250,12 +250,12 @@ bool XMLElement::SetResourceRefList(const ResourceRefList& value)
 bool XMLElement::SetVariantVector(const VariantVector& value)
 bool XMLElement::SetVariantVector(const VariantVector& value)
 {
 {
     // Must remove all existing variant child elements (if they exist) to not cause confusion
     // Must remove all existing variant child elements (if they exist) to not cause confusion
-    if (!RemoveChildElements("variant"))
+    if (!RemoveChildren("variant"))
         return false;
         return false;
     
     
     for (VariantVector::ConstIterator i = value.Begin(); i != value.End(); ++i)
     for (VariantVector::ConstIterator i = value.Begin(); i != value.End(); ++i)
     {
     {
-        XMLElement variantElem = CreateChildElement("variant");
+        XMLElement variantElem = CreateChild("variant");
         if (!variantElem)
         if (!variantElem)
             return false;
             return false;
         variantElem.SetVariant(*i);
         variantElem.SetVariant(*i);
@@ -266,12 +266,12 @@ bool XMLElement::SetVariantVector(const VariantVector& value)
 
 
 bool XMLElement::SetVariantMap(const VariantMap& value)
 bool XMLElement::SetVariantMap(const VariantMap& value)
 {
 {
-    if (!RemoveChildElements("variant"))
+    if (!RemoveChildren("variant"))
         return false;
         return false;
     
     
     for (VariantMap::ConstIterator i = value.Begin(); i != value.End(); ++i)
     for (VariantMap::ConstIterator i = value.Begin(); i != value.End(); ++i)
     {
     {
-        XMLElement variantElem = CreateChildElement("variant");
+        XMLElement variantElem = CreateChild("variant");
         if (!variantElem)
         if (!variantElem)
             return false;
             return false;
         variantElem.SetInt("hash", i->first_.GetValue());
         variantElem.SetInt("hash", i->first_.GetValue());
@@ -316,7 +316,7 @@ String XMLElement::GetText() const
         return String();
         return String();
 }
 }
 
 
-bool XMLElement::HasChildElement(const String& name) const
+bool XMLElement::HasChild(const String& name) const
 {
 {
     if (!file_ || !element_)
     if (!file_ || !element_)
         return false;
         return false;
@@ -327,7 +327,7 @@ bool XMLElement::HasChildElement(const String& name) const
         return false;
         return false;
 }
 }
 
 
-XMLElement XMLElement::GetChildElement(const String& name) const
+XMLElement XMLElement::GetChild(const String& name) const
 {
 {
     if (!file_ || !element_)
     if (!file_ || !element_)
         return XMLElement();
         return XMLElement();
@@ -340,7 +340,7 @@ XMLElement XMLElement::GetChildElement(const String& name) const
     }
     }
 }
 }
 
 
-XMLElement XMLElement::GetNextElement(const String& name) const
+XMLElement XMLElement::GetNext(const String& name) const
 {
 {
     if (!file_ || !element_)
     if (!file_ || !element_)
         return XMLElement();
         return XMLElement();
@@ -351,7 +351,7 @@ XMLElement XMLElement::GetNextElement(const String& name) const
         return XMLElement(file_, element_->NextSiblingElement(name.CString()));
         return XMLElement(file_, element_->NextSiblingElement(name.CString()));
 }
 }
 
 
-XMLElement XMLElement::GetParentElement() const
+XMLElement XMLElement::GetParent() const
 {
 {
     if (!file_ || !element_)
     if (!file_ || !element_)
         return XMLElement();
         return XMLElement();
@@ -561,11 +561,11 @@ VariantVector XMLElement::GetVariantVector() const
 {
 {
     VariantVector ret;
     VariantVector ret;
     
     
-    XMLElement variantElem = GetChildElement("variant");
+    XMLElement variantElem = GetChild("variant");
     while (variantElem)
     while (variantElem)
     {
     {
         ret.Push(variantElem.GetVariant());
         ret.Push(variantElem.GetVariant());
-        variantElem = variantElem.GetNextElement("variant");
+        variantElem = variantElem.GetNext("variant");
     }
     }
     
     
     return ret;
     return ret;
@@ -575,12 +575,12 @@ VariantMap XMLElement::GetVariantMap() const
 {
 {
     VariantMap ret;
     VariantMap ret;
     
     
-    XMLElement variantElem = GetChildElement("variant");
+    XMLElement variantElem = GetChild("variant");
     while (variantElem)
     while (variantElem)
     {
     {
         ShortStringHash key(variantElem.GetInt("hash"));
         ShortStringHash key(variantElem.GetInt("hash"));
         ret[key] = variantElem.GetVariant();
         ret[key] = variantElem.GetVariant();
-        variantElem = variantElem.GetNextElement("variant");
+        variantElem = variantElem.GetNext("variant");
     }
     }
     
     
     return ret;
     return ret;

+ 7 - 7
Engine/Resource/XMLElement.h

@@ -45,11 +45,11 @@ public:
     ~XMLElement();
     ~XMLElement();
     
     
     /// Create a child element
     /// Create a child element
-    XMLElement CreateChildElement(const String& name);
+    XMLElement CreateChild(const String& name);
     /// Remove a child element, either first or last of them if several exist
     /// Remove a child element, either first or last of them if several exist
-    bool RemoveChildElement(const String& name = String(), bool last = true);
+    bool RemoveChild(const String& name = String(), bool last = true);
     /// Remove child elements of certain name, or all child elements if name is empty
     /// Remove child elements of certain name, or all child elements if name is empty
-    bool RemoveChildElements(const String& name = String());
+    bool RemoveChildren(const String& name = String());
     /// Set an attribute
     /// Set an attribute
     bool SetAttribute(const String& name, const String& value);
     bool SetAttribute(const String& name, const String& value);
     /// Set a bool attribute
     /// Set a bool attribute
@@ -104,13 +104,13 @@ public:
     /// Return element contents
     /// Return element contents
     String GetText() const;
     String GetText() const;
     /// Return whether has a child element
     /// Return whether has a child element
-    bool HasChildElement(const String& name) const;
+    bool HasChild(const String& name) const;
     /// Return child element, or null if missing
     /// Return child element, or null if missing
-    XMLElement GetChildElement(const String& name = String()) const;
+    XMLElement GetChild(const String& name = String()) const;
     /// Return next sibling element
     /// Return next sibling element
-    XMLElement GetNextElement(const String& name = String()) const;
+    XMLElement GetNext(const String& name = String()) const;
     /// Return parent element
     /// Return parent element
-    XMLElement GetParentElement() const;
+    XMLElement GetParent() const;
     /// Return number of attributes
     /// Return number of attributes
     unsigned GetNumAttributes() const;
     unsigned GetNumAttributes() const;
     /// Return whether has an attribute
     /// Return whether has an attribute

+ 3 - 3
Engine/Resource/XMLFile.cpp

@@ -97,15 +97,15 @@ bool XMLFile::Save(Serializer& dest)
     return true;
     return true;
 }
 }
 
 
-XMLElement XMLFile::CreateRootElement(const String& name)
+XMLElement XMLFile::CreateRoot(const String& name)
 {
 {
     TiXmlElement newRoot(name.CString());
     TiXmlElement newRoot(name.CString());
     document_->Clear();
     document_->Clear();
     document_->InsertEndChild(newRoot);
     document_->InsertEndChild(newRoot);
-    return GetRootElement();
+    return GetRoot();
 }
 }
 
 
-XMLElement XMLFile::GetRootElement(const String& name)
+XMLElement XMLFile::GetRoot(const String& name)
 {
 {
     XMLElement rootElem = XMLElement(this, document_->RootElement());
     XMLElement rootElem = XMLElement(this, document_->RootElement());
     
     

+ 2 - 2
Engine/Resource/XMLFile.h

@@ -47,10 +47,10 @@ public:
     virtual bool Save(Serializer& dest);
     virtual bool Save(Serializer& dest);
     
     
     /// Clear the document and create a root element
     /// Clear the document and create a root element
-    XMLElement CreateRootElement(const String& name);
+    XMLElement CreateRoot(const String& name);
     
     
     /// Return the root element, with optionally specified name. Return null element if not found
     /// Return the root element, with optionally specified name. Return null element if not found
-    XMLElement GetRootElement(const String& name = String());
+    XMLElement GetRoot(const String& name = String());
     /// Return the TinyXML document
     /// Return the TinyXML document
     TiXmlDocument* GetDocument() const { return document_; }
     TiXmlDocument* GetDocument() const { return document_; }
     
     

+ 6 - 6
Engine/Scene/Node.cpp

@@ -163,7 +163,7 @@ bool Node::SaveXML(XMLElement& dest)
     for (unsigned i = 0; i < components_.Size(); ++i)
     for (unsigned i = 0; i < components_.Size(); ++i)
     {
     {
         Component* component = components_[i];
         Component* component = components_[i];
-        XMLElement compElem = dest.CreateChildElement("component");
+        XMLElement compElem = dest.CreateChild("component");
         
         
         compElem.SetString("type", component->GetTypeName());
         compElem.SetString("type", component->GetTypeName());
         compElem.SetInt("id", component->GetID());
         compElem.SetInt("id", component->GetID());
@@ -174,7 +174,7 @@ bool Node::SaveXML(XMLElement& dest)
     for (unsigned i = 0; i < children_.Size(); ++i)
     for (unsigned i = 0; i < children_.Size(); ++i)
     {
     {
         Node* node = children_[i];
         Node* node = children_[i];
-        XMLElement childElem = dest.CreateChildElement("node");
+        XMLElement childElem = dest.CreateChild("node");
         
         
         childElem.SetInt("id", node->GetID());
         childElem.SetInt("id", node->GetID());
         if (!node->SaveXML(childElem))
         if (!node->SaveXML(childElem))
@@ -660,7 +660,7 @@ bool Node::LoadXML(const XMLElement& source, bool readChildren)
     if (!Serializable::LoadXML(source))
     if (!Serializable::LoadXML(source))
         return false;
         return false;
     
     
-    XMLElement compElem = source.GetChildElement("component");
+    XMLElement compElem = source.GetChild("component");
     while (compElem)
     while (compElem)
     {
     {
         String typeName = compElem.GetString("type");
         String typeName = compElem.GetString("type");
@@ -671,20 +671,20 @@ bool Node::LoadXML(const XMLElement& source, bool readChildren)
                 return false;
                 return false;
         }
         }
         
         
-        compElem = compElem.GetNextElement("component");
+        compElem = compElem.GetNext("component");
     }
     }
     
     
     if (!readChildren)
     if (!readChildren)
         return true;
         return true;
     
     
-    XMLElement childElem = source.GetChildElement("node");
+    XMLElement childElem = source.GetChild("node");
     while (childElem)
     while (childElem)
     {
     {
         Node* newNode = CreateChild(childElem.GetInt("id"), false);
         Node* newNode = CreateChild(childElem.GetInt("id"), false);
         if (!newNode->LoadXML(childElem))
         if (!newNode->LoadXML(childElem))
             return false;
             return false;
         
         
-        childElem = childElem.GetNextElement("node");
+        childElem = childElem.GetNext("node");
     }
     }
     
     
     return true;
     return true;

+ 6 - 6
Engine/Scene/Scene.cpp

@@ -160,7 +160,7 @@ bool Scene::LoadXML(Deserializer& source)
         return false;
         return false;
     
     
     // Load the whole scene, then perform post-load if successfully loaded
     // Load the whole scene, then perform post-load if successfully loaded
-    if (Node::LoadXML(xml->GetRootElement()))
+    if (Node::LoadXML(xml->GetRoot()))
     {
     {
         FinishLoading(&source);
         FinishLoading(&source);
         return true;
         return true;
@@ -172,7 +172,7 @@ bool Scene::LoadXML(Deserializer& source)
 bool Scene::SaveXML(Serializer& dest)
 bool Scene::SaveXML(Serializer& dest)
 {
 {
     SharedPtr<XMLFile> xml(new XMLFile(context_));
     SharedPtr<XMLFile> xml(new XMLFile(context_));
-    XMLElement rootElem = xml->CreateRootElement("scene");
+    XMLElement rootElem = xml->CreateRoot("scene");
     if (!SaveXML(rootElem))
     if (!SaveXML(rootElem))
         return false;
         return false;
     
     
@@ -228,12 +228,12 @@ bool Scene::LoadAsyncXML(File* file)
     
     
     // Clear the previous scene and load the root level components first
     // Clear the previous scene and load the root level components first
     Clear();
     Clear();
-    XMLElement rootElement = xmlFile->GetRootElement();
+    XMLElement rootElement = xmlFile->GetRoot();
     if (!Node::LoadXML(rootElement, false))
     if (!Node::LoadXML(rootElement, false))
         return false;
         return false;
     
     
     // Then prepare for loading all root level child nodes in the async update
     // Then prepare for loading all root level child nodes in the async update
-    XMLElement childNodeElement = rootElement.GetChildElement("node");
+    XMLElement childNodeElement = rootElement.GetChild("node");
     asyncLoading_ = true;
     asyncLoading_ = true;
     asyncProgress_.file_ = file;
     asyncProgress_.file_ = file;
     asyncProgress_.xmlFile_ = xmlFile;
     asyncProgress_.xmlFile_ = xmlFile;
@@ -245,7 +245,7 @@ bool Scene::LoadAsyncXML(File* file)
     while (childNodeElement)
     while (childNodeElement)
     {
     {
         ++asyncProgress_.totalNodes_;
         ++asyncProgress_.totalNodes_;
-        childNodeElement = childNodeElement.GetNextElement("node");
+        childNodeElement = childNodeElement.GetNext("node");
     }
     }
     
     
     return true;
     return true;
@@ -471,7 +471,7 @@ void Scene::UpdateAsyncLoading()
         {
         {
             Node* newNode = CreateChild(asyncProgress_.xmlElement_.GetInt("id"), false);
             Node* newNode = CreateChild(asyncProgress_.xmlElement_.GetInt("id"), false);
             newNode->LoadXML(asyncProgress_.xmlElement_);
             newNode->LoadXML(asyncProgress_.xmlElement_);
-            asyncProgress_.xmlElement_ = asyncProgress_.xmlElement_.GetNextElement("node");
+            asyncProgress_.xmlElement_ = asyncProgress_.xmlElement_.GetNext("node");
         }
         }
         
         
         ++asyncProgress_.loadedNodes_;
         ++asyncProgress_.loadedNodes_;

+ 3 - 3
Engine/Scene/Serializable.cpp

@@ -257,7 +257,7 @@ bool Serializable::LoadXML(const XMLElement& source)
             continue;
             continue;
         
         
         // We could assume fixed order. However, do name-based lookup instead for more robustness
         // We could assume fixed order. However, do name-based lookup instead for more robustness
-        XMLElement attrElem = source.GetChildElement("attribute");
+        XMLElement attrElem = source.GetChild("attribute");
         bool found = false;
         bool found = false;
         while (attrElem)
         while (attrElem)
         {
         {
@@ -292,7 +292,7 @@ bool Serializable::LoadXML(const XMLElement& source)
                 break;
                 break;
             }
             }
             
             
-            attrElem = attrElem.GetNextElement("attribute");
+            attrElem = attrElem.GetNext("attribute");
         }
         }
         
         
         if (!found)
         if (!found)
@@ -323,7 +323,7 @@ bool Serializable::SaveXML(XMLElement& dest)
         if (!(attr.mode_ & AM_SERIALIZATION))
         if (!(attr.mode_ & AM_SERIALIZATION))
             continue;
             continue;
         
         
-        XMLElement attrElem = dest.CreateChildElement("attribute");
+        XMLElement attrElem = dest.CreateChild("attribute");
         attrElem.SetString("name", String(attr.name_));
         attrElem.SetString("name", String(attr.name_));
         // If enums specified, set as an enum string. Otherwise set directly as a Variant
         // If enums specified, set as an enum string. Otherwise set directly as a Variant
         if (attr.enumNames_)
         if (attr.enumNames_)

+ 8 - 8
Engine/UI/BorderImage.cpp

@@ -52,18 +52,18 @@ void BorderImage::SetStyle(const XMLElement& element)
 {
 {
     UIElement::SetStyle(element);
     UIElement::SetStyle(element);
     
     
-    if (element.HasChildElement("texture"))
-        SetTexture(GetSubsystem<ResourceCache>()->GetResource<Texture2D>(element.GetChildElement("texture").GetString("name")));
-    if (element.HasChildElement("imagerect"))
+    if (element.HasChild("texture"))
+        SetTexture(GetSubsystem<ResourceCache>()->GetResource<Texture2D>(element.GetChild("texture").GetString("name")));
+    if (element.HasChild("imagerect"))
     {
     {
-        XMLElement imageElem = element.GetChildElement("imagerect");
+        XMLElement imageElem = element.GetChild("imagerect");
         if (imageElem.HasAttribute("value"))
         if (imageElem.HasAttribute("value"))
             SetImageRect(imageElem.GetIntRect("value"));
             SetImageRect(imageElem.GetIntRect("value"));
     }
     }
-    if (element.HasChildElement("border"))
-        SetBorder(element.GetChildElement("border").GetIntRect("value"));
-    if (element.HasChildElement("hoveroffset"))
-        SetHoverOffset(element.GetChildElement("hoveroffset").GetIntVector2("value"));
+    if (element.HasChild("border"))
+        SetBorder(element.GetChild("border").GetIntRect("value"));
+    if (element.HasChild("hoveroffset"))
+        SetHoverOffset(element.GetChild("hoveroffset").GetIntVector2("value"));
 }
 }
 
 
 void BorderImage::GetBatches(PODVector<UIBatch>& batches, PODVector<UIQuad>& quads, const IntRect& currentScissor)
 void BorderImage::GetBatches(PODVector<UIBatch>& batches, PODVector<UIQuad>& quads, const IntRect& currentScissor)

+ 6 - 6
Engine/UI/Button.cpp

@@ -56,13 +56,13 @@ void Button::SetStyle(const XMLElement& element)
 {
 {
     BorderImage::SetStyle(element);
     BorderImage::SetStyle(element);
     
     
-    if (element.HasChildElement("pressedoffset"))
-        SetPressedOffset(element.GetChildElement("pressedoffset").GetIntVector2("value"));
-    if (element.HasChildElement("labeloffset"))
-        SetLabelOffset(element.GetChildElement("labeloffset").GetIntVector2("value"));
-    if (element.HasChildElement("repeat"))
+    if (element.HasChild("pressedoffset"))
+        SetPressedOffset(element.GetChild("pressedoffset").GetIntVector2("value"));
+    if (element.HasChild("labeloffset"))
+        SetLabelOffset(element.GetChild("labeloffset").GetIntVector2("value"));
+    if (element.HasChild("repeat"))
     {
     {
-        XMLElement repeatElem = element.GetChildElement("repeat");
+        XMLElement repeatElem = element.GetChild("repeat");
         SetRepeat(repeatElem.GetFloat("delay"), repeatElem.GetFloat("rate"));
         SetRepeat(repeatElem.GetFloat("delay"), repeatElem.GetFloat("rate"));
     }
     }
 }
 }

+ 2 - 2
Engine/UI/CheckBox.cpp

@@ -52,8 +52,8 @@ void CheckBox::SetStyle(const XMLElement& element)
 {
 {
     BorderImage::SetStyle(element);
     BorderImage::SetStyle(element);
     
     
-    if (element.HasChildElement("checkedoffset"))
-        SetCheckedOffset(element.GetChildElement("checkedoffset").GetIntVector2("value"));
+    if (element.HasChild("checkedoffset"))
+        SetCheckedOffset(element.GetChild("checkedoffset").GetIntVector2("value"));
 }
 }
 
 
 void CheckBox::GetBatches(PODVector<UIBatch>& batches, PODVector<UIQuad>& quads, const IntRect& currentScissor)
 void CheckBox::GetBatches(PODVector<UIBatch>& batches, PODVector<UIQuad>& quads, const IntRect& currentScissor)

+ 2 - 2
Engine/UI/Cursor.cpp

@@ -72,13 +72,13 @@ void Cursor::SetStyle(const XMLElement& element)
 {
 {
     UIElement::SetStyle(element);
     UIElement::SetStyle(element);
     
     
-    XMLElement shapeElem = element.GetChildElement("shape");
+    XMLElement shapeElem = element.GetChild("shape");
     while (shapeElem)
     while (shapeElem)
     {
     {
         CursorShape shape = (CursorShape)GetStringListIndex(shapeElem.GetStringLower("name"), shapeNames, CS_NORMAL);
         CursorShape shape = (CursorShape)GetStringListIndex(shapeElem.GetStringLower("name"), shapeNames, CS_NORMAL);
         DefineShape(shape, GetSubsystem<ResourceCache>()->GetResource<Texture2D>(shapeElem.GetString("texture")),
         DefineShape(shape, GetSubsystem<ResourceCache>()->GetResource<Texture2D>(shapeElem.GetString("texture")),
             shapeElem.GetIntRect("imagerect"), shapeElem.GetIntVector2("hotspot"));
             shapeElem.GetIntRect("imagerect"), shapeElem.GetIntVector2("hotspot"));
-        shapeElem = shapeElem.GetNextElement("shape");
+        shapeElem = shapeElem.GetNext("shape");
     }
     }
 }
 }
 
 

+ 11 - 11
Engine/UI/DropDownList.cpp

@@ -63,34 +63,34 @@ void DropDownList::SetStyle(const XMLElement& element)
 {
 {
     Menu::SetStyle(element);
     Menu::SetStyle(element);
     
     
-    XMLElement listElem = element.GetChildElement("listview");
+    XMLElement listElem = element.GetChild("listview");
     if (listElem)
     if (listElem)
         listView_->SetStyle(listElem);
         listView_->SetStyle(listElem);
     
     
-    XMLElement popupElem = element.GetChildElement("popup");
+    XMLElement popupElem = element.GetChild("popup");
     if (popupElem)
     if (popupElem)
         popup_->SetStyle(popupElem);
         popup_->SetStyle(popupElem);
     
     
-    XMLElement placeholderElem = element.GetChildElement("placeholder");
+    XMLElement placeholderElem = element.GetChild("placeholder");
     if (placeholderElem)
     if (placeholderElem)
         placeholder_->SetStyle(placeholderElem);
         placeholder_->SetStyle(placeholderElem);
     
     
-    UIElement* root = GetRootElement();
-    XMLElement itemElem = element.GetChildElement("popupitem");
+    UIElement* root = GetRoot();
+    XMLElement itemElem = element.GetChild("popupitem");
     if (root)
     if (root)
     {
     {
         while (itemElem)
         while (itemElem)
         {
         {
             if (itemElem.HasAttribute("name"))
             if (itemElem.HasAttribute("name"))
                 AddItem(root->GetChild(itemElem.GetString("name"), true));
                 AddItem(root->GetChild(itemElem.GetString("name"), true));
-            itemElem = itemElem.GetNextElement("popupitem");
+            itemElem = itemElem.GetNext("popupitem");
         }
         }
     }
     }
     
     
-    if (element.HasChildElement("selection"))
-        SetSelection(element.GetChildElement("selection").GetInt("value"));
-    if (element.HasChildElement("resizepopup"))
-        SetResizePopup(element.GetChildElement("resizepopup").GetBool("enable"));
+    if (element.HasChild("selection"))
+        SetSelection(element.GetChild("selection").GetInt("value"));
+    if (element.HasChild("resizepopup"))
+        SetResizePopup(element.GetChild("resizepopup").GetBool("enable"));
 }
 }
 
 
 void DropDownList::GetBatches(PODVector<UIBatch>& batches, PODVector<UIQuad>& quads, const IntRect& currentScissor)
 void DropDownList::GetBatches(PODVector<UIBatch>& batches, PODVector<UIQuad>& quads, const IntRect& currentScissor)
@@ -128,7 +128,7 @@ void DropDownList::OnShowPopup()
     
     
     // Check if popup fits below the button. If not, show above instead
     // Check if popup fits below the button. If not, show above instead
     bool showAbove = false;
     bool showAbove = false;
-    UIElement* root = GetRootElement();
+    UIElement* root = GetRoot();
     if (root)
     if (root)
     {
     {
         const IntVector2& screenPos = GetScreenPosition();
         const IntVector2& screenPos = GetScreenPosition();

+ 2 - 2
Engine/UI/FileSelector.cpp

@@ -112,7 +112,7 @@ FileSelector::FileSelector(Context* context) :
     
     
     UI* ui = GetSubsystem<UI>();
     UI* ui = GetSubsystem<UI>();
     if (ui)
     if (ui)
-        ui->GetRootElement()->AddChild(window_);
+        ui->GetRoot()->AddChild(window_);
     
     
     Vector<String> defaultFilters;
     Vector<String> defaultFilters;
     defaultFilters.Push("*.*");
     defaultFilters.Push("*.*");
@@ -141,7 +141,7 @@ FileSelector::~FileSelector()
 {
 {
     UI* ui = GetSubsystem<UI>();
     UI* ui = GetSubsystem<UI>();
     if (ui)
     if (ui)
-        ui->GetRootElement()->RemoveChild(window_);
+        ui->GetRoot()->RemoveChild(window_);
 }
 }
 
 
 void FileSelector::RegisterObject(Context* context)
 void FileSelector::RegisterObject(Context* context)

+ 16 - 16
Engine/UI/LineEdit.cpp

@@ -73,16 +73,16 @@ void LineEdit::SetStyle(const XMLElement& element)
 {
 {
     BorderImage::SetStyle(element);
     BorderImage::SetStyle(element);
     
     
-    if (element.HasChildElement("maxlength"))
-        SetMaxLength(element.GetChildElement("maxlength").GetInt("value"));
-    if (element.HasChildElement("cursormovable"))
-        SetCursorMovable(element.GetChildElement("cursormovable").GetBool("enable"));
-    if (element.HasChildElement("textselectable"))
-        SetTextSelectable(element.GetChildElement("textselectable").GetBool("enable"));
-    if (element.HasChildElement("textcopyable"))
-        SetTextCopyable(element.GetChildElement("textcopyable").GetBool("enable"));
+    if (element.HasChild("maxlength"))
+        SetMaxLength(element.GetChild("maxlength").GetInt("value"));
+    if (element.HasChild("cursormovable"))
+        SetCursorMovable(element.GetChild("cursormovable").GetBool("enable"));
+    if (element.HasChild("textselectable"))
+        SetTextSelectable(element.GetChild("textselectable").GetBool("enable"));
+    if (element.HasChild("textcopyable"))
+        SetTextCopyable(element.GetChild("textcopyable").GetBool("enable"));
     
     
-    XMLElement textElem = element.GetChildElement("text");
+    XMLElement textElem = element.GetChild("text");
     if (textElem)
     if (textElem)
     {
     {
         if (textElem.HasAttribute("value"))
         if (textElem.HasAttribute("value"))
@@ -90,17 +90,17 @@ void LineEdit::SetStyle(const XMLElement& element)
         text_->SetStyle(textElem);
         text_->SetStyle(textElem);
     }
     }
     
     
-    XMLElement cursorElem = element.GetChildElement("cursor");
+    XMLElement cursorElem = element.GetChild("cursor");
     if (cursorElem)
     if (cursorElem)
         cursor_->SetStyle(cursorElem);
         cursor_->SetStyle(cursorElem);
     
     
-    if (element.HasChildElement("cursorposition"))
-        SetCursorPosition(element.GetChildElement("cursorposition").GetInt("value"));
-    if (element.HasChildElement("cursorblinkrate"))
-        SetCursorBlinkRate(element.GetChildElement("cursorblinkrate").GetFloat("value"));
-    if (element.HasChildElement("echocharacter"))
+    if (element.HasChild("cursorposition"))
+        SetCursorPosition(element.GetChild("cursorposition").GetInt("value"));
+    if (element.HasChild("cursorblinkrate"))
+        SetCursorBlinkRate(element.GetChild("cursorblinkrate").GetFloat("value"));
+    if (element.HasChild("echocharacter"))
     {
     {
-        String text = element.GetChildElement("echocharacter").GetString("value");
+        String text = element.GetChild("echocharacter").GetString("value");
         if (text.Length())
         if (text.Length())
             SetEchoCharacter(text[0]);
             SetEchoCharacter(text[0]);
     }
     }

+ 16 - 16
Engine/UI/ListView.cpp

@@ -82,8 +82,8 @@ void ListView::SetStyle(const XMLElement& element)
 {
 {
     ScrollView::SetStyle(element);
     ScrollView::SetStyle(element);
     
     
-    UIElement* root = GetRootElement();
-    XMLElement itemElem = element.GetChildElement("listitem");
+    UIElement* root = GetRoot();
+    XMLElement itemElem = element.GetChild("listitem");
     if (root)
     if (root)
     {
     {
         while (itemElem)
         while (itemElem)
@@ -94,30 +94,30 @@ void ListView::SetStyle(const XMLElement& element)
                 AddItem(item);
                 AddItem(item);
                 if (itemElem.HasAttribute("indent"))
                 if (itemElem.HasAttribute("indent"))
                     item->vars_[indentHash] = itemElem.GetInt("indent");
                     item->vars_[indentHash] = itemElem.GetInt("indent");
-                itemElem = itemElem.GetNextElement("listitem");
+                itemElem = itemElem.GetNext("listitem");
             }
             }
         }
         }
     }
     }
     
     
-    if (element.HasChildElement("highlight"))
+    if (element.HasChild("highlight"))
     {
     {
-        String highlight = element.GetChildElement("highlight").GetStringLower("value");
+        String highlight = element.GetChild("highlight").GetStringLower("value");
         SetHighlightMode((HighlightMode)GetStringListIndex(highlight, highlightModes, HM_FOCUS));
         SetHighlightMode((HighlightMode)GetStringListIndex(highlight, highlightModes, HM_FOCUS));
     }
     }
-    if (element.HasChildElement("multiselect"))
-        SetMultiselect(element.GetChildElement("multiselect").GetBool("enable"));
-    if (element.HasChildElement("hierarchy"))
-        SetHierarchyMode(element.GetChildElement("hierarchy").GetBool("enable"));
-    if (element.HasChildElement("clearselection"))
-        SetClearSelectionOnDefocus(element.GetChildElement("clearselection").GetBool("enable"));
-    if (element.HasChildElement("doubleclickinterval"))
-        SetDoubleClickInterval(element.GetChildElement("doubleclickinterval").GetFloat("value"));
-    
-    XMLElement selectionElem = element.GetChildElement("selection");
+    if (element.HasChild("multiselect"))
+        SetMultiselect(element.GetChild("multiselect").GetBool("enable"));
+    if (element.HasChild("hierarchy"))
+        SetHierarchyMode(element.GetChild("hierarchy").GetBool("enable"));
+    if (element.HasChild("clearselection"))
+        SetClearSelectionOnDefocus(element.GetChild("clearselection").GetBool("enable"));
+    if (element.HasChild("doubleclickinterval"))
+        SetDoubleClickInterval(element.GetChild("doubleclickinterval").GetFloat("value"));
+    
+    XMLElement selectionElem = element.GetChild("selection");
     while (selectionElem)
     while (selectionElem)
     {
     {
         AddSelection(selectionElem.GetInt("value"));
         AddSelection(selectionElem.GetInt("value"));
-        selectionElem = selectionElem.GetNextElement("selection");
+        selectionElem = selectionElem.GetNext("selection");
     }
     }
 }
 }
 
 

+ 6 - 6
Engine/UI/Menu.cpp

@@ -71,16 +71,16 @@ void Menu::SetStyle(const XMLElement& element)
 {
 {
     Button::SetStyle(element);
     Button::SetStyle(element);
     
     
-    XMLElement popupElem = element.GetChildElement("popup");
+    XMLElement popupElem = element.GetChild("popup");
     if (popupElem && popupElem.HasAttribute("name"))
     if (popupElem && popupElem.HasAttribute("name"))
     {
     {
-        UIElement* root = GetRootElement();
+        UIElement* root = GetRoot();
         if (root)
         if (root)
             SetPopup(root->GetChild(popupElem.GetString("name"), true));
             SetPopup(root->GetChild(popupElem.GetString("name"), true));
     }
     }
     
     
-    if (element.HasChildElement("popupoffset"))
-        SetPopupOffset(element.GetChildElement("popupoffset").GetIntVector2("value"));
+    if (element.HasChild("popupoffset"))
+        SetPopupOffset(element.GetChild("popupoffset").GetIntVector2("value"));
 }
 }
 
 
 void Menu::OnShowPopup()
 void Menu::OnShowPopup()
@@ -122,7 +122,7 @@ void Menu::ShowPopup(bool enable)
         return;
         return;
     
     
     // Find the UI root element for showing the popup
     // Find the UI root element for showing the popup
-    UIElement* root = GetRootElement();
+    UIElement* root = GetRoot();
     if (!root)
     if (!root)
         return;
         return;
     
     
@@ -197,7 +197,7 @@ void Menu::HandleFocusChanged(StringHash eventType, VariantMap& eventData)
     using namespace FocusChanged;
     using namespace FocusChanged;
     
     
     UIElement* element = static_cast<UIElement*>(eventData[P_ELEMENT].GetPtr());
     UIElement* element = static_cast<UIElement*>(eventData[P_ELEMENT].GetPtr());
-    UIElement* root = GetRootElement();
+    UIElement* root = GetRoot();
     
     
     // If another element was focused due to the menu button being clicked, do not hide the popup
     // If another element was focused due to the menu button being clicked, do not hide the popup
     if (eventType == E_FOCUSCHANGED && static_cast<UIElement*>(eventData[P_ORIGINALELEMENT].GetPtr()))
     if (eventType == E_FOCUSCHANGED && static_cast<UIElement*>(eventData[P_ORIGINALELEMENT].GetPtr()))

+ 13 - 13
Engine/UI/ScrollBar.cpp

@@ -76,21 +76,21 @@ void ScrollBar::SetStyle(const XMLElement& element)
 {
 {
     UIElement::SetStyle(element);
     UIElement::SetStyle(element);
     
     
-    if (element.HasChildElement("range"))
+    if (element.HasChild("range"))
     {
     {
-        XMLElement rangeElem = element.GetChildElement("range");
+        XMLElement rangeElem = element.GetChild("range");
         SetRange(rangeElem.GetFloat("max"));
         SetRange(rangeElem.GetFloat("max"));
         SetValue(rangeElem.GetFloat("value"));
         SetValue(rangeElem.GetFloat("value"));
     }
     }
-    if (element.HasChildElement("scrollstep"))
-        SetScrollStep(element.GetChildElement("scrollstep").GetFloat("value"));
-    if (element.HasChildElement("stepfactor"))
-        SetStepFactor(element.GetChildElement("stepfactor").GetFloat("value"));
+    if (element.HasChild("scrollstep"))
+        SetScrollStep(element.GetChild("scrollstep").GetFloat("value"));
+    if (element.HasChild("stepfactor"))
+        SetStepFactor(element.GetChild("stepfactor").GetFloat("value"));
     
     
-    XMLElement backButtonElem = element.GetChildElement("backbutton");
+    XMLElement backButtonElem = element.GetChild("backbutton");
     if (backButtonElem)
     if (backButtonElem)
     {
     {
-        XMLElement imageElem = backButtonElem.GetChildElement("imagerect");
+        XMLElement imageElem = backButtonElem.GetChild("imagerect");
         if (imageElem.HasAttribute("horizontal"))
         if (imageElem.HasAttribute("horizontal"))
             leftRect_ = imageElem.GetIntRect("horizontal");
             leftRect_ = imageElem.GetIntRect("horizontal");
         if (imageElem.HasAttribute("vertical"))
         if (imageElem.HasAttribute("vertical"))
@@ -102,10 +102,10 @@ void ScrollBar::SetStyle(const XMLElement& element)
         backButton_->SetStyle(backButtonElem);
         backButton_->SetStyle(backButtonElem);
     }
     }
     
     
-    XMLElement forwardButtonElem = element.GetChildElement("forwardbutton");
+    XMLElement forwardButtonElem = element.GetChild("forwardbutton");
     if (forwardButtonElem)
     if (forwardButtonElem)
     {
     {
-        XMLElement imageElem = forwardButtonElem.GetChildElement("imagerect");
+        XMLElement imageElem = forwardButtonElem.GetChild("imagerect");
         if (imageElem.HasAttribute("horizontal"))
         if (imageElem.HasAttribute("horizontal"))
             rightRect_ = imageElem.GetIntRect("horizontal");
             rightRect_ = imageElem.GetIntRect("horizontal");
         if (imageElem.HasAttribute("vertical"))
         if (imageElem.HasAttribute("vertical"))
@@ -117,13 +117,13 @@ void ScrollBar::SetStyle(const XMLElement& element)
         forwardButton_->SetStyle(forwardButtonElem);
         forwardButton_->SetStyle(forwardButtonElem);
     }
     }
     
     
-    XMLElement sliderElem = element.GetChildElement("slider");
+    XMLElement sliderElem = element.GetChild("slider");
     if (sliderElem)
     if (sliderElem)
         slider_->SetStyle(sliderElem);
         slider_->SetStyle(sliderElem);
     
     
-    if (element.HasChildElement("orientation"))
+    if (element.HasChild("orientation"))
     {
     {
-        String orientation = element.GetChildElement("orientation").GetStringLower("value");
+        String orientation = element.GetChild("orientation").GetStringLower("value");
         if (orientation == "horizontal" || orientation == "h")
         if (orientation == "horizontal" || orientation == "h")
             SetOrientation(O_HORIZONTAL);
             SetOrientation(O_HORIZONTAL);
         if (orientation == "vertical" || orientation == "v")
         if (orientation == "vertical" || orientation == "v")

+ 12 - 12
Engine/UI/ScrollView.cpp

@@ -78,26 +78,26 @@ void ScrollView::SetStyle(const XMLElement& element)
 {
 {
     UIElement::SetStyle(element);
     UIElement::SetStyle(element);
     
     
-    if (element.HasChildElement("viewposition"))
-        SetViewPosition(element.GetChildElement("viewposition").GetIntVector2("value"));
-    if (element.HasChildElement("scrollstep"))
-        SetScrollStep(element.GetChildElement("scrollstep").GetFloat("value"));
-    if (element.HasChildElement("pagestep"))
-        SetScrollStep(element.GetChildElement("pagestep").GetFloat("value"));
+    if (element.HasChild("viewposition"))
+        SetViewPosition(element.GetChild("viewposition").GetIntVector2("value"));
+    if (element.HasChild("scrollstep"))
+        SetScrollStep(element.GetChild("scrollstep").GetFloat("value"));
+    if (element.HasChild("pagestep"))
+        SetScrollStep(element.GetChild("pagestep").GetFloat("value"));
     
     
-    XMLElement horizElem = element.GetChildElement("horizontalscrollbar");
+    XMLElement horizElem = element.GetChild("horizontalscrollbar");
     if (horizElem)
     if (horizElem)
         horizontalScrollBar_->SetStyle(horizElem);
         horizontalScrollBar_->SetStyle(horizElem);
-    XMLElement vertElem = element.GetChildElement("verticalscrollbar");
+    XMLElement vertElem = element.GetChild("verticalscrollbar");
     if (vertElem)
     if (vertElem)
         verticalScrollBar_->SetStyle(vertElem);
         verticalScrollBar_->SetStyle(vertElem);
-    XMLElement panelElem = element.GetChildElement("scrollpanel");
+    XMLElement panelElem = element.GetChild("scrollpanel");
     if (panelElem)
     if (panelElem)
         scrollPanel_->SetStyle(panelElem);
         scrollPanel_->SetStyle(panelElem);
     
     
-    UIElement* root = GetRootElement();
-    if (root && element.HasChildElement("contentelement"))
-        SetContentElement(root->GetChild(element.GetChildElement("contentelement").GetString("name"), true));
+    UIElement* root = GetRoot();
+    if (root && element.HasChild("contentelement"))
+        SetContentElement(root->GetChild(element.GetChild("contentelement").GetString("name"), true));
     
     
     // Set the scrollbar orientations again and perform size update now that the style is known
     // Set the scrollbar orientations again and perform size update now that the style is known
     horizontalScrollBar_->SetOrientation(O_HORIZONTAL);
     horizontalScrollBar_->SetOrientation(O_HORIZONTAL);

+ 5 - 5
Engine/UI/Slider.cpp

@@ -59,22 +59,22 @@ void Slider::SetStyle(const XMLElement& element)
 {
 {
     BorderImage::SetStyle(element);
     BorderImage::SetStyle(element);
     
     
-    if (element.HasChildElement("orientation"))
+    if (element.HasChild("orientation"))
     {
     {
-        String orientation = element.GetChildElement("orientation").GetStringLower("value");
+        String orientation = element.GetChild("orientation").GetStringLower("value");
         if (orientation == "horizontal" || orientation == "h")
         if (orientation == "horizontal" || orientation == "h")
             SetOrientation(O_HORIZONTAL);
             SetOrientation(O_HORIZONTAL);
         if (orientation == "vertical" || orientation == "v")
         if (orientation == "vertical" || orientation == "v")
             SetOrientation(O_VERTICAL);
             SetOrientation(O_VERTICAL);
     }
     }
-    if (element.HasChildElement("range"))
+    if (element.HasChild("range"))
     {
     {
-        XMLElement rangeElem = element.GetChildElement("range");
+        XMLElement rangeElem = element.GetChild("range");
         SetRange(rangeElem.GetFloat("max"));
         SetRange(rangeElem.GetFloat("max"));
         SetValue(rangeElem.GetFloat("value"));
         SetValue(rangeElem.GetFloat("value"));
     }
     }
     
     
-    XMLElement knobElem = element.GetChildElement("knob");
+    XMLElement knobElem = element.GetChild("knob");
     if (knobElem)
     if (knobElem)
         knob_->SetStyle(knobElem);
         knob_->SetStyle(knobElem);
 }
 }

+ 18 - 18
Engine/UI/Text.cpp

@@ -75,9 +75,9 @@ void Text::SetStyle(const XMLElement& element)
     // Recalculating the text is expensive, so do it only once at the end if something changed
     // Recalculating the text is expensive, so do it only once at the end if something changed
     bool changed = false;
     bool changed = false;
     
     
-    if (element.HasChildElement("font"))
+    if (element.HasChild("font"))
     {
     {
-        XMLElement fontElem = element.GetChildElement("font");
+        XMLElement fontElem = element.GetChild("font");
         String fontName = fontElem.GetString("name");
         String fontName = fontElem.GetString("name");
         
         
         ResourceCache* cache = GetSubsystem<ResourceCache>();
         ResourceCache* cache = GetSubsystem<ResourceCache>();
@@ -91,9 +91,9 @@ void Text::SetStyle(const XMLElement& element)
                 changed = true;
                 changed = true;
             }
             }
         }
         }
-        else if (element.HasChildElement("fallbackfont"))
+        else if (element.HasChild("fallbackfont"))
         {
         {
-            fontElem = element.GetChildElement("fallbackfont");
+            fontElem = element.GetChild("fallbackfont");
             String fontName = fontElem.GetString("name");
             String fontName = fontElem.GetString("name");
             Font* font = cache->GetResource<Font>(fontName);
             Font* font = cache->GetResource<Font>(fontName);
             if (font)
             if (font)
@@ -104,43 +104,43 @@ void Text::SetStyle(const XMLElement& element)
             }
             }
         }
         }
     }
     }
-    if (element.HasChildElement("text"))
+    if (element.HasChild("text"))
     {
     {
-        String text = element.GetChildElement("text").GetString("value");
+        String text = element.GetChild("text").GetString("value");
         text.Replace("\\n", "\n");
         text.Replace("\\n", "\n");
         text_ = text;
         text_ = text;
         changed = true;
         changed = true;
     }
     }
-    if (element.HasChildElement("textalignment"))
+    if (element.HasChild("textalignment"))
     {
     {
-        String horiz = element.GetChildElement("textalignment").GetStringLower("value");
+        String horiz = element.GetChild("textalignment").GetStringLower("value");
         if (!horiz.Empty())
         if (!horiz.Empty())
         {
         {
             textAlignment_ = (HorizontalAlignment)GetStringListIndex(horiz, horizontalAlignments, HA_LEFT);
             textAlignment_ = (HorizontalAlignment)GetStringListIndex(horiz, horizontalAlignments, HA_LEFT);
             changed = true;
             changed = true;
         }
         }
     }
     }
-    if (element.HasChildElement("rowspacing"))
+    if (element.HasChild("rowspacing"))
     {
     {
-        rowSpacing_ = Max(element.GetChildElement("rowspacing").GetFloat("value"), MIN_ROW_SPACING);
+        rowSpacing_ = Max(element.GetChild("rowspacing").GetFloat("value"), MIN_ROW_SPACING);
         changed = true;
         changed = true;
     }
     }
-    if (element.HasChildElement("wordwrap"))
+    if (element.HasChild("wordwrap"))
     {
     {
-        wordWrap_ = element.GetChildElement("wordwrap").GetBool("enable");
+        wordWrap_ = element.GetChild("wordwrap").GetBool("enable");
         changed = true;
         changed = true;
     }
     }
-    if (element.HasChildElement("selection"))
+    if (element.HasChild("selection"))
     {
     {
-        XMLElement selectionElem = element.GetChildElement("selection");
+        XMLElement selectionElem = element.GetChild("selection");
         selectionStart_ = selectionElem.GetInt("start");
         selectionStart_ = selectionElem.GetInt("start");
         selectionLength_ = selectionElem.GetInt("length");
         selectionLength_ = selectionElem.GetInt("length");
         changed = true;
         changed = true;
     }
     }
-    if (element.HasChildElement("selectioncolor"))
-        SetSelectionColor(element.GetChildElement("selectioncolor").GetColor("value"));
-    if (element.HasChildElement("hovercolor"))
-        SetHoverColor(element.GetChildElement("hovercolor").GetColor("value"));
+    if (element.HasChild("selectioncolor"))
+        SetSelectionColor(element.GetChild("selectioncolor").GetColor("value"));
+    if (element.HasChild("hovercolor"))
+        SetHoverColor(element.GetChild("hovercolor").GetColor("value"));
     
     
     if (changed)
     if (changed)
     {
     {

+ 4 - 4
Engine/UI/UI.cpp

@@ -302,7 +302,7 @@ SharedPtr<UIElement> UI::LoadLayout(XMLFile* file, XMLFile* styleFile)
     
     
     LOGDEBUG("Loading UI layout " + file->GetName());
     LOGDEBUG("Loading UI layout " + file->GetName());
     
     
-    XMLElement rootElem = file->GetRootElement("element");
+    XMLElement rootElem = file->GetRoot("element");
     if (!rootElem)
     if (!rootElem)
     {
     {
         LOGERROR("No root UI element in " + file->GetName());
         LOGERROR("No root UI element in " + file->GetName());
@@ -520,7 +520,7 @@ void UI::GetElementAt(UIElement*& result, UIElement* current, const IntVector2&
 
 
 void UI::LoadLayout(UIElement* current, const XMLElement& elem, XMLFile* styleFile)
 void UI::LoadLayout(UIElement* current, const XMLElement& elem, XMLFile* styleFile)
 {
 {
-    XMLElement childElem = elem.GetChildElement("element");
+    XMLElement childElem = elem.GetChild("element");
     while (childElem)
     while (childElem)
     {
     {
         // Create element
         // Create element
@@ -529,7 +529,7 @@ void UI::LoadLayout(UIElement* current, const XMLElement& elem, XMLFile* styleFi
         if (!child)
         if (!child)
         {
         {
             LOGERROR("Could not create UI element " + type);
             LOGERROR("Could not create UI element " + type);
-            childElem = childElem.GetNextElement("element");
+            childElem = childElem.GetNext("element");
             continue;
             continue;
         }
         }
         child->SetName(childElem.GetString("name"));
         child->SetName(childElem.GetString("name"));
@@ -546,7 +546,7 @@ void UI::LoadLayout(UIElement* current, const XMLElement& elem, XMLFile* styleFi
         // Load the children recursively
         // Load the children recursively
         LoadLayout(child, childElem, styleFile);
         LoadLayout(child, childElem, styleFile);
         
         
-        childElem = childElem.GetNextElement("element");
+        childElem = childElem.GetNext("element");
     }
     }
 }
 }
 
 

+ 1 - 1
Engine/UI/UI.h

@@ -63,7 +63,7 @@ public:
     void SetClipBoardText(const String& text);
     void SetClipBoardText(const String& text);
     
     
     /// Return root UI elemenet
     /// Return root UI elemenet
-    UIElement* GetRootElement() const { return rootElement_; }
+    UIElement* GetRoot() const { return rootElement_; }
     /// Return cursor
     /// Return cursor
     Cursor* GetCursor() const { return cursor_; }
     Cursor* GetCursor() const { return cursor_; }
     /// Return UI element at screen coordinates
     /// Return UI element at screen coordinates

+ 61 - 61
Engine/UI/UIElement.cpp

@@ -125,35 +125,35 @@ void UIElement::SetStyle(const XMLElement& element)
 {
 {
     if (element.HasAttribute("name"))
     if (element.HasAttribute("name"))
         name_ = element.GetString("name");
         name_ = element.GetString("name");
-    if (element.HasChildElement("position"))
-        SetPosition(element.GetChildElement("position").GetIntVector2("value"));
-    if (element.HasChildElement("size"))
-        SetSize(element.GetChildElement("size").GetIntVector2("value"));
-    if (element.HasChildElement("width"))
-        SetWidth(element.GetChildElement("width").GetInt("value"));
-    if (element.HasChildElement("height"))
-        SetHeight(element.GetChildElement("height").GetInt("value"));
-    if (element.HasChildElement("minsize"))
-        SetMinSize(element.GetChildElement("minsize").GetIntVector2("value"));
-    if (element.HasChildElement("minwidth"))
-        SetMinWidth(element.GetChildElement("minwidth").GetInt("value"));
-    if (element.HasChildElement("minheight"))
-        SetMinHeight(element.GetChildElement("minheight").GetInt("value"));
-    if (element.HasChildElement("maxsize"))
-        SetMaxSize(element.GetChildElement("maxsize").GetIntVector2("value"));
-    if (element.HasChildElement("maxwidth"))
-        SetMinWidth(element.GetChildElement("maxwidth").GetInt("value"));
-    if (element.HasChildElement("maxheight"))
-        SetMinHeight(element.GetChildElement("maxheight").GetInt("value"));
-    if (element.HasChildElement("fixedsize"))
-        SetFixedSize(element.GetChildElement("fixedsize").GetIntVector2("value"));
-    if (element.HasChildElement("fixedwidth"))
-        SetFixedWidth(element.GetChildElement("fixedwidth").GetInt("value"));
-    if (element.HasChildElement("fixedheight"))
-        SetFixedHeight(element.GetChildElement("fixedheight").GetInt("value"));
-    if (element.HasChildElement("alignment"))
+    if (element.HasChild("position"))
+        SetPosition(element.GetChild("position").GetIntVector2("value"));
+    if (element.HasChild("size"))
+        SetSize(element.GetChild("size").GetIntVector2("value"));
+    if (element.HasChild("width"))
+        SetWidth(element.GetChild("width").GetInt("value"));
+    if (element.HasChild("height"))
+        SetHeight(element.GetChild("height").GetInt("value"));
+    if (element.HasChild("minsize"))
+        SetMinSize(element.GetChild("minsize").GetIntVector2("value"));
+    if (element.HasChild("minwidth"))
+        SetMinWidth(element.GetChild("minwidth").GetInt("value"));
+    if (element.HasChild("minheight"))
+        SetMinHeight(element.GetChild("minheight").GetInt("value"));
+    if (element.HasChild("maxsize"))
+        SetMaxSize(element.GetChild("maxsize").GetIntVector2("value"));
+    if (element.HasChild("maxwidth"))
+        SetMinWidth(element.GetChild("maxwidth").GetInt("value"));
+    if (element.HasChild("maxheight"))
+        SetMinHeight(element.GetChild("maxheight").GetInt("value"));
+    if (element.HasChild("fixedsize"))
+        SetFixedSize(element.GetChild("fixedsize").GetIntVector2("value"));
+    if (element.HasChild("fixedwidth"))
+        SetFixedWidth(element.GetChild("fixedwidth").GetInt("value"));
+    if (element.HasChild("fixedheight"))
+        SetFixedHeight(element.GetChild("fixedheight").GetInt("value"));
+    if (element.HasChild("alignment"))
     {
     {
-        XMLElement alignElem = element.GetChildElement("alignment");
+        XMLElement alignElem = element.GetChild("alignment");
         
         
         String horiz;
         String horiz;
         String vert;
         String vert;
@@ -170,15 +170,15 @@ void UIElement::SetStyle(const XMLElement& element)
         if (!vert.Empty())
         if (!vert.Empty())
             SetVerticalAlignment((VerticalAlignment)GetStringListIndex(vert, verticalAlignments, VA_TOP));
             SetVerticalAlignment((VerticalAlignment)GetStringListIndex(vert, verticalAlignments, VA_TOP));
     }
     }
-    if (element.HasChildElement("clipborder"))
-        SetClipBorder(element.GetChildElement("clipborder").GetIntRect("value"));
-    if (element.HasChildElement("priority"))
-        SetPriority(element.GetChildElement("priority").GetInt("value"));
-    if (element.HasChildElement("opacity"))
-        SetOpacity(element.GetChildElement("opacity").GetFloat("value"));
-    if (element.HasChildElement("color"))
+    if (element.HasChild("clipborder"))
+        SetClipBorder(element.GetChild("clipborder").GetIntRect("value"));
+    if (element.HasChild("priority"))
+        SetPriority(element.GetChild("priority").GetInt("value"));
+    if (element.HasChild("opacity"))
+        SetOpacity(element.GetChild("opacity").GetFloat("value"));
+    if (element.HasChild("color"))
     {
     {
-        XMLElement colorElem = element.GetChildElement("color");
+        XMLElement colorElem = element.GetChild("color");
         if (colorElem.HasAttribute("value"))
         if (colorElem.HasAttribute("value"))
             SetColor(colorElem.GetColor("value"));
             SetColor(colorElem.GetColor("value"));
         if (colorElem.HasAttribute("topleft"))
         if (colorElem.HasAttribute("topleft"))
@@ -190,33 +190,33 @@ void UIElement::SetStyle(const XMLElement& element)
         if (colorElem.HasAttribute("bottomright"))
         if (colorElem.HasAttribute("bottomright"))
             SetColor(C_BOTTOMRIGHT, colorElem.GetColor("bottomright"));
             SetColor(C_BOTTOMRIGHT, colorElem.GetColor("bottomright"));
     }
     }
-    if (element.HasChildElement("bringtofront"))
-        SetBringToFront(element.GetChildElement("bringtofront").GetBool("enable"));
-    if (element.HasChildElement("bringtoback"))
-        SetBringToBack(element.GetChildElement("bringtoback").GetBool("enable"));
-    if (element.HasChildElement("clipchildren"))
-        SetClipChildren(element.GetChildElement("clipchildren").GetBool("enable"));
-    if (element.HasChildElement("enabled"))
-        SetActive(element.GetChildElement("enabled").GetBool("enable"));
-    if (element.HasChildElement("selected"))
-        SetSelected(element.GetChildElement("selected").GetBool("enable"));
-    if (element.HasChildElement("visible"))
-        SetVisible(element.GetChildElement("visible").GetBool("enable"));
-    if (element.HasChildElement("focusmode"))
+    if (element.HasChild("bringtofront"))
+        SetBringToFront(element.GetChild("bringtofront").GetBool("enable"));
+    if (element.HasChild("bringtoback"))
+        SetBringToBack(element.GetChild("bringtoback").GetBool("enable"));
+    if (element.HasChild("clipchildren"))
+        SetClipChildren(element.GetChild("clipchildren").GetBool("enable"));
+    if (element.HasChild("enabled"))
+        SetActive(element.GetChild("enabled").GetBool("enable"));
+    if (element.HasChild("selected"))
+        SetSelected(element.GetChild("selected").GetBool("enable"));
+    if (element.HasChild("visible"))
+        SetVisible(element.GetChild("visible").GetBool("enable"));
+    if (element.HasChild("focusmode"))
     {
     {
-        String focusMode = element.GetChildElement("focusmode").GetStringLower("value");
+        String focusMode = element.GetChild("focusmode").GetStringLower("value");
         SetFocusMode((FocusMode)GetStringListIndex(focusMode, focusModes, FM_NOTFOCUSABLE));
         SetFocusMode((FocusMode)GetStringListIndex(focusMode, focusModes, FM_NOTFOCUSABLE));
         if (focusMode == "defocusable")
         if (focusMode == "defocusable")
             SetFocusMode(FM_FOCUSABLE_DEFOCUSABLE);
             SetFocusMode(FM_FOCUSABLE_DEFOCUSABLE);
     }
     }
-    if (element.HasChildElement("dragdropmode"))
+    if (element.HasChild("dragdropmode"))
     {
     {
-        String dragDropMode = element.GetChildElement("dragdropmode").GetStringLower("value");
+        String dragDropMode = element.GetChild("dragdropmode").GetStringLower("value");
         SetDragDropMode(GetStringListIndex(dragDropMode, dragDropModes, DD_DISABLED));
         SetDragDropMode(GetStringListIndex(dragDropMode, dragDropModes, DD_DISABLED));
     }
     }
-    if (element.HasChildElement("layout"))
+    if (element.HasChild("layout"))
     {
     {
-        XMLElement layoutElem = element.GetChildElement("layout");
+        XMLElement layoutElem = element.GetChild("layout");
         String mode = layoutElem.GetStringLower("mode");
         String mode = layoutElem.GetStringLower("mode");
         if (mode == "free")
         if (mode == "free")
             layoutMode_ = LM_FREE;
             layoutMode_ = LM_FREE;
@@ -232,8 +232,8 @@ void UIElement::SetStyle(const XMLElement& element)
         else
         else
             UpdateLayout();
             UpdateLayout();
     }
     }
-    if (element.HasChildElement("vars"))
-        vars_ = element.GetChildElement("vars").GetVariantMap();
+    if (element.HasChild("vars"))
+        vars_ = element.GetChild("vars").GetVariantMap();
 }
 }
 
 
 void UIElement::Update(float timeStep)
 void UIElement::Update(float timeStep)
@@ -577,8 +577,8 @@ void UIElement::SetStyle(XMLFile* file, const String& typeName)
     if (!file)
     if (!file)
         return;
         return;
     
     
-    XMLElement rootElem = file->GetRootElement();
-    XMLElement childElem = rootElem.GetChildElement("element");
+    XMLElement rootElem = file->GetRoot();
+    XMLElement childElem = rootElem.GetChild("element");
     while (childElem)
     while (childElem)
     {
     {
         if (childElem.GetString("type") == typeName)
         if (childElem.GetString("type") == typeName)
@@ -586,7 +586,7 @@ void UIElement::SetStyle(XMLFile* file, const String& typeName)
             SetStyle(childElem);
             SetStyle(childElem);
             return;
             return;
         }
         }
-        childElem = childElem.GetNextElement("element");
+        childElem = childElem.GetNext("element");
     }
     }
 }
 }
 
 
@@ -737,7 +737,7 @@ void UIElement::EnableLayoutUpdate()
 void UIElement::BringToFront()
 void UIElement::BringToFront()
 {
 {
     // Follow the parent chain to the top level window. If it has BringToFront mode, bring it to front now
     // Follow the parent chain to the top level window. If it has BringToFront mode, bring it to front now
-    UIElement* root = GetRootElement();
+    UIElement* root = GetRoot();
     UIElement* ptr = this;
     UIElement* ptr = this;
     while (ptr && ptr->GetParent() != root)
     while (ptr && ptr->GetParent() != root)
         ptr = ptr->GetParent();
         ptr = ptr->GetParent();
@@ -954,7 +954,7 @@ UIElement* UIElement::GetChild(const String& name, bool recursive) const
     return 0;
     return 0;
 }
 }
 
 
-UIElement* UIElement::GetRootElement() const
+UIElement* UIElement::GetRoot() const
 {
 {
     UIElement* root = parent_;
     UIElement* root = parent_;
     if (!root)
     if (!root)

+ 1 - 1
Engine/UI/UIElement.h

@@ -329,7 +329,7 @@ public:
     /// Return parent element
     /// Return parent element
     UIElement* GetParent() const { return parent_; }
     UIElement* GetParent() const { return parent_; }
     /// Return root element
     /// Return root element
-    UIElement* GetRootElement() const;
+    UIElement* GetRoot() const;
     /// Return precalculated 32-bit color. Only valid when no gradient
     /// Return precalculated 32-bit color. Only valid when no gradient
     unsigned GetUIntColor();
     unsigned GetUIntColor();
     /// Return user variables
     /// Return user variables

+ 6 - 6
Engine/UI/Window.cpp

@@ -58,12 +58,12 @@ void Window::SetStyle(const XMLElement& element)
 {
 {
     BorderImage::SetStyle(element);
     BorderImage::SetStyle(element);
     
     
-    if (element.HasChildElement("resizeborder"))
-        SetResizeBorder(element.GetChildElement("resizeborder").GetIntRect("value"));
-    if (element.HasChildElement("movable"))
-        SetMovable(element.GetChildElement("movable").GetBool("enable"));
-    if (element.HasChildElement("resizable"))
-        SetResizable(element.GetChildElement("resizable").GetBool("enable"));
+    if (element.HasChild("resizeborder"))
+        SetResizeBorder(element.GetChild("resizeborder").GetIntRect("value"));
+    if (element.HasChild("movable"))
+        SetMovable(element.GetChild("movable").GetBool("enable"));
+    if (element.HasChild("resizable"))
+        SetResizable(element.GetChild("resizable").GetBool("enable"));
 }
 }
 
 
 void Window::OnHover(const IntVector2& position, const IntVector2& screenPosition, int buttons, int qualifiers, Cursor* cursor)
 void Window::OnHover(const IntVector2& position, const IntVector2& screenPosition, int buttons, int qualifiers, Cursor* cursor)

+ 8 - 8
Tools/AssetImporter/AssetImporter.cpp

@@ -1167,7 +1167,7 @@ void BuildAndSaveMaterial(aiMaterial* material, Set<String>& usedTextures)
     
     
     // Do not actually create a material instance, but instead craft an xml file manually
     // Do not actually create a material instance, but instead craft an xml file manually
     XMLFile outMaterial(context_);
     XMLFile outMaterial(context_);
-    XMLElement materialElem = outMaterial.CreateRootElement("material");
+    XMLElement materialElem = outMaterial.CreateRoot("material");
     
     
     String diffuseTexName;
     String diffuseTexName;
     String normalTexName;
     String normalTexName;
@@ -1211,35 +1211,35 @@ void BuildAndSaveMaterial(aiMaterial* material, Set<String>& usedTextures)
     if (hasAlpha)
     if (hasAlpha)
         techniqueName += "Alpha";
         techniqueName += "Alpha";
     
     
-    XMLElement techniqueElem = materialElem.CreateChildElement("technique");
+    XMLElement techniqueElem = materialElem.CreateChild("technique");
     techniqueElem.SetString("name", techniqueName + ".xml");
     techniqueElem.SetString("name", techniqueName + ".xml");
     
     
     if (!diffuseTexName.Empty())
     if (!diffuseTexName.Empty())
     {
     {
-        XMLElement diffuseElem = materialElem.CreateChildElement("texture");
+        XMLElement diffuseElem = materialElem.CreateChild("texture");
         diffuseElem.SetString("unit", "diffuse");
         diffuseElem.SetString("unit", "diffuse");
         diffuseElem.SetString("name", (useSubdirs_ ? "Textures/" : "") + diffuseTexName);
         diffuseElem.SetString("name", (useSubdirs_ ? "Textures/" : "") + diffuseTexName);
         usedTextures.Insert(diffuseTexName);
         usedTextures.Insert(diffuseTexName);
     }
     }
     if (!normalTexName.Empty())
     if (!normalTexName.Empty())
     {
     {
-        XMLElement normalElem = materialElem.CreateChildElement("texture");
+        XMLElement normalElem = materialElem.CreateChild("texture");
         normalElem.SetString("unit", "diffuse");
         normalElem.SetString("unit", "diffuse");
         normalElem.SetString("name", (useSubdirs_ ? "Textures/" : "") + normalTexName);
         normalElem.SetString("name", (useSubdirs_ ? "Textures/" : "") + normalTexName);
         usedTextures.Insert(normalTexName);
         usedTextures.Insert(normalTexName);
     }
     }
     
     
-    XMLElement diffuseColorElem = materialElem.CreateChildElement("parameter");
+    XMLElement diffuseColorElem = materialElem.CreateChild("parameter");
     diffuseColorElem.SetString("name", "MatDiffColor");
     diffuseColorElem.SetString("name", "MatDiffColor");
     diffuseColorElem.SetColor("value", diffuseColor);
     diffuseColorElem.SetColor("value", diffuseColor);
-    XMLElement specularElem = materialElem.CreateChildElement("parameter");
+    XMLElement specularElem = materialElem.CreateChild("parameter");
     specularElem.SetString("name", "MatSpecProperties");
     specularElem.SetString("name", "MatSpecProperties");
     specularElem.SetVector2("value", Vector2(specIntensity, specPower));
     specularElem.SetVector2("value", Vector2(specIntensity, specPower));
     
     
     if (twoSided)
     if (twoSided)
     {
     {
-        XMLElement cullElem = materialElem.CreateChildElement("cull");
-        XMLElement shadowCullElem = materialElem.CreateChildElement("shadowcull");
+        XMLElement cullElem = materialElem.CreateChild("cull");
+        XMLElement shadowCullElem = materialElem.CreateChild("shadowcull");
         cullElem.SetString("value", "none");
         cullElem.SetString("value", "none");
         shadowCullElem.SetString("value", "none");
         shadowCullElem.SetString("value", "none");
     }
     }

+ 69 - 69
Tools/OgreImporter/OgreImporter.cpp

@@ -134,12 +134,12 @@ void LoadSkeleton(const String& skeletonFileName)
     skeletonFileSource.Open(skeletonFileName);
     skeletonFileSource.Open(skeletonFileName);
     if (!skelFile_->Load(skeletonFileSource))
     if (!skelFile_->Load(skeletonFileSource))
         PrintLine("Failed to load skeleton " + skeletonFileName);
         PrintLine("Failed to load skeleton " + skeletonFileName);
-    skeletonRoot = skelFile_->GetRootElement();
+    skeletonRoot = skelFile_->GetRoot();
     
     
     if (skeletonRoot)
     if (skeletonRoot)
     {
     {
-        XMLElement bonesRoot = skeletonRoot.GetChildElement("bones");
-        XMLElement bone = bonesRoot.GetChildElement("bone");
+        XMLElement bonesRoot = skeletonRoot.GetChild("bones");
+        XMLElement bone = bonesRoot.GetChild("bone");
         while (bone)
         while (bone)
         {
         {
             unsigned index = bone.GetInt("id");
             unsigned index = bone.GetInt("id");
@@ -148,14 +148,14 @@ void LoadSkeleton(const String& skeletonFileName)
                 bones_.Resize(index + 1);
                 bones_.Resize(index + 1);
             
             
             // Convert from right- to left-handed
             // Convert from right- to left-handed
-            XMLElement position = bone.GetChildElement("position");
+            XMLElement position = bone.GetChild("position");
             float x = position.GetFloat("x");
             float x = position.GetFloat("x");
             float y = position.GetFloat("y");
             float y = position.GetFloat("y");
             float z = position.GetFloat("z");
             float z = position.GetFloat("z");
             Vector3 pos(x, y, -z);
             Vector3 pos(x, y, -z);
             
             
-            XMLElement rotation = bone.GetChildElement("rotation");
-            XMLElement axis = rotation.GetChildElement("axis");
+            XMLElement rotation = bone.GetChild("rotation");
+            XMLElement axis = rotation.GetChild("axis");
             float angle = -rotation.GetFloat("angle") * M_RADTODEG;
             float angle = -rotation.GetFloat("angle") * M_RADTODEG;
             x = axis.GetFloat("x");
             x = axis.GetFloat("x");
             y = axis.GetFloat("y");
             y = axis.GetFloat("y");
@@ -171,12 +171,12 @@ void LoadSkeleton(const String& skeletonFileName)
             bones_[index].collisionMask_ = 0;
             bones_[index].collisionMask_ = 0;
             bones_[index].radius_ = 0.0f;
             bones_[index].radius_ = 0.0f;
             
             
-            bone = bone.GetNextElement("bone");
+            bone = bone.GetNext("bone");
         }
         }
         
         
         // Go through the bone hierarchy
         // Go through the bone hierarchy
-        XMLElement boneHierarchy = skeletonRoot.GetChildElement("bonehierarchy");
-        XMLElement boneParent = boneHierarchy.GetChildElement("boneparent");
+        XMLElement boneHierarchy = skeletonRoot.GetChild("bonehierarchy");
+        XMLElement boneParent = boneHierarchy.GetChild("boneparent");
         while (boneParent)
         while (boneParent)
         {
         {
             String bone = boneParent.GetString("bone");
             String bone = boneParent.GetString("bone");
@@ -189,7 +189,7 @@ void LoadSkeleton(const String& skeletonFileName)
                 ErrorExit("Found indeterminate parent bone assignment");
                 ErrorExit("Found indeterminate parent bone assignment");
             bones_[i].parentIndex_ = j;
             bones_[i].parentIndex_ = j;
             
             
-            boneParent = boneParent.GetNextElement("boneparent");
+            boneParent = boneParent.GetNext("boneparent");
         }
         }
         
         
         // Calculate bone derived positions
         // Calculate bone derived positions
@@ -232,21 +232,21 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
     if (!meshFile_->Load(meshFileSource))
     if (!meshFile_->Load(meshFileSource))
         ErrorExit("Could not load input file " + inputFileName);
         ErrorExit("Could not load input file " + inputFileName);
     
     
-    XMLElement root = meshFile_->GetRootElement();
-    XMLElement subMeshes = root.GetChildElement("submeshes");
-    XMLElement skeletonLink = root.GetChildElement("skeletonlink");
+    XMLElement root = meshFile_->GetRoot();
+    XMLElement subMeshes = root.GetChild("submeshes");
+    XMLElement skeletonLink = root.GetChild("skeletonlink");
     
     
     String skeletonName = skeletonLink.GetString("name");
     String skeletonName = skeletonLink.GetString("name");
     if (!skeletonName.Empty())
     if (!skeletonName.Empty())
         LoadSkeleton(GetPath(inputFileName) + GetFileName(skeletonName) + ".skeleton.xml");
         LoadSkeleton(GetPath(inputFileName) + GetFileName(skeletonName) + ".skeleton.xml");
     
     
     // Check whether there's benefit of avoiding 32bit indices by splitting each submesh into own buffer
     // Check whether there's benefit of avoiding 32bit indices by splitting each submesh into own buffer
-    XMLElement subMesh = subMeshes.GetChildElement("submesh");
+    XMLElement subMesh = subMeshes.GetChild("submesh");
     unsigned totalVertices = 0;
     unsigned totalVertices = 0;
     unsigned maxSubMeshVertices = 0;
     unsigned maxSubMeshVertices = 0;
     while (subMesh)
     while (subMesh)
     {
     {
-        XMLElement geometry = subMesh.GetChildElement("geometry");
+        XMLElement geometry = subMesh.GetChild("geometry");
         if (geometry)
         if (geometry)
         {
         {
             unsigned vertices = geometry.GetInt("vertexcount");
             unsigned vertices = geometry.GetInt("vertexcount");
@@ -256,10 +256,10 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
         }
         }
         ++numSubMeshes_;
         ++numSubMeshes_;
         
         
-        subMesh = subMesh.GetNextElement("submesh");
+        subMesh = subMesh.GetNext("submesh");
     }
     }
     
     
-    XMLElement sharedGeometry = root.GetChildElement("sharedgeometry");
+    XMLElement sharedGeometry = root.GetChild("sharedgeometry");
     if (sharedGeometry)
     if (sharedGeometry)
     {
     {
         unsigned vertices = sharedGeometry.GetInt("vertexcount");
         unsigned vertices = sharedGeometry.GetInt("vertexcount");
@@ -280,7 +280,7 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
         indexBuffers_.Resize(1);
         indexBuffers_.Resize(1);
     }
     }
     
     
-    subMesh = subMeshes.GetChildElement("submesh");
+    subMesh = subMeshes.GetChild("submesh");
     unsigned indexStart = 0;
     unsigned indexStart = 0;
     unsigned vertexStart = 0;
     unsigned vertexStart = 0;
     unsigned subMeshIndex = 0;
     unsigned subMeshIndex = 0;
@@ -290,8 +290,8 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
     
     
     while (subMesh)
     while (subMesh)
     {
     {
-        XMLElement geometry = subMesh.GetChildElement("geometry");
-        XMLElement faces = subMesh.GetChildElement("faces");
+        XMLElement geometry = subMesh.GetChild("geometry");
+        XMLElement faces = subMesh.GetChild("faces");
         
         
         // If no submesh vertexbuffer, process the shared geometry, but do it only once
         // If no submesh vertexbuffer, process the shared geometry, but do it only once
         unsigned vertices = 0;
         unsigned vertices = 0;
@@ -299,7 +299,7 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
         {
         {
             vertexStart = 0;
             vertexStart = 0;
             if (!subMeshIndex)
             if (!subMeshIndex)
-                geometry = root.GetChildElement("sharedgeometry");
+                geometry = root.GetChild("sharedgeometry");
         }
         }
         
         
         if (geometry)
         if (geometry)
@@ -338,7 +338,7 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
         // Ogre may have multiple buffers in one submesh. These will be merged into one
         // Ogre may have multiple buffers in one submesh. These will be merged into one
         XMLElement bufferDef;
         XMLElement bufferDef;
         if (geometry)
         if (geometry)
-            bufferDef = geometry.GetChildElement("vertexbuffer");
+            bufferDef = geometry.GetChild("vertexbuffer");
         
         
         while (bufferDef)
         while (bufferDef)
         {
         {
@@ -352,10 +352,10 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
             unsigned vertexNum = vertexStart;
             unsigned vertexNum = vertexStart;
             if (vertices)
             if (vertices)
             {
             {
-                XMLElement vertex = bufferDef.GetChildElement("vertex");
+                XMLElement vertex = bufferDef.GetChild("vertex");
                 while (vertex)
                 while (vertex)
                 {
                 {
-                    XMLElement position = vertex.GetChildElement("position");
+                    XMLElement position = vertex.GetChild("position");
                     if (position)
                     if (position)
                     {
                     {
                         // Convert from right- to left-handed
                         // Convert from right- to left-handed
@@ -367,7 +367,7 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
                         vBuf->vertices_[vertexNum].position_ = vec;
                         vBuf->vertices_[vertexNum].position_ = vec;
                         boundingBox_.Merge(vec);
                         boundingBox_.Merge(vec);
                     }
                     }
-                    XMLElement normal = vertex.GetChildElement("normal");
+                    XMLElement normal = vertex.GetChild("normal");
                     if (normal)
                     if (normal)
                     {
                     {
                         // Convert from right- to left-handed
                         // Convert from right- to left-handed
@@ -378,7 +378,7 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
                         
                         
                         vBuf->vertices_[vertexNum].normal_ = vec;
                         vBuf->vertices_[vertexNum].normal_ = vec;
                     }
                     }
-                    XMLElement uv = vertex.GetChildElement("texcoord");
+                    XMLElement uv = vertex.GetChild("texcoord");
                     if (uv)
                     if (uv)
                     {
                     {
                         float x = uv.GetFloat("u");
                         float x = uv.GetFloat("u");
@@ -389,17 +389,17 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
                     }
                     }
                     
                     
                     vertexNum++;
                     vertexNum++;
-                    vertex = vertex.GetNextElement("vertex");
+                    vertex = vertex.GetNext("vertex");
                 }
                 }
             }
             }
             
             
-            bufferDef = bufferDef.GetNextElement("vertexbuffer");
+            bufferDef = bufferDef.GetNext("vertexbuffer");
         }
         }
         
         
         unsigned triangles = faces.GetInt("count");
         unsigned triangles = faces.GetInt("count");
         unsigned indices = triangles * 3;
         unsigned indices = triangles * 3;
         
         
-        XMLElement triangle = faces.GetChildElement("face");
+        XMLElement triangle = faces.GetChild("face");
         while (triangle)
         while (triangle)
         {
         {
             unsigned v1 = triangle.GetInt("v1");
             unsigned v1 = triangle.GetInt("v1");
@@ -408,7 +408,7 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
             iBuf->indices_.Push(v3 + vertexStart);
             iBuf->indices_.Push(v3 + vertexStart);
             iBuf->indices_.Push(v2 + vertexStart);
             iBuf->indices_.Push(v2 + vertexStart);
             iBuf->indices_.Push(v1 + vertexStart);
             iBuf->indices_.Push(v1 + vertexStart);
-            triangle = triangle.GetNextElement("face");
+            triangle = triangle.GetNext("face");
         }
         }
         
         
         subGeometryLodLevel.indexStart_ = indexStart;
         subGeometryLodLevel.indexStart_ = indexStart;
@@ -416,12 +416,12 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
         if (vertexStart + vertices > 65535)
         if (vertexStart + vertices > 65535)
             iBuf->indexSize_ = sizeof(unsigned);
             iBuf->indexSize_ = sizeof(unsigned);
         
         
-        XMLElement boneAssignments = subMesh.GetChildElement("boneassignments");
+        XMLElement boneAssignments = subMesh.GetChild("boneassignments");
         if (bones_.Size())
         if (bones_.Size())
         {
         {
             if (boneAssignments)
             if (boneAssignments)
             {
             {
-                XMLElement boneAssignment = boneAssignments.GetChildElement("vertexboneassignment");
+                XMLElement boneAssignment = boneAssignments.GetChild("vertexboneassignment");
                 while (boneAssignment)
                 while (boneAssignment)
                 {
                 {
                     unsigned vertex = boneAssignment.GetInt("vertexindex") + vertexStart;
                     unsigned vertex = boneAssignment.GetInt("vertexindex") + vertexStart;
@@ -452,7 +452,7 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
                             bones_[bone].collisionMask_ |= 2;
                             bones_[bone].collisionMask_ |= 2;
                         }
                         }
                     }
                     }
-                    boneAssignment = boneAssignment.GetNextElement("vertexboneassignment");
+                    boneAssignment = boneAssignment.GetNext("vertexboneassignment");
                 }
                 }
             }
             }
             
             
@@ -544,18 +544,18 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
         thisSubGeometry.Push(subGeometryLodLevel);
         thisSubGeometry.Push(subGeometryLodLevel);
         subGeometries_.Push(thisSubGeometry);
         subGeometries_.Push(thisSubGeometry);
         
         
-        subMesh = subMesh.GetNextElement("submesh");
+        subMesh = subMesh.GetNext("submesh");
         subMeshIndex++;
         subMeshIndex++;
     }
     }
     
     
     // Process LOD levels, if any
     // Process LOD levels, if any
-    XMLElement lods = root.GetChildElement("levelofdetail");
+    XMLElement lods = root.GetChild("levelofdetail");
     if (lods)
     if (lods)
     {
     {
         try
         try
         {
         {
             // For now, support only generated LODs, where the vertices are the same
             // For now, support only generated LODs, where the vertices are the same
-            XMLElement lod = lods.GetChildElement("lodgenerated");
+            XMLElement lod = lods.GetChild("lodgenerated");
             while (lod)
             while (lod)
             {
             {
                 float distance = M_EPSILON;
                 float distance = M_EPSILON;
@@ -563,7 +563,7 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
                     distance = sqrtf(lod.GetFloat("fromdepthsquared"));
                     distance = sqrtf(lod.GetFloat("fromdepthsquared"));
                 if (lod.HasAttribute("value"))
                 if (lod.HasAttribute("value"))
                     distance = lod.GetFloat("value");
                     distance = lod.GetFloat("value");
-                XMLElement lodSubMesh = lod.GetChildElement("lodfacelist");
+                XMLElement lodSubMesh = lod.GetChild("lodfacelist");
                 while (lodSubMesh)
                 while (lodSubMesh)
                 {
                 {
                     unsigned subMeshIndex = lodSubMesh.GetInt("submeshindex");
                     unsigned subMeshIndex = lodSubMesh.GetInt("submeshindex");
@@ -598,7 +598,7 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
                     newLodLevel.indexCount_ = indexCount;
                     newLodLevel.indexCount_ = indexCount;
                     
                     
                     // Append indices to the original index buffer
                     // Append indices to the original index buffer
-                    XMLElement triangle = lodSubMesh.GetChildElement("face");
+                    XMLElement triangle = lodSubMesh.GetChild("face");
                     while (triangle)
                     while (triangle)
                     {
                     {
                         unsigned v1 = triangle.GetInt("v1");
                         unsigned v1 = triangle.GetInt("v1");
@@ -607,7 +607,7 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
                         iBuf->indices_.Push(v3 + vertexStart);
                         iBuf->indices_.Push(v3 + vertexStart);
                         iBuf->indices_.Push(v2 + vertexStart);
                         iBuf->indices_.Push(v2 + vertexStart);
                         iBuf->indices_.Push(v1 + vertexStart);
                         iBuf->indices_.Push(v1 + vertexStart);
-                        triangle = triangle.GetNextElement("face");
+                        triangle = triangle.GetNext("face");
                     }
                     }
                     
                     
                     OptimizeIndices(&newLodLevel, vBuf, iBuf);
                     OptimizeIndices(&newLodLevel, vBuf, iBuf);
@@ -615,9 +615,9 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
                     subGeometries_[subMeshIndex].Push(newLodLevel);
                     subGeometries_[subMeshIndex].Push(newLodLevel);
                     PrintLine("Processed LOD level for submesh " + String(subMeshIndex + 1) + ": distance " + String(distance));
                     PrintLine("Processed LOD level for submesh " + String(subMeshIndex + 1) + ": distance " + String(distance));
                     
                     
-                    lodSubMesh = lodSubMesh.GetNextElement("lodfacelist");
+                    lodSubMesh = lodSubMesh.GetNext("lodfacelist");
                 }
                 }
-                lod = lod.GetNextElement("lodgenerated");
+                lod = lod.GetNext("lodgenerated");
             }
             }
         }
         }
         catch (...) {}
         catch (...) {}
@@ -630,49 +630,49 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
         try
         try
         {
         {
             Vector<XMLElement> poses;
             Vector<XMLElement> poses;
-            XMLElement posesRoot = root.GetChildElement("poses");
+            XMLElement posesRoot = root.GetChild("poses");
             if (posesRoot)
             if (posesRoot)
             {
             {
-                XMLElement pose = posesRoot.GetChildElement("pose");
+                XMLElement pose = posesRoot.GetChild("pose");
                 while (pose)
                 while (pose)
                 {
                 {
                     poses.Push(pose);
                     poses.Push(pose);
-                    pose = pose.GetNextElement("pose");
+                    pose = pose.GetNext("pose");
                 }
                 }
             }
             }
             
             
             // Then process animations using the poses
             // Then process animations using the poses
-            XMLElement animsRoot = root.GetChildElement("animations");
+            XMLElement animsRoot = root.GetChild("animations");
             if (animsRoot)
             if (animsRoot)
             {
             {
-                XMLElement anim = animsRoot.GetChildElement("animation");
+                XMLElement anim = animsRoot.GetChild("animation");
                 while (anim)
                 while (anim)
                 {
                 {
                     String name = anim.GetString("name");
                     String name = anim.GetString("name");
                     float length = anim.GetFloat("length");
                     float length = anim.GetFloat("length");
                     Set<unsigned> usedPoses;
                     Set<unsigned> usedPoses;
-                    XMLElement tracks = anim.GetChildElement("tracks");
+                    XMLElement tracks = anim.GetChild("tracks");
                     if (tracks)
                     if (tracks)
                     {
                     {
-                        XMLElement track = tracks.GetChildElement("track");
+                        XMLElement track = tracks.GetChild("track");
                         while (track)
                         while (track)
                         {
                         {
-                            XMLElement keyframes = track.GetChildElement("keyframes");
+                            XMLElement keyframes = track.GetChild("keyframes");
                             if (keyframes)
                             if (keyframes)
                             {
                             {
-                                XMLElement keyframe = keyframes.GetChildElement("keyframe");
+                                XMLElement keyframe = keyframes.GetChild("keyframe");
                                 while (keyframe)
                                 while (keyframe)
                                 {
                                 {
                                     float time = keyframe.GetFloat("time");
                                     float time = keyframe.GetFloat("time");
-                                    XMLElement poseref = keyframe.GetChildElement("poseref");
+                                    XMLElement poseref = keyframe.GetChild("poseref");
                                     // Get only the end pose
                                     // Get only the end pose
                                     if (poseref && time == length)
                                     if (poseref && time == length)
                                         usedPoses.Insert(poseref.GetInt("poseindex"));
                                         usedPoses.Insert(poseref.GetInt("poseindex"));
                                     
                                     
-                                    keyframe = keyframe.GetNextElement("keyframe");
+                                    keyframe = keyframe.GetNext("keyframe");
                                 }
                                 }
                             }
                             }
-                            track = track.GetNextElement("track");
+                            track = track.GetNext("track");
                         }
                         }
                     }
                     }
                     
                     
@@ -692,7 +692,7 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
                         {
                         {
                             XMLElement pose = poses[*i];
                             XMLElement pose = poses[*i];
                             unsigned targetSubMesh = pose.GetInt("index");
                             unsigned targetSubMesh = pose.GetInt("index");
-                            XMLElement poseOffset = pose.GetChildElement("poseoffset");
+                            XMLElement poseOffset = pose.GetChild("poseoffset");
                         
                         
                             if (useOneBuffer_)
                             if (useOneBuffer_)
                                 newMorph.buffers_[bufIndex].vertexBuffer_ = 0;
                                 newMorph.buffers_[bufIndex].vertexBuffer_ = 0;
@@ -732,7 +732,7 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
                                 ModelVertex newVertex;
                                 ModelVertex newVertex;
                                 newVertex.position_ = vec;
                                 newVertex.position_ = vec;
                                 newMorph.buffers_[bufIndex].vertices_[vertexIndex] = newVertex;
                                 newMorph.buffers_[bufIndex].vertices_[vertexIndex] = newVertex;
-                                poseOffset = poseOffset.GetNextElement("poseoffset");
+                                poseOffset = poseOffset.GetNext("poseoffset");
                             }
                             }
                             
                             
                             if (!useOneBuffer_)
                             if (!useOneBuffer_)
@@ -742,7 +742,7 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
                         PrintLine("Processed morph " + name + " with " + String(usedPoses.Size()) + " sub-poses");
                         PrintLine("Processed morph " + name + " with " + String(usedPoses.Size()) + " sub-poses");
                     }
                     }
                     
                     
-                    anim = anim.GetNextElement("animation");
+                    anim = anim.GetNext("animation");
                 }
                 }
             }
             }
         }
         }
@@ -937,22 +937,22 @@ void WriteOutput(const String& outputFileName, bool exportAnimations, bool rotat
         dest.WriteBoundingBox(boundingBox_);
         dest.WriteBoundingBox(boundingBox_);
     }
     }
     
     
-    XMLElement skeletonRoot = skelFile_->GetRootElement("");
+    XMLElement skeletonRoot = skelFile_->GetRoot("");
     if (skeletonRoot && exportAnimations)
     if (skeletonRoot && exportAnimations)
     {
     {
         // Go through animations
         // Go through animations
-        XMLElement animationsRoot = skeletonRoot.GetChildElement("animations");
+        XMLElement animationsRoot = skeletonRoot.GetChild("animations");
         if (animationsRoot)
         if (animationsRoot)
         {
         {
-            XMLElement animation = animationsRoot.GetChildElement("animation");
+            XMLElement animation = animationsRoot.GetChild("animation");
             while (animation)
             while (animation)
             {
             {
                 ModelAnimation newAnimation;
                 ModelAnimation newAnimation;
                 newAnimation.name_ = animation.GetString("name");
                 newAnimation.name_ = animation.GetString("name");
                 newAnimation.length_ = animation.GetFloat("length");
                 newAnimation.length_ = animation.GetFloat("length");
                 
                 
-                XMLElement tracksRoot = animation.GetChildElement("tracks");
-                XMLElement track = tracksRoot.GetChildElement("track");
+                XMLElement tracksRoot = animation.GetChild("tracks");
+                XMLElement track = tracksRoot.GetChild("track");
                 while (track)
                 while (track)
                 {
                 {
                     String trackName = track.GetString("bone");
                     String trackName = track.GetString("bone");
@@ -975,21 +975,21 @@ void WriteOutput(const String& outputFileName, bool exportAnimations, bool rotat
                     else
                     else
                         newAnimationTrack.channelMask_ = CHANNEL_ROTATION;
                         newAnimationTrack.channelMask_ = CHANNEL_ROTATION;
                     
                     
-                    XMLElement keyFramesRoot = track.GetChildElement("keyframes");
-                    XMLElement keyFrame = keyFramesRoot.GetChildElement("keyframe");
+                    XMLElement keyFramesRoot = track.GetChild("keyframes");
+                    XMLElement keyFrame = keyFramesRoot.GetChild("keyframe");
                     while (keyFrame)
                     while (keyFrame)
                     {
                     {
                         AnimationKeyFrame newKeyFrame;
                         AnimationKeyFrame newKeyFrame;
                         
                         
                         // Convert from right- to left-handed
                         // Convert from right- to left-handed
-                        XMLElement position = keyFrame.GetChildElement("translate");
+                        XMLElement position = keyFrame.GetChild("translate");
                         float x = position.GetFloat("x");
                         float x = position.GetFloat("x");
                         float y = position.GetFloat("y");
                         float y = position.GetFloat("y");
                         float z = position.GetFloat("z");
                         float z = position.GetFloat("z");
                         Vector3 pos(x, y, -z);
                         Vector3 pos(x, y, -z);
                         
                         
-                        XMLElement rotation = keyFrame.GetChildElement("rotate");
-                        XMLElement axis = rotation.GetChildElement("axis");
+                        XMLElement rotation = keyFrame.GetChild("rotate");
+                        XMLElement axis = rotation.GetChild("axis");
                         float angle = -rotation.GetFloat("angle") * M_RADTODEG;
                         float angle = -rotation.GetFloat("angle") * M_RADTODEG;
                         x = axis.GetFloat("x");
                         x = axis.GetFloat("x");
                         y = axis.GetFloat("y");
                         y = axis.GetFloat("y");
@@ -1006,7 +1006,7 @@ void WriteOutput(const String& outputFileName, bool exportAnimations, bool rotat
                         newKeyFrame.rotation_ = rot;
                         newKeyFrame.rotation_ = rot;
                         
                         
                         newAnimationTrack.keyFrames_.Push(newKeyFrame);
                         newAnimationTrack.keyFrames_.Push(newKeyFrame);
-                        keyFrame = keyFrame.GetNextElement("keyframe");
+                        keyFrame = keyFrame.GetNext("keyframe");
                     }
                     }
                     
                     
                     // Make sure keyframes are sorted from beginning to end
                     // Make sure keyframes are sorted from beginning to end
@@ -1016,7 +1016,7 @@ void WriteOutput(const String& outputFileName, bool exportAnimations, bool rotat
                     if (newAnimationTrack.keyFrames_.Size())
                     if (newAnimationTrack.keyFrames_.Size())
                         newAnimation.tracks_.Push(newAnimationTrack);
                         newAnimation.tracks_.Push(newAnimationTrack);
                     
                     
-                    track = track.GetNextElement("track");
+                    track = track.GetNext("track");
                 }
                 }
                 
                 
                 // Write each animation into a separate file
                 // Write each animation into a separate file
@@ -1051,7 +1051,7 @@ void WriteOutput(const String& outputFileName, bool exportAnimations, bool rotat
                     }
                     }
                 }
                 }
                 
                 
-                animation = animation.GetNextElement("animation");
+                animation = animation.GetNext("animation");
                 PrintLine("Processed animation " + newAnimation.name_);
                 PrintLine("Processed animation " + newAnimation.name_);
             }
             }
         }
         }

+ 14 - 14
Tools/ShaderCompiler/ShaderCompiler.cpp

@@ -267,14 +267,14 @@ void Run(const Vector<String>& arguments)
     if (!doc.Load(source))
     if (!doc.Load(source))
         ErrorExit("Could not open input file " + arguments[0]);
         ErrorExit("Could not open input file " + arguments[0]);
     
     
-    XMLElement shaders = doc.GetRootElement("shaders");
+    XMLElement shaders = doc.GetRoot("shaders");
     if (!shaders)
     if (!shaders)
         ErrorExit("No shaders element in " + source.GetName());
         ErrorExit("No shaders element in " + source.GetName());
     
     
     XMLFile outDoc(context_);
     XMLFile outDoc(context_);
-    XMLElement outShaders = outDoc.CreateRootElement("shaders");
+    XMLElement outShaders = outDoc.CreateRoot("shaders");
     
     
-    XMLElement shader = shaders.GetChildElement("shader");
+    XMLElement shader = shaders.GetChild("shader");
     while (shader)
     while (shader)
     {
     {
         String source = shader.GetString("name");
         String source = shader.GetString("name");
@@ -287,7 +287,7 @@ void Run(const Vector<String>& arguments)
         
         
         Shader baseShader(source, compileType);
         Shader baseShader(source, compileType);
         
         
-        XMLElement variation = shader.GetChildElement("");
+        XMLElement variation = shader.GetChild("");
         while (variation)
         while (variation)
         {
         {
             String value = variation.GetName();
             String value = variation.GetName();
@@ -313,38 +313,38 @@ void Run(const Vector<String>& arguments)
                 if (!simpleRequire.Empty())
                 if (!simpleRequire.Empty())
                     newVar.requires_.Push(simpleRequire);
                     newVar.requires_.Push(simpleRequire);
                 
                 
-                XMLElement define = variation.GetChildElement("define");
+                XMLElement define = variation.GetChild("define");
                 while (define)
                 while (define)
                 {
                 {
                     newVar.defines_.Push(define.GetString("name"));
                     newVar.defines_.Push(define.GetString("name"));
-                    define = define.GetNextElement("define");
+                    define = define.GetNext("define");
                 }
                 }
                 
                 
-                XMLElement exclude = variation.GetChildElement("exclude");
+                XMLElement exclude = variation.GetChild("exclude");
                 while (exclude)
                 while (exclude)
                 {
                 {
                     newVar.excludes_.Push(exclude.GetString("name"));
                     newVar.excludes_.Push(exclude.GetString("name"));
-                    exclude = exclude.GetNextElement("exclude");
+                    exclude = exclude.GetNext("exclude");
                 }
                 }
                 
                 
-                XMLElement include = variation.GetChildElement("include");
+                XMLElement include = variation.GetChild("include");
                 while (include)
                 while (include)
                 {
                 {
                     newVar.includes_.Push(include.GetString("name"));
                     newVar.includes_.Push(include.GetString("name"));
-                    include = include.GetNextElement("include");
+                    include = include.GetNext("include");
                 }
                 }
                 
                 
-                XMLElement require = variation.GetChildElement("require");
+                XMLElement require = variation.GetChild("require");
                 while (require)
                 while (require)
                 {
                 {
                     newVar.requires_.Push(require.GetString("name"));
                     newVar.requires_.Push(require.GetString("name"));
-                    require = require.GetNextElement("require");
+                    require = require.GetNext("require");
                 }
                 }
                 
                 
                 baseShader.variations_.Push(newVar);
                 baseShader.variations_.Push(newVar);
             }
             }
             
             
-            variation = variation.GetNextElement();
+            variation = variation.GetNext();
         }
         }
         
         
         if (baseShader.type_ != Both)
         if (baseShader.type_ != Both)
@@ -357,7 +357,7 @@ void Run(const Vector<String>& arguments)
             CompileVariations(baseShader, outShaders);
             CompileVariations(baseShader, outShaders);
         }
         }
         
         
-        shader = shader.GetNextElement("shader");
+        shader = shader.GetNext("shader");
     }
     }
 }
 }