2
0
Эх сурвалжийг харах

GetUInt() etc -> GetU32() | Add color32 type alias

1vanK 3 жил өмнө
parent
commit
544ce6a558
100 өөрчлөгдсөн 535 нэмэгдсэн , 505 устгасан
  1. 2 2
      Source/Samples/02_HelloGUI/HelloGUI.cpp
  2. 1 1
      Source/Samples/16_Chat/Chat.cpp
  3. 1 1
      Source/Samples/17_SceneReplication/SceneReplication.cpp
  4. 2 2
      Source/Samples/25_Urho2DParticle/Urho2DParticle.cpp
  5. 1 1
      Source/Samples/26_ConsoleInput/ConsoleInput.cpp
  6. 3 3
      Source/Samples/32_Physics2DConstraints/Urho2DConstraints.cpp
  7. 8 8
      Source/Samples/37_UIDrag/UIDrag.cpp
  8. 3 3
      Source/Samples/39_CrowdNavigation/CrowdNavigation.cpp
  9. 2 2
      Source/Samples/41_DatabaseDemo/DatabaseDemo.cpp
  10. 2 2
      Source/Samples/48_Hello3DUI/Hello3DUI.cpp
  11. 1 1
      Source/Samples/51_Urho2DStretchableSprite/Urho2DStretchableSprite.cpp
  12. 1 1
      Source/Samples/53_LANDiscovery/LANDiscovery.cpp
  13. 1 1
      Source/Samples/55_Clicker/Clicker.cpp
  14. 2 2
      Source/Samples/Sample.inl
  15. 1 1
      Source/Tools/AssetImporter/AssetImporter.cpp
  16. 28 2
      Source/Tools/BindingGenerator/ASUtils.cpp
  17. 1 0
      Source/Tools/BindingGenerator/XmlSourceData.cpp
  18. 19 19
      Source/Tools/OgreImporter/OgreImporter.cpp
  19. 1 1
      Source/Tools/OgreImporter/OgreImporterUtils.h
  20. 10 10
      Source/Tools/SpritePacker/SpritePacker.cpp
  21. 42 42
      Source/Urho3D/AngelScript/Generated_Members.h
  22. 1 0
      Source/Urho3D/AngelScript/Manual.cpp
  23. 4 4
      Source/Urho3D/AngelScript/ScriptFile.cpp
  24. 1 1
      Source/Urho3D/AngelScript/ScriptInstance.cpp
  25. 2 2
      Source/Urho3D/Audio/Sound.cpp
  26. 8 8
      Source/Urho3D/Core/Variant.cpp
  27. 16 16
      Source/Urho3D/Core/Variant.h
  28. 1 1
      Source/Urho3D/Engine/Application.cpp
  29. 2 2
      Source/Urho3D/Engine/Console.cpp
  30. 15 15
      Source/Urho3D/Engine/Engine.cpp
  31. 2 2
      Source/Urho3D/Graphics/AnimatedModel.cpp
  32. 1 1
      Source/Urho3D/Graphics/AnimationController.cpp
  33. 11 11
      Source/Urho3D/Graphics/BillboardSet.cpp
  34. 1 1
      Source/Urho3D/Graphics/CustomGeometry.cpp
  35. 1 1
      Source/Urho3D/Graphics/CustomGeometry.h
  36. 16 16
      Source/Urho3D/Graphics/DebugRenderer.cpp
  37. 1 1
      Source/Urho3D/Graphics/Graphics.cpp
  38. 6 6
      Source/Urho3D/Graphics/Material.cpp
  39. 2 2
      Source/Urho3D/Graphics/ParticleEffect.cpp
  40. 3 3
      Source/Urho3D/Graphics/ParticleEmitter.cpp
  41. 5 5
      Source/Urho3D/Graphics/RenderPath.cpp
  42. 14 14
      Source/Urho3D/Graphics/RibbonTrail.cpp
  43. 3 3
      Source/Urho3D/Graphics/StaticModelGroup.cpp
  44. 5 5
      Source/Urho3D/GraphicsAPI/Texture.cpp
  45. 2 2
      Source/Urho3D/IO/Serializer.cpp
  46. 7 7
      Source/Urho3D/Input/Input.cpp
  47. 13 13
      Source/Urho3D/Math/Color.cpp
  48. 9 7
      Source/Urho3D/Math/Color.h
  49. 9 9
      Source/Urho3D/Navigation/CrowdManager.cpp
  50. 2 2
      Source/Urho3D/Physics/RaycastVehicle.cpp
  51. 7 7
      Source/Urho3D/Resource/Image.cpp
  52. 1 1
      Source/Urho3D/Resource/Image.h
  53. 2 2
      Source/Urho3D/Resource/JSONFile.cpp
  54. 2 2
      Source/Urho3D/Resource/JSONValue.cpp
  55. 3 3
      Source/Urho3D/Resource/JSONValue.h
  56. 6 6
      Source/Urho3D/Resource/PListFile.cpp
  57. 3 3
      Source/Urho3D/Resource/PListFile.h
  58. 10 10
      Source/Urho3D/Resource/XMLElement.cpp
  59. 8 8
      Source/Urho3D/Resource/XMLElement.h
  60. 1 1
      Source/Urho3D/Scene/Component.cpp
  61. 7 7
      Source/Urho3D/Scene/Node.cpp
  62. 6 6
      Source/Urho3D/Scene/Scene.cpp
  63. 4 4
      Source/Urho3D/Scene/SceneResolver.cpp
  64. 5 5
      Source/Urho3D/Scene/Serializable.cpp
  65. 3 3
      Source/Urho3D/Scene/SplinePath.cpp
  66. 1 1
      Source/Urho3D/Scene/UnknownComponent.cpp
  67. 3 3
      Source/Urho3D/Scene/ValueAnimation.cpp
  68. 1 1
      Source/Urho3D/UI/DropDownList.cpp
  69. 1 1
      Source/Urho3D/UI/FileSelector.cpp
  70. 2 2
      Source/Urho3D/UI/Font.cpp
  71. 32 32
      Source/Urho3D/UI/FontFaceBitmap.cpp
  72. 8 8
      Source/Urho3D/UI/ListView.cpp
  73. 3 3
      Source/Urho3D/UI/Menu.cpp
  74. 3 3
      Source/Urho3D/UI/ScrollBar.cpp
  75. 4 4
      Source/Urho3D/UI/ScrollView.cpp
  76. 25 25
      Source/Urho3D/UI/UI.cpp
  77. 14 14
      Source/Urho3D/UI/UIBatch.cpp
  78. 1 1
      Source/Urho3D/UI/UIBatch.h
  79. 2 2
      Source/Urho3D/UI/UIComponent.cpp
  80. 2 2
      Source/Urho3D/UI/UIElement.cpp
  81. 3 3
      Source/Urho3D/Urho2D/AnimatedSprite2D.cpp
  82. 2 2
      Source/Urho3D/Urho2D/ParticleEffect2D.cpp
  83. 1 1
      Source/Urho3D/Urho2D/ParticleEmitter2D.cpp
  84. 16 16
      Source/Urho3D/Urho2D/SpriteSheet2D.cpp
  85. 1 1
      Source/Urho3D/Urho2D/StaticSprite2D.cpp
  86. 2 2
      Source/Urho3D/Urho2D/StretchableSprite2D.cpp
  87. 17 17
      Source/Urho3D/Urho2D/TmxFile2D.cpp
  88. 2 2
      bin/Data/Scripts/02_HelloGUI.as
  89. 1 1
      bin/Data/Scripts/16_Chat.as
  90. 1 1
      bin/Data/Scripts/17_SceneReplication.as
  91. 2 2
      bin/Data/Scripts/25_Urho2DParticle.as
  92. 1 1
      bin/Data/Scripts/26_ConsoleInput.as
  93. 3 3
      bin/Data/Scripts/32_Physics2DConstraints.as
  94. 8 8
      bin/Data/Scripts/37_UIDrag.as
  95. 3 3
      bin/Data/Scripts/39_CrowdNavigation.as
  96. 2 2
      bin/Data/Scripts/41_DatabaseDemo.as
  97. 2 2
      bin/Data/Scripts/48_Hello3DUI.as
  98. 1 1
      bin/Data/Scripts/51_Urho2DStretchableSprite.as
  99. 1 1
      bin/Data/Scripts/53_LANDiscovery.as
  100. 1 1
      bin/Data/Scripts/55_Clicker.as

+ 2 - 2
Source/Samples/02_HelloGUI/HelloGUI.cpp

@@ -166,12 +166,12 @@ void HelloGUI::CreateDraggableFish()
 void HelloGUI::HandleDragBegin(StringHash eventType, VariantMap& eventData)
 {
     // Get UIElement relative position where input (touch or click) occurred (top-left = IntVector2(0,0))
-    dragBeginPosition_ = IntVector2(eventData["ElementX"].GetInt(), eventData["ElementY"].GetInt());
+    dragBeginPosition_ = IntVector2(eventData["ElementX"].GetI32(), eventData["ElementY"].GetI32());
 }
 
 void HelloGUI::HandleDragMove(StringHash eventType, VariantMap& eventData)
 {
-    IntVector2 dragCurrentPosition = IntVector2(eventData["X"].GetInt(), eventData["Y"].GetInt());
+    IntVector2 dragCurrentPosition = IntVector2(eventData["X"].GetI32(), eventData["Y"].GetI32());
     UIElement* draggedElement = static_cast<UIElement*>(eventData["Element"].GetPtr());
     draggedElement->SetPosition(dragCurrentPosition - dragBeginPosition_);
 }

+ 1 - 1
Source/Samples/16_Chat/Chat.cpp

@@ -239,7 +239,7 @@ void Chat::HandleNetworkMessage(StringHash /*eventType*/, VariantMap& eventData)
 
     using namespace NetworkMessage;
 
-    int msgID = eventData[P_MESSAGEID].GetInt();
+    int msgID = eventData[P_MESSAGEID].GetI32();
     if (msgID == MSG_CHAT)
     {
         const Vector<byte>& data = eventData[P_DATA].GetBuffer();

+ 1 - 1
Source/Samples/17_SceneReplication/SceneReplication.cpp

@@ -510,5 +510,5 @@ void SceneReplication::HandleClientDisconnected(StringHash eventType, VariantMap
 
 void SceneReplication::HandleClientObjectID(StringHash eventType, VariantMap& eventData)
 {
-    clientObjectID_ = eventData[P_ID].GetUInt();
+    clientObjectID_ = eventData[P_ID].GetU32();
 }

+ 2 - 2
Source/Samples/25_Urho2DParticle/Urho2DParticle.cpp

@@ -127,8 +127,8 @@ void Urho2DParticle::HandleMouseMove(StringHash eventType, VariantMap& eventData
     if (particleNode_)
     {
         using namespace MouseMove;
-        auto x = (float)eventData[P_X].GetInt();
-        auto y = (float)eventData[P_Y].GetInt();
+        auto x = (float)eventData[P_X].GetI32();
+        auto y = (float)eventData[P_Y].GetI32();
         auto* graphics = GetSubsystem<Graphics>();
         auto* camera = cameraNode_->GetComponent<Camera>();
         particleNode_->SetPosition(camera->ScreenToWorldPoint(Vector3(x / graphics->GetWidth(), y / graphics->GetHeight(), 10.0f)));

+ 1 - 1
Source/Samples/26_ConsoleInput/ConsoleInput.cpp

@@ -105,7 +105,7 @@ void ConsoleInput::HandleUpdate(StringHash eventType, VariantMap& eventData)
 void ConsoleInput::HandleEscKeyDown(StringHash eventType, VariantMap& eventData)
 {
     // Unlike the other samples, exiting the engine when ESC is pressed instead of just closing the console
-    if (eventData[KeyDown::P_KEY].GetInt() == KEY_ESCAPE && GetPlatform() != "Web")
+    if (eventData[KeyDown::P_KEY].GetI32() == KEY_ESCAPE && GetPlatform() != "Web")
         engine_->Exit();
 }
 

+ 3 - 3
Source/Samples/32_Physics2DConstraints/Urho2DConstraints.cpp

@@ -534,7 +534,7 @@ void Urho2DConstraints::HandleTouchBegin3(StringHash eventType, VariantMap& even
     auto* graphics = GetSubsystem<Graphics>();
     auto* physicsWorld = scene_->GetComponent<PhysicsWorld2D>();
     using namespace TouchBegin;
-    RigidBody2D* rigidBody = physicsWorld->GetRigidBody(eventData[P_X].GetInt(), eventData[P_Y].GetInt()); // Raycast for RigidBody2Ds to pick
+    RigidBody2D* rigidBody = physicsWorld->GetRigidBody(eventData[P_X].GetI32(), eventData[P_Y].GetI32()); // Raycast for RigidBody2Ds to pick
     if (rigidBody)
     {
         pickedNode = rigidBody->GetNode();
@@ -544,7 +544,7 @@ void Urho2DConstraints::HandleTouchBegin3(StringHash eventType, VariantMap& even
 
         // Create a ConstraintMouse2D - Temporary apply this constraint to the pickedNode to allow grasping and moving with touch
         auto* constraintMouse = pickedNode->CreateComponent<ConstraintMouse2D>();
-        Vector3 pos = camera_->ScreenToWorldPoint(Vector3((float)eventData[P_X].GetInt() / graphics->GetWidth(), (float)eventData[P_Y].GetInt() / graphics->GetHeight(), 0.0f));
+        Vector3 pos = camera_->ScreenToWorldPoint(Vector3((float)eventData[P_X].GetI32() / graphics->GetWidth(), (float)eventData[P_Y].GetI32() / graphics->GetHeight(), 0.0f));
         constraintMouse->SetTarget(Vector2(pos.x_, pos.y_));
         constraintMouse->SetMaxForce(1000 * rigidBody->GetMass());
         constraintMouse->SetCollideConnected(true);
@@ -562,7 +562,7 @@ void Urho2DConstraints::HandleTouchMove3(StringHash eventType, VariantMap& event
         auto* graphics = GetSubsystem<Graphics>();
         auto* constraintMouse = pickedNode->GetComponent<ConstraintMouse2D>();
         using namespace TouchMove;
-        Vector3 pos = camera_->ScreenToWorldPoint(Vector3(float(eventData[P_X].GetInt()) / graphics->GetWidth(), float(eventData[P_Y].GetInt()) / graphics->GetHeight(), 0.0f));
+        Vector3 pos = camera_->ScreenToWorldPoint(Vector3(float(eventData[P_X].GetI32()) / graphics->GetWidth(), float(eventData[P_Y].GetI32()) / graphics->GetHeight(), 0.0f));
         constraintMouse->SetTarget(Vector2(pos.x_, pos.y_));
     }
 }

+ 8 - 8
Source/Samples/37_UIDrag/UIDrag.cpp

@@ -123,32 +123,32 @@ void UIDrag::HandleDragBegin(StringHash eventType, VariantMap& eventData)
     using namespace DragBegin;
     auto* element = (Button*)eventData[P_ELEMENT].GetVoidPtr();
 
-    int lx = eventData[P_X].GetInt();
-    int ly = eventData[P_Y].GetInt();
+    int lx = eventData[P_X].GetI32();
+    int ly = eventData[P_Y].GetI32();
 
     IntVector2 p = element->GetPosition();
     element->SetVar("START", p);
     element->SetVar("DELTA", IntVector2(p.x_ - lx, p.y_ - ly));
 
-    int buttons = eventData[P_BUTTONS].GetInt();
+    int buttons = eventData[P_BUTTONS].GetI32();
     element->SetVar("BUTTONS", buttons);
 
     auto* t = element->GetChildStaticCast<Text>("Text", false);
     t->SetText("Drag Begin Buttons: " + String(buttons));
 
     t = element->GetChildStaticCast<Text>("Num Touch", false);
-    t->SetText("Number of buttons: " + String(eventData[P_NUMBUTTONS].GetInt()));
+    t->SetText("Number of buttons: " + String(eventData[P_NUMBUTTONS].GetI32()));
 }
 
 void UIDrag::HandleDragMove(StringHash eventType, VariantMap& eventData)
 {
     using namespace DragBegin;
     auto* element = (Button*)eventData[P_ELEMENT].GetVoidPtr();
-    int buttons = eventData[P_BUTTONS].GetInt();
+    int buttons = eventData[P_BUTTONS].GetI32();
     IntVector2 d = element->GetVar("DELTA").GetIntVector2();
-    int X = eventData[P_X].GetInt() + d.x_;
-    int Y = eventData[P_Y].GetInt() + d.y_;
-    int BUTTONS = element->GetVar("BUTTONS").GetInt();
+    int X = eventData[P_X].GetI32() + d.x_;
+    int Y = eventData[P_Y].GetI32() + d.y_;
+    int BUTTONS = element->GetVar("BUTTONS").GetI32();
 
     auto* t = element->GetChildStaticCast<Text>("Event Touch", false);
     t->SetText("Drag Move Buttons: " + String(buttons));

+ 3 - 3
Source/Samples/39_CrowdNavigation/CrowdNavigation.cpp

@@ -566,7 +566,7 @@ void CrowdNavigation::HandleCrowdAgentFailure(StringHash eventType, VariantMap&
     using namespace CrowdAgentFailure;
 
     auto* node = static_cast<Node*>(eventData[P_NODE].GetPtr());
-    auto agentState = (CrowdAgentState)eventData[P_CROWD_AGENT_STATE].GetInt();
+    auto agentState = (CrowdAgentState)eventData[P_CROWD_AGENT_STATE].GetI32();
 
     // If the agent's state is invalid, likely from spawning on the side of a box, find a point in a larger area
     if (agentState == CA_STATE_INVALID)
@@ -615,8 +615,8 @@ void CrowdNavigation::HandleCrowdAgentFormation(StringHash eventType, VariantMap
 {
     using namespace CrowdAgentFormation;
 
-    unsigned index = eventData[P_INDEX].GetUInt();
-    unsigned size = eventData[P_SIZE].GetUInt();
+    unsigned index = eventData[P_INDEX].GetU32();
+    unsigned size = eventData[P_SIZE].GetU32();
     Vector3 position = eventData[P_POSITION].GetVector3();
 
     // The first agent will always move to the exact position, all other agents will select a random point nearby

+ 2 - 2
Source/Samples/41_DatabaseDemo/DatabaseDemo.cpp

@@ -120,7 +120,7 @@ void DatabaseDemo::HandleUpdate(StringHash eventType, VariantMap& eventData)
 void DatabaseDemo::HandleEscKeyDown(StringHash eventType, VariantMap& eventData)
 {
     // Unlike the other samples, exiting the engine when ESC is pressed instead of just closing the console
-    if (eventData[KeyDown::P_KEY].GetInt() == KEY_ESCAPE)
+    if (eventData[KeyDown::P_KEY].GetI32() == KEY_ESCAPE)
         engine_->Exit();
 }
 
@@ -130,7 +130,7 @@ void DatabaseDemo::HandleDbCursor(StringHash eventType, VariantMap& eventData)
 
     // In a real application the P_SQL can be used to do the logic branching in a shared event handler
     // However, this is not required in this sample demo
-    unsigned numCols = eventData[P_NUMCOLS].GetUInt();
+    unsigned numCols = eventData[P_NUMCOLS].GetU32();
     const VariantVector& colValues = eventData[P_COLVALUES].GetVariantVector();
     const Vector<String>& colHeaders = eventData[P_COLHEADERS].GetStringVector();
 

+ 2 - 2
Source/Samples/48_Hello3DUI/Hello3DUI.cpp

@@ -242,12 +242,12 @@ void Hello3DUI::CreateDraggableFish()
 void Hello3DUI::HandleDragBegin(StringHash eventType, VariantMap& eventData)
 {
     // Get UIElement relative position where input (touch or click) occurred (top-left = IntVector2(0,0))
-    dragBeginPosition_ = IntVector2(eventData["ElementX"].GetInt(), eventData["ElementY"].GetInt());
+    dragBeginPosition_ = IntVector2(eventData["ElementX"].GetI32(), eventData["ElementY"].GetI32());
 }
 
 void Hello3DUI::HandleDragMove(StringHash eventType, VariantMap& eventData)
 {
-    IntVector2 dragCurrentPosition = IntVector2(eventData["X"].GetInt(), eventData["Y"].GetInt());
+    IntVector2 dragCurrentPosition = IntVector2(eventData["X"].GetI32(), eventData["Y"].GetI32());
     UIElement* draggedElement = static_cast<UIElement*>(eventData["Element"].GetPtr());
     draggedElement->SetPosition(dragCurrentPosition - dragBeginPosition_);
 }

+ 1 - 1
Source/Samples/51_Urho2DStretchableSprite/Urho2DStretchableSprite.cpp

@@ -145,7 +145,7 @@ void Urho2DStretchableSprite::OnKeyUp(StringHash /*eventType*/, VariantMap& even
 {
     using namespace KeyUp;
 
-    const auto key = eventData[P_KEY].GetInt();
+    const auto key = eventData[P_KEY].GetI32();
 
     if (key == KEY_TAB)
     {

+ 1 - 1
Source/Samples/53_LANDiscovery/LANDiscovery.cpp

@@ -133,7 +133,7 @@ void LANDiscovery::HandleNetworkHostDiscovered(StringHash eventType, VariantMap&
     URHO3D_LOGINFO("Server discovered!");
     String text = serverList_->GetText();
     VariantMap data = eventData[P_BEACON].GetVariantMap();
-    text += "\n" + data["Name"].GetString() + "(" + String(data["Players"].GetInt()) + ")" + eventData[P_ADDRESS].GetString() + ":" + String(eventData[P_PORT].GetInt());
+    text += "\n" + data["Name"].GetString() + "(" + String(data["Players"].GetI32()) + ")" + eventData[P_ADDRESS].GetString() + ":" + String(eventData[P_PORT].GetI32());
     serverList_->SetText(text);
 }
 

+ 1 - 1
Source/Samples/55_Clicker/Clicker.cpp

@@ -137,7 +137,7 @@ void Clicker::HandleMouseButtonDown(StringHash eventType, VariantMap& eventData)
 {
     using namespace MouseButtonDown;
 
-    MouseButton button = (MouseButton)eventData[P_BUTTON].GetUInt();
+    MouseButton button = (MouseButton)eventData[P_BUTTON].GetU32();
     
     if (button == MOUSEB_RIGHT)
     {

+ 2 - 2
Source/Samples/Sample.inl

@@ -201,7 +201,7 @@ void Sample::HandleKeyUp(StringHash /*eventType*/, VariantMap& eventData)
 {
     using namespace KeyUp;
 
-    int key = eventData[P_KEY].GetInt();
+    int key = eventData[P_KEY].GetI32();
 
     // Close console (if open) or exit when ESC is pressed
     if (key == KEY_ESCAPE)
@@ -227,7 +227,7 @@ void Sample::HandleKeyDown(StringHash /*eventType*/, VariantMap& eventData)
 {
     using namespace KeyDown;
 
-    int key = eventData[P_KEY].GetInt();
+    int key = eventData[P_KEY].GetI32();
 
     // Toggle console with F1
     if (key == KEY_F1)

+ 1 - 1
Source/Tools/AssetImporter/AssetImporter.cpp

@@ -2424,7 +2424,7 @@ void WriteVertex(float*& dest, aiMesh* mesh, unsigned index, bool isSkinned, Bou
     for (unsigned i = 0; i < mesh->GetNumColorChannels() && i < MAX_CHANNELS; ++i)
     {
         *((unsigned*)dest) = Color(mesh->mColors[i][index].r, mesh->mColors[i][index].g, mesh->mColors[i][index].b,
-            mesh->mColors[i][index].a).ToUInt();
+            mesh->mColors[i][index].a).ToU32();
         ++dest;
     }
 

+ 28 - 2
Source/Tools/BindingGenerator/ASUtils.cpp

@@ -97,6 +97,9 @@ string CppPrimitiveTypeToAS(const string& cppType)
     if (cppType == "flagset32")
         return "flagset32";
 
+    if (cppType == "color32")
+        return "color32";
+
     throw Exception(cppType + " not a primitive type");
 }
 
@@ -169,6 +172,8 @@ shared_ptr<EnumAnalyzer> FindEnum(const string& name)
     return shared_ptr<EnumAnalyzer>();
 }
 
+// TODO: Not all usings detect as using https://github.com/doxygen/doxygen/issues/9654
+// id32, hash32 never checked because not detected as using because not in Urho3D namespace and not parsed
 static bool IsUsing(const string& identifier)
 {
     for (xml_node memberdef : SourceData::usings_)
@@ -182,6 +187,25 @@ static bool IsUsing(const string& identifier)
     return false;
 }
 
+// TODO: Not all usings detect as using https://github.com/doxygen/doxygen/issues/9654
+static bool IsKnownUsing(const string& identifier)
+{
+    if (!IsUsing(identifier))
+        return false;
+
+    if (identifier == "VariantMap"
+        || identifier == "color32"
+        || identifier == "NodeId" // Never checked https://github.com/doxygen/doxygen/issues/9654
+        || identifier == "ComponentId") // Never checked https://github.com/doxygen/doxygen/issues/9654
+    {
+        return true;
+    }
+
+    // id32, hash32 never checked because not detected as using because not in Urho3D namespace and not parsed
+
+    return false;
+}
+
 bool IsKnownCppType(const string& name)
 {
     static vector<string> _knownTypes = {
@@ -485,7 +509,8 @@ ConvertedVariable CppVariableToAS(const TypeAnalyzer& type, VariableUsage usage,
     // TODO add to type info "IsUsing"
     // TODO add description to TypeAnalyzer::GetClass()
 
-    if (IsUsing(cppTypeName) && cppTypeName != "VariantMap")
+    // TODO: Not all usings detect as using https://github.com/doxygen/doxygen/issues/9654
+    if (IsUsing(cppTypeName) && !IsKnownUsing(cppTypeName))
         throw Exception("Using \"" + cppTypeName + "\" can not automatically bind");
 
     string asTypeName;
@@ -590,7 +615,8 @@ string CppTypeToAS(const TypeAnalyzer& type, TypeUsage typeUsage)
     // TODO add to type info "IsUsing"
     // TODO add description to TypeAnalyzer::GetClass()
 
-    if (IsUsing(cppTypeName) && cppTypeName != "VariantMap")
+    // TODO: Not all usings detect as using https://github.com/doxygen/doxygen/issues/9654
+    if (IsUsing(cppTypeName) && !IsKnownUsing(cppTypeName))
         throw Exception("Using \"" + cppTypeName + "\" can not automatically bind");
 
     string asTypeName;

+ 1 - 0
Source/Tools/BindingGenerator/XmlSourceData.cpp

@@ -118,6 +118,7 @@ static void LoadXml(const string& fullPath)
         {
             string definition = ExtractDefinition(memberdef);
 
+            // TODO: using can be typedef https://github.com/doxygen/doxygen/issues/9654
             if (StartsWith(definition, "using "))
                 SourceData::usings_.push_back(memberdef);
         }

+ 19 - 19
Source/Tools/OgreImporter/OgreImporter.cpp

@@ -143,7 +143,7 @@ void LoadSkeleton(const String& skeletonFileName)
         XMLElement bone = bonesRoot.GetChild("bone");
         while (bone)
         {
-            unsigned index = bone.GetInt("id");
+            unsigned index = bone.GetI32("id");
             String name = bone.GetAttribute("name");
             if (index >= bones_.Size())
                 bones_.Resize(index + 1);
@@ -253,7 +253,7 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
         XMLElement geometry = subMesh.GetChild("geometry");
         if (geometry)
         {
-            unsigned vertices = geometry.GetInt("vertexcount");
+            unsigned vertices = geometry.GetI32("vertexcount");
             totalVertices += vertices;
             if (maxSubMeshVertices < vertices)
                 maxSubMeshVertices = vertices;
@@ -266,7 +266,7 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
     XMLElement sharedGeometry = root.GetChild("sharedgeometry");
     if (sharedGeometry)
     {
-        unsigned vertices = sharedGeometry.GetInt("vertexcount");
+        unsigned vertices = sharedGeometry.GetI32("vertexcount");
         totalVertices += vertices;
         if (maxSubMeshVertices < vertices)
             maxSubMeshVertices = vertices;
@@ -307,7 +307,7 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
         }
 
         if (geometry)
-            vertices = geometry.GetInt("vertexcount");
+            vertices = geometry.GetI32("vertexcount");
 
         ModelSubGeometryLodLevel subGeometryLodLevel;
         ModelVertexBuffer* vBuf;
@@ -353,7 +353,7 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
             if (bufferDef.HasAttribute("texture_coords"))
             {
                 vBuf->elementMask_ |= VertexElements::TexCoord1;
-                if (bufferDef.GetInt("texture_coords") > 1)
+                if (bufferDef.GetI32("texture_coords") > 1)
                     vBuf->elementMask_ |= VertexElements::TexCoord2;
             }
 
@@ -417,15 +417,15 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
             bufferDef = bufferDef.GetNext("vertexbuffer");
         }
 
-        unsigned triangles = faces.GetInt("count");
+        unsigned triangles = faces.GetI32("count");
         unsigned indices = triangles * 3;
 
         XMLElement triangle = faces.GetChild("face");
         while (triangle)
         {
-            unsigned v1 = triangle.GetInt("v1");
-            unsigned v2 = triangle.GetInt("v2");
-            unsigned v3 = triangle.GetInt("v3");
+            unsigned v1 = triangle.GetI32("v1");
+            unsigned v2 = triangle.GetI32("v2");
+            unsigned v3 = triangle.GetI32("v3");
             iBuf->indices_.Push(v3 + vertexStart);
             iBuf->indices_.Push(v2 + vertexStart);
             iBuf->indices_.Push(v1 + vertexStart);
@@ -445,8 +445,8 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
                 XMLElement boneAssignment = boneAssignments.GetChild("vertexboneassignment");
                 while (boneAssignment)
                 {
-                    unsigned vertex = boneAssignment.GetInt("vertexindex") + vertexStart;
-                    unsigned bone = boneAssignment.GetInt("boneindex");
+                    unsigned vertex = boneAssignment.GetI32("vertexindex") + vertexStart;
+                    unsigned bone = boneAssignment.GetI32("boneindex");
                     float weight = boneAssignment.GetFloat("weight");
 
                     BoneWeightAssignment assign{static_cast<unsigned char>(bone), weight};
@@ -598,8 +598,8 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
                 XMLElement lodSubMesh = lod.GetChild("lodfacelist");
                 while (lodSubMesh)
                 {
-                    unsigned subMeshIndex = lodSubMesh.GetInt("submeshindex");
-                    unsigned triangles = lodSubMesh.GetInt("numfaces");
+                    unsigned subMeshIndex = lodSubMesh.GetI32("submeshindex");
+                    unsigned triangles = lodSubMesh.GetI32("numfaces");
 
                     ModelSubGeometryLodLevel newLodLevel;
                     ModelSubGeometryLodLevel& originalLodLevel = subGeometries_[subMeshIndex][0];
@@ -633,9 +633,9 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
                     XMLElement triangle = lodSubMesh.GetChild("face");
                     while (triangle)
                     {
-                        unsigned v1 = triangle.GetInt("v1");
-                        unsigned v2 = triangle.GetInt("v2");
-                        unsigned v3 = triangle.GetInt("v3");
+                        unsigned v1 = triangle.GetI32("v1");
+                        unsigned v2 = triangle.GetI32("v2");
+                        unsigned v3 = triangle.GetI32("v3");
                         iBuf->indices_.Push(v3 + vertexStart);
                         iBuf->indices_.Push(v2 + vertexStart);
                         iBuf->indices_.Push(v1 + vertexStart);
@@ -699,7 +699,7 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
                                     XMLElement poseref = keyframe.GetChild("poseref");
                                     // Get only the end pose
                                     if (poseref && time == length)
-                                        usedPoses.Insert(poseref.GetInt("poseindex"));
+                                        usedPoses.Insert(poseref.GetI32("poseindex"));
 
                                     keyframe = keyframe.GetNext("keyframe");
                                 }
@@ -723,7 +723,7 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
                         for (HashSet<unsigned>::Iterator i = usedPoses.Begin(); i != usedPoses.End(); ++i)
                         {
                             XMLElement pose = poses[*i];
-                            unsigned targetSubMesh = pose.GetInt("index");
+                            unsigned targetSubMesh = pose.GetI32("index");
                             XMLElement poseOffset = pose.GetChild("poseoffset");
 
                             if (useOneBuffer_)
@@ -738,7 +738,7 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
                             while (poseOffset)
                             {
                                 // Convert from right- to left-handed
-                                unsigned vertexIndex = poseOffset.GetInt("index") + vertexStarts[targetSubMesh];
+                                unsigned vertexIndex = poseOffset.GetI32("index") + vertexStarts[targetSubMesh];
                                 float x = poseOffset.GetFloat("x");
                                 float y = poseOffset.GetFloat("y");
                                 float z = poseOffset.GetFloat("z");

+ 1 - 1
Source/Tools/OgreImporter/OgreImporterUtils.h

@@ -132,7 +132,7 @@ struct ModelVertexBuffer
             if (!!(elementMask_ & VertexElements::Normal))
                 dest.WriteVector3(vertices_[i].normal_);
             if (!!(elementMask_ & VertexElements::Color))
-                dest.WriteU32(vertices_[i].color_.ToUInt());
+                dest.WriteU32(vertices_[i].color_.ToU32());
             if (!!(elementMask_ & VertexElements::TexCoord1))
                 dest.WriteVector2(vertices_[i].texCoord1_);
             if (!!(elementMask_ & VertexElements::TexCoord2))

+ 10 - 10
Source/Tools/SpritePacker/SpritePacker.cpp

@@ -311,17 +311,17 @@ void Run(Vector<String>& arguments)
     {
         XMLElement subTexture = root.CreateChild("SubTexture");
         subTexture.SetString("name", packerInfo->name);
-        subTexture.SetInt("x", packerInfo->x + offsetX);
-        subTexture.SetInt("y", packerInfo->y + offsetY);
-        subTexture.SetInt("width", packerInfo->width);
-        subTexture.SetInt("height", packerInfo->height);
+        subTexture.SetI32("x", packerInfo->x + offsetX);
+        subTexture.SetI32("y", packerInfo->y + offsetY);
+        subTexture.SetI32("width", packerInfo->width);
+        subTexture.SetI32("height", packerInfo->height);
 
         if (packerInfo->frameWidth || packerInfo->frameHeight)
         {
-            subTexture.SetInt("frameWidth", packerInfo->frameWidth);
-            subTexture.SetInt("frameHeight", packerInfo->frameHeight);
-            subTexture.SetInt("offsetX", packerInfo->offsetX);
-            subTexture.SetInt("offsetY", packerInfo->offsetY);
+            subTexture.SetI32("frameWidth", packerInfo->frameWidth);
+            subTexture.SetI32("frameHeight", packerInfo->frameHeight);
+            subTexture.SetI32("offsetX", packerInfo->offsetX);
+            subTexture.SetI32("offsetY", packerInfo->offsetY);
         }
 
         URHO3D_LOGINFO("Transferring " + packerInfo->path + " to sprite sheet.");
@@ -345,8 +345,8 @@ void Run(Vector<String>& arguments)
 
     if (debug)
     {
-        unsigned OUTER_BOUNDS_DEBUG_COLOR = Color::BLUE.ToUInt();
-        unsigned INNER_BOUNDS_DEBUG_COLOR = Color::GREEN.ToUInt();
+        unsigned OUTER_BOUNDS_DEBUG_COLOR = Color::BLUE.ToU32();
+        unsigned INNER_BOUNDS_DEBUG_COLOR = Color::GREEN.ToU32();
 
         URHO3D_LOGINFO("Drawing debug information.");
         for (const SharedPtr<PackerInfo>& packerInfo : packerInfos)

+ 42 - 42
Source/Urho3D/AngelScript/Generated_Members.h

@@ -829,11 +829,11 @@ template <class T> void RegisterMembers_Color(asIScriptEngine* engine, const cha
     // Error: type "float*" can not automatically bind
     // const float* Color::Data() const
     // Error: type "const float*" can not automatically bind
-    // void Color::FromUIntMask(unsigned color, const ChannelMask& mask)
+    // void Color::FromU32(color32 color, const ChannelMask& mask)
     // Error: type "const ChannelMask&" can not automatically bind
     // bool Color::operator !=(const Color& rhs) const
     // Only operator == is needed
-    // unsigned Color::ToUIntMask(const ChannelMask& mask) const
+    // color32 Color::ToU32(const ChannelMask& mask) const
     // Error: type "const ChannelMask&" can not automatically bind
 
     // Color Color::Abs() const
@@ -857,8 +857,8 @@ template <class T> void RegisterMembers_Color(asIScriptEngine* engine, const cha
     // void Color::FromHSV(float h, float s, float v, float a = 1.0f)
     engine->RegisterObjectMethod(className, "void FromHSV(float, float, float, float = 1.0f)", AS_METHODPR(T, FromHSV, (float, float, float, float), void), AS_CALL_THISCALL);
 
-    // void Color::FromUInt(unsigned color)
-    engine->RegisterObjectMethod(className, "void FromUInt(uint)", AS_METHODPR(T, FromUInt, (unsigned), void), AS_CALL_THISCALL);
+    // void Color::FromU32(color32 color)
+    engine->RegisterObjectMethod(className, "void FromU32(color32)", AS_METHODPR(T, FromU32, (color32), void), AS_CALL_THISCALL);
 
     // Color Color::GammaToLinear() const
     engine->RegisterObjectMethod(className, "Color GammaToLinear() const", AS_METHODPR(T, GammaToLinear, () const, Color), AS_CALL_THISCALL);
@@ -932,11 +932,11 @@ template <class T> void RegisterMembers_Color(asIScriptEngine* engine, const cha
     // String Color::ToString() const
     engine->RegisterObjectMethod(className, "String ToString() const", AS_METHODPR(T, ToString, () const, String), AS_CALL_THISCALL);
 
-    // unsigned Color::ToUInt() const
-    engine->RegisterObjectMethod(className, "uint ToUInt() const", AS_METHODPR(T, ToUInt, () const, unsigned), AS_CALL_THISCALL);
+    // color32 Color::ToU32() const
+    engine->RegisterObjectMethod(className, "color32 ToU32() const", AS_METHODPR(T, ToU32, () const, color32), AS_CALL_THISCALL);
 
-    // unsigned Color::ToUIntArgb() const
-    engine->RegisterObjectMethod(className, "uint ToUIntArgb() const", AS_METHODPR(T, ToUIntArgb, () const, unsigned), AS_CALL_THISCALL);
+    // color32 Color::ToU32Argb() const
+    engine->RegisterObjectMethod(className, "color32 ToU32Argb() const", AS_METHODPR(T, ToU32Argb, () const, color32), AS_CALL_THISCALL);
 
     // Vector3 Color::ToVector3() const
     engine->RegisterObjectMethod(className, "Vector3 ToVector3() const", AS_METHODPR(T, ToVector3, () const, Vector3), AS_CALL_THISCALL);
@@ -1144,8 +1144,8 @@ template <class T> void RegisterMembers_CustomGeometryVertex(asIScriptEngine* en
     // Vector3 CustomGeometryVertex::normal_
     engine->RegisterObjectProperty(className, "Vector3 normal", offsetof(T, normal_));
 
-    // unsigned CustomGeometryVertex::color_
-    engine->RegisterObjectProperty(className, "uint color", offsetof(T, color_));
+    // color32 CustomGeometryVertex::color_
+    engine->RegisterObjectProperty(className, "color32 color", offsetof(T, color_));
 
     // Vector2 CustomGeometryVertex::texCoord_
     engine->RegisterObjectProperty(className, "Vector2 texCoord", offsetof(T, texCoord_));
@@ -2233,8 +2233,8 @@ template <class T> void RegisterMembers_JSONValue(asIScriptEngine* engine, const
     // float JSONValue::GetFloat(float defaultValue = 0.0f) const
     engine->RegisterObjectMethod(className, "float GetFloat(float = 0.0f) const", AS_METHODPR(T, GetFloat, (float) const, float), AS_CALL_THISCALL);
 
-    // int JSONValue::GetInt(int defaultValue = 0) const
-    engine->RegisterObjectMethod(className, "int GetInt(int = 0) const", AS_METHODPR(T, GetInt, (int) const, int), AS_CALL_THISCALL);
+    // i32 JSONValue::GetI32(i32 defaultValue = 0) const
+    engine->RegisterObjectMethod(className, "int GetI32(int = 0) const", AS_METHODPR(T, GetI32, (i32) const, i32), AS_CALL_THISCALL);
 
     // JSONNumberType JSONValue::GetNumberType() const
     engine->RegisterObjectMethod(className, "JSONNumberType GetNumberType() const", AS_METHODPR(T, GetNumberType, () const, JSONNumberType), AS_CALL_THISCALL);
@@ -2247,8 +2247,8 @@ template <class T> void RegisterMembers_JSONValue(asIScriptEngine* engine, const
     // const String& JSONValue::GetString(const String& defaultValue = String::EMPTY) const
     engine->RegisterObjectMethod(className, "const String& GetString(const String&in = String::EMPTY) const", AS_METHODPR(T, GetString, (const String&) const, const String&), AS_CALL_THISCALL);
 
-    // unsigned JSONValue::GetUInt(unsigned defaultValue = 0) const
-    engine->RegisterObjectMethod(className, "uint GetUInt(uint = 0) const", AS_METHODPR(T, GetUInt, (unsigned) const, unsigned), AS_CALL_THISCALL);
+    // u32 JSONValue::GetU32(u32 defaultValue = 0) const
+    engine->RegisterObjectMethod(className, "uint GetU32(uint = 0) const", AS_METHODPR(T, GetU32, (u32) const, u32), AS_CALL_THISCALL);
 
     // JSONValueType JSONValue::GetValueType() const
     engine->RegisterObjectMethod(className, "JSONValueType GetValueType() const", AS_METHODPR(T, GetValueType, () const, JSONValueType), AS_CALL_THISCALL);
@@ -5512,8 +5512,8 @@ template <class T> void RegisterMembers_UIBatch(asIScriptEngine* engine, const c
     // unsigned UIBatch::vertexEnd_
     engine->RegisterObjectProperty(className, "uint vertexEnd", offsetof(T, vertexEnd_));
 
-    // unsigned UIBatch::color_
-    engine->RegisterObjectProperty(className, "uint color", offsetof(T, color_));
+    // color32 UIBatch::color_
+    engine->RegisterObjectProperty(className, "color32 color", offsetof(T, color_));
 
     // bool UIBatch::useGradient_
     engine->RegisterObjectProperty(className, "bool useGradient", offsetof(T, useGradient_));
@@ -5731,11 +5731,11 @@ template <class T> void RegisterMembers_Variant(asIScriptEngine* engine, const c
     // float Variant::GetFloat() const
     engine->RegisterObjectMethod(className, "float GetFloat() const", AS_METHODPR(T, GetFloat, () const, float), AS_CALL_THISCALL);
 
-    // int Variant::GetInt() const
-    engine->RegisterObjectMethod(className, "int GetInt() const", AS_METHODPR(T, GetInt, () const, int), AS_CALL_THISCALL);
+    // i32 Variant::GetI32() const
+    engine->RegisterObjectMethod(className, "int GetI32() const", AS_METHODPR(T, GetI32, () const, i32), AS_CALL_THISCALL);
 
-    // long long Variant::GetInt64() const
-    engine->RegisterObjectMethod(className, "int64 GetInt64() const", AS_METHODPR(T, GetInt64, () const, long long), AS_CALL_THISCALL);
+    // i64 Variant::GetI64() const
+    engine->RegisterObjectMethod(className, "int64 GetI64() const", AS_METHODPR(T, GetI64, () const, i64), AS_CALL_THISCALL);
 
     // const IntRect& Variant::GetIntRect() const
     engine->RegisterObjectMethod(className, "const IntRect& GetIntRect() const", AS_METHODPR(T, GetIntRect, () const, const IntRect&), AS_CALL_THISCALL);
@@ -5787,11 +5787,11 @@ template <class T> void RegisterMembers_Variant(asIScriptEngine* engine, const c
     engine->RegisterObjectMethod(className, "String GetTypeName() const", AS_METHODPR(T, GetTypeName, () const, String), AS_CALL_THISCALL);
     engine->RegisterObjectMethod(className, "String get_typeName() const", AS_METHODPR(T, GetTypeName, () const, String), AS_CALL_THISCALL);
 
-    // unsigned Variant::GetUInt() const
-    engine->RegisterObjectMethod(className, "uint GetUInt() const", AS_METHODPR(T, GetUInt, () const, unsigned), AS_CALL_THISCALL);
+    // u32 Variant::GetU32() const
+    engine->RegisterObjectMethod(className, "uint GetU32() const", AS_METHODPR(T, GetU32, () const, u32), AS_CALL_THISCALL);
 
-    // unsigned long long Variant::GetUInt64() const
-    engine->RegisterObjectMethod(className, "uint64 GetUInt64() const", AS_METHODPR(T, GetUInt64, () const, unsigned long long), AS_CALL_THISCALL);
+    // u64 Variant::GetU64() const
+    engine->RegisterObjectMethod(className, "uint64 GetU64() const", AS_METHODPR(T, GetU64, () const, u64), AS_CALL_THISCALL);
 
     // const VariantMap& Variant::GetVariantMap() const
     engine->RegisterObjectMethod(className, "const VariantMap& GetVariantMap() const", AS_METHODPR(T, GetVariantMap, () const, const VariantMap&), AS_CALL_THISCALL);
@@ -6799,11 +6799,11 @@ template <class T> void RegisterMembers_XMLElement(asIScriptEngine* engine, cons
     // float XMLElement::GetFloat(const String& name) const
     engine->RegisterObjectMethod(className, "float GetFloat(const String&in) const", AS_METHODPR(T, GetFloat, (const String&) const, float), AS_CALL_THISCALL);
 
-    // int XMLElement::GetInt(const String& name) const
-    engine->RegisterObjectMethod(className, "int GetInt(const String&in) const", AS_METHODPR(T, GetInt, (const String&) const, int), AS_CALL_THISCALL);
+    // i32 XMLElement::GetI32(const String& name) const
+    engine->RegisterObjectMethod(className, "int GetI32(const String&in) const", AS_METHODPR(T, GetI32, (const String&) const, i32), AS_CALL_THISCALL);
 
-    // long long XMLElement::GetInt64(const String& name) const
-    engine->RegisterObjectMethod(className, "int64 GetInt64(const String&in) const", AS_METHODPR(T, GetInt64, (const String&) const, long long), AS_CALL_THISCALL);
+    // i64 XMLElement::GetI64(const String& name) const
+    engine->RegisterObjectMethod(className, "int64 GetI64(const String&in) const", AS_METHODPR(T, GetI64, (const String&) const, i64), AS_CALL_THISCALL);
 
     // IntRect XMLElement::GetIntRect(const String& name) const
     engine->RegisterObjectMethod(className, "IntRect GetIntRect(const String&in) const", AS_METHODPR(T, GetIntRect, (const String&) const, IntRect), AS_CALL_THISCALL);
@@ -6856,11 +6856,11 @@ template <class T> void RegisterMembers_XMLElement(asIScriptEngine* engine, cons
     // StringVector XMLElement::GetStringVector() const
     engine->RegisterObjectMethod(className, "Array<String>@ GetStringVector() const", AS_FUNCTION_OBJFIRST(XMLElement_StringVector_GetStringVector_void_template<XMLElement>), AS_CALL_CDECL_OBJFIRST);
 
-    // unsigned XMLElement::GetUInt(const String& name) const
-    engine->RegisterObjectMethod(className, "uint GetUInt(const String&in) const", AS_METHODPR(T, GetUInt, (const String&) const, unsigned), AS_CALL_THISCALL);
+    // u32 XMLElement::GetU32(const String& name) const
+    engine->RegisterObjectMethod(className, "uint GetU32(const String&in) const", AS_METHODPR(T, GetU32, (const String&) const, u32), AS_CALL_THISCALL);
 
-    // unsigned long long XMLElement::GetUInt64(const String& name) const
-    engine->RegisterObjectMethod(className, "uint64 GetUInt64(const String&in) const", AS_METHODPR(T, GetUInt64, (const String&) const, unsigned long long), AS_CALL_THISCALL);
+    // u64 XMLElement::GetU64(const String& name) const
+    engine->RegisterObjectMethod(className, "uint64 GetU64(const String&in) const", AS_METHODPR(T, GetU64, (const String&) const, u64), AS_CALL_THISCALL);
 
     // String XMLElement::GetValue() const
     engine->RegisterObjectMethod(className, "String GetValue() const", AS_METHODPR(T, GetValue, () const, String), AS_CALL_THISCALL);
@@ -6962,11 +6962,11 @@ template <class T> void RegisterMembers_XMLElement(asIScriptEngine* engine, cons
     // bool XMLElement::SetFloat(const String& name, float value)
     engine->RegisterObjectMethod(className, "bool SetFloat(const String&in, float)", AS_METHODPR(T, SetFloat, (const String&, float), bool), AS_CALL_THISCALL);
 
-    // bool XMLElement::SetInt(const String& name, int value)
-    engine->RegisterObjectMethod(className, "bool SetInt(const String&in, int)", AS_METHODPR(T, SetInt, (const String&, int), bool), AS_CALL_THISCALL);
+    // bool XMLElement::SetI32(const String& name, i32 value)
+    engine->RegisterObjectMethod(className, "bool SetI32(const String&in, int)", AS_METHODPR(T, SetI32, (const String&, i32), bool), AS_CALL_THISCALL);
 
-    // bool XMLElement::SetInt64(const String& name, long long value)
-    engine->RegisterObjectMethod(className, "bool SetInt64(const String&in, int64)", AS_METHODPR(T, SetInt64, (const String&, long long), bool), AS_CALL_THISCALL);
+    // bool XMLElement::SetI64(const String& name, i64 value)
+    engine->RegisterObjectMethod(className, "bool SetI64(const String&in, int64)", AS_METHODPR(T, SetI64, (const String&, i64), bool), AS_CALL_THISCALL);
 
     // bool XMLElement::SetIntRect(const String& name, const IntRect& value)
     engine->RegisterObjectMethod(className, "bool SetIntRect(const String&in, const IntRect&in)", AS_METHODPR(T, SetIntRect, (const String&, const IntRect&), bool), AS_CALL_THISCALL);
@@ -7004,11 +7004,11 @@ template <class T> void RegisterMembers_XMLElement(asIScriptEngine* engine, cons
     // bool XMLElement::SetStringVector(const StringVector& value)
     engine->RegisterObjectMethod(className, "bool SetStringVector(Array<String>@+)", AS_FUNCTION_OBJFIRST(XMLElement_bool_SetStringVector_constspStringVectoramp_template<XMLElement>), AS_CALL_CDECL_OBJFIRST);
 
-    // bool XMLElement::SetUInt(const String& name, unsigned value)
-    engine->RegisterObjectMethod(className, "bool SetUInt(const String&in, uint)", AS_METHODPR(T, SetUInt, (const String&, unsigned), bool), AS_CALL_THISCALL);
+    // bool XMLElement::SetU32(const String& name, u32 value)
+    engine->RegisterObjectMethod(className, "bool SetU32(const String&in, uint)", AS_METHODPR(T, SetU32, (const String&, u32), bool), AS_CALL_THISCALL);
 
-    // bool XMLElement::SetUInt64(const String& name, unsigned long long value)
-    engine->RegisterObjectMethod(className, "bool SetUInt64(const String&in, uint64)", AS_METHODPR(T, SetUInt64, (const String&, unsigned long long), bool), AS_CALL_THISCALL);
+    // bool XMLElement::SetU64(const String& name, u64 value)
+    engine->RegisterObjectMethod(className, "bool SetU64(const String&in, uint64)", AS_METHODPR(T, SetU64, (const String&, u64), bool), AS_CALL_THISCALL);
 
     // bool XMLElement::SetValue(const String& value)
     engine->RegisterObjectMethod(className, "bool SetValue(const String&in)", AS_METHODPR(T, SetValue, (const String&), bool), AS_CALL_THISCALL);
@@ -13604,8 +13604,8 @@ template <class T> void RegisterMembers_Image(asIScriptEngine* engine, const cha
     // void Image::Clear(const Color& color)
     engine->RegisterObjectMethod(className, "void Clear(const Color&in)", AS_METHODPR(T, Clear, (const Color&), void), AS_CALL_THISCALL);
 
-    // void Image::ClearInt(unsigned uintColor)
-    engine->RegisterObjectMethod(className, "void ClearInt(uint)", AS_METHODPR(T, ClearInt, (unsigned), void), AS_CALL_THISCALL);
+    // void Image::Clear(color32 uintColor)
+    engine->RegisterObjectMethod(className, "void Clear(color32)", AS_METHODPR(T, Clear, (color32), void), AS_CALL_THISCALL);
 
     // SharedPtr<Image> Image::ConvertToRGBA() const
     engine->RegisterObjectMethod(className, "Image@+ ConvertToRGBA() const", AS_FUNCTION_OBJFIRST(Image_SharedPtrlesImagegre_ConvertToRGBA_void_template<Image>), AS_CALL_CDECL_OBJFIRST);

+ 1 - 0
Source/Urho3D/AngelScript/Manual.cpp

@@ -99,6 +99,7 @@ void ASRegisterManualFirst(asIScriptEngine* engine)
     engine->RegisterTypedef("ComponentId", "uint");
     engine->RegisterTypedef("mask32", "uint");
     engine->RegisterTypedef("flagset32", "uint");
+    engine->RegisterTypedef("color32", "uint");
 
     ASRegisterManualFirst_Addons(engine);
     ASRegisterManualFirst_Graphics(engine);

+ 4 - 4
Source/Urho3D/AngelScript/ScriptFile.cpp

@@ -834,22 +834,22 @@ void ScriptFile::SetParameters(asIScriptContext* context, asIScriptFunction* fun
 
         case asTYPEID_INT8:
         case asTYPEID_UINT8:
-            context->SetArgByte(i, (asBYTE)parameters[i].GetInt());
+            context->SetArgByte(i, (asBYTE)parameters[i].GetI32());
             break;
 
         case asTYPEID_INT16:
         case asTYPEID_UINT16:
-            context->SetArgWord(i, (asWORD)parameters[i].GetInt());
+            context->SetArgWord(i, (asWORD)parameters[i].GetI32());
             break;
 
         case asTYPEID_INT32:
         case asTYPEID_UINT32:
-            context->SetArgDWord(i, (asDWORD)parameters[i].GetInt());
+            context->SetArgDWord(i, (asDWORD)parameters[i].GetI32());
             break;
 
         case asTYPEID_INT64:
         case asTYPEID_UINT64:
-            context->SetArgQWord(i, (asQWORD)parameters[i].GetInt64());
+            context->SetArgQWord(i, (asQWORD)parameters[i].GetI64());
             break;
 
         case asTYPEID_FLOAT:

+ 1 - 1
Source/Urho3D/AngelScript/ScriptInstance.cpp

@@ -105,7 +105,7 @@ void ScriptInstance::OnSetAttribute(const AttributeInfo& attr, const Variant& sr
         // The component / node to which the ID refers to may not be in the scene yet, and furthermore the ID must go through the
         // SceneResolver first. Delay searching for the object to ApplyAttributes
         auto* attrPtr = const_cast<AttributeInfo*>(&attr);
-        idAttributes_[attrPtr] = src.GetUInt();
+        idAttributes_[attrPtr] = src.GetU32();
     }
     else if (attr.type_ == VAR_RESOURCEREF && attr.ptr_)
     {

+ 2 - 2
Source/Urho3D/Audio/Sound.cpp

@@ -338,7 +338,7 @@ void Sound::LoadParameters()
         if (name == "format" && !compressed_)
         {
             if (paramElem.HasAttribute("frequency"))
-                frequency_ = (unsigned)paramElem.GetInt("frequency");
+                frequency_ = (unsigned)paramElem.GetI32("frequency");
             if (paramElem.HasAttribute("sixteenbit"))
                 sixteenBit_ = paramElem.GetBool("sixteenbit");
             if (paramElem.HasAttribute("16bit"))
@@ -352,7 +352,7 @@ void Sound::LoadParameters()
             if (paramElem.HasAttribute("enable"))
                 SetLooped(paramElem.GetBool("enable"));
             if (paramElem.HasAttribute("start") && paramElem.HasAttribute("end"))
-                SetLoop((unsigned)paramElem.GetInt("start"), (unsigned)paramElem.GetInt("end"));
+                SetLoop((unsigned)paramElem.GetI32("start"), (unsigned)paramElem.GetI32("end"));
         }
     }
 }

+ 8 - 8
Source/Urho3D/Core/Variant.cpp

@@ -727,14 +727,14 @@ void Variant::SetType(VariantType newType)
     }
 }
 
-template <> int Variant::Get<int>() const
+template <> i32 Variant::Get<i32>() const
 {
-    return GetInt();
+    return GetI32();
 }
 
-template <> unsigned Variant::Get<unsigned>() const
+template <> u32 Variant::Get<u32>() const
 {
-    return GetUInt();
+    return GetU32();
 }
 
 template <> c32 Variant::Get<c32>() const
@@ -742,14 +742,14 @@ template <> c32 Variant::Get<c32>() const
     return GetC32();
 }
 
-template <> long long Variant::Get<long long>() const
+template <> i64 Variant::Get<i64>() const
 {
-    return GetInt64();
+    return GetI64();
 }
 
-template <> unsigned long long Variant::Get<unsigned long long>() const
+template <> u64 Variant::Get<u64>() const
 {
-    return GetUInt64();
+    return GetU64();
 }
 
 template <> StringHash Variant::Get<StringHash>() const

+ 16 - 16
Source/Urho3D/Core/Variant.h

@@ -1101,57 +1101,57 @@ public:
     template <class T> void SetCustom(const T& value) { SetCustomVariantValue(MakeCustomValue<T>(value)); }
 
     /// Return int or zero on type mismatch. Floats and doubles are converted.
-    int GetInt() const
+    i32 GetI32() const
     {
         if (type_ == VAR_INT)
             return value_.int_;
         else if (type_ == VAR_FLOAT)
-            return static_cast<int>(value_.float_);
+            return static_cast<i32>(value_.float_);
         else if (type_ == VAR_DOUBLE)
-            return static_cast<int>(value_.double_);
+            return static_cast<i32>(value_.double_);
         else
             return 0;
     }
 
     /// Return 64 bit int or zero on type mismatch. Floats and doubles are converted.
-    long long GetInt64() const
+    i64 GetI64() const
     {
         if (type_ == VAR_INT64)
             return value_.int64_;
         else if (type_ == VAR_INT)
             return value_.int_;
         else if (type_ == VAR_FLOAT)
-            return static_cast<long long>(value_.float_);
+            return static_cast<i64>(value_.float_);
         else if (type_ == VAR_DOUBLE)
-            return static_cast<long long>(value_.double_);
+            return static_cast<i64>(value_.double_);
         else
             return 0;
     }
 
     /// Return unsigned 64 bit int or zero on type mismatch. Floats and doubles are converted.
-    unsigned long long GetUInt64() const
+    u64 GetU64() const
     {
         if (type_ == VAR_INT64)
-            return static_cast<unsigned long long>(value_.int64_);
+            return static_cast<u64>(value_.int64_);
         else if (type_ == VAR_INT)
-            return static_cast<unsigned long long>(value_.int_);
+            return static_cast<u64>(value_.int_);
         else if (type_ == VAR_FLOAT)
-            return static_cast<unsigned long long>(value_.float_);
+            return static_cast<u64>(value_.float_);
         else if (type_ == VAR_DOUBLE)
-            return static_cast<unsigned long long>(value_.double_);
+            return static_cast<u64>(value_.double_);
         else
             return 0;
     }
 
     /// Return unsigned int or zero on type mismatch. Floats and doubles are converted.
-    unsigned GetUInt() const
+    u32 GetU32() const
     {
         if (type_ == VAR_INT)
-            return static_cast<unsigned>(value_.int_);
+            return static_cast<u32>(value_.int_);
         else if (type_ == VAR_FLOAT)
-            return static_cast<unsigned>(value_.float_);
+            return static_cast<u32>(value_.float_);
         else if (type_ == VAR_DOUBLE)
-            return static_cast<unsigned>(value_.double_);
+            return static_cast<u32>(value_.double_);
         else
             return 0;
     }
@@ -1166,7 +1166,7 @@ public:
     }
 
     /// Return StringHash or zero on type mismatch.
-    StringHash GetStringHash() const { return StringHash(GetUInt()); }
+    StringHash GetStringHash() const { return StringHash(GetU32()); }
 
     /// Return bool or false on type mismatch.
     bool GetBool() const { return type_ == VAR_BOOL ? value_.bool_ : false; }

+ 1 - 1
Source/Urho3D/Engine/Application.cpp

@@ -106,7 +106,7 @@ void Application::HandleLogMessage(StringHash eventType, VariantMap& eventData)
 {
     using namespace LogMessage;
 
-    if (eventData[P_LEVEL].GetInt() == LOG_ERROR)
+    if (eventData[P_LEVEL].GetI32() == LOG_ERROR)
     {
         // Strip the timestamp if necessary
         String error = eventData[P_MESSAGE].GetString();

+ 2 - 2
Source/Urho3D/Engine/Console.cpp

@@ -396,7 +396,7 @@ void Console::HandleLineEditKey(StringHash eventType, VariantMap& eventData)
 
     bool changed = false;
 
-    switch (eventData[P_KEY].GetInt())
+    switch (eventData[P_KEY].GetI32())
     {
     case KEY_UP:
         if (autoCompletePosition_ == 0)
@@ -523,7 +523,7 @@ void Console::HandleLogMessage(StringHash eventType, VariantMap& eventData)
 
     using namespace LogMessage;
 
-    int level = eventData[P_LEVEL].GetInt();
+    int level = eventData[P_LEVEL].GetI32();
     // The message may be multi-line, so split to rows in that case
     Vector<String> rows = eventData[P_MESSAGE].GetString().Split('\n');
 

+ 15 - 15
Source/Urho3D/Engine/Engine.cpp

@@ -216,7 +216,7 @@ bool Engine::Initialize(const VariantMap& parameters)
     if (log)
     {
         if (HasParameter(parameters, EP_LOG_LEVEL))
-            log->SetLevel(GetParameter(parameters, EP_LOG_LEVEL).GetInt());
+            log->SetLevel(GetParameter(parameters, EP_LOG_LEVEL).GetI32());
         log->SetQuiet(GetParameter(parameters, EP_LOG_QUIET, false).GetBool());
         log->Open(GetParameter(parameters, EP_LOG_NAME, "Urho3D.log").GetString());
     }
@@ -261,8 +261,8 @@ bool Engine::Initialize(const VariantMap& parameters)
         graphics->SetOrientations(GetParameter(parameters, EP_ORIENTATIONS, "LandscapeLeft LandscapeRight").GetString());
 
         if (HasParameter(parameters, EP_WINDOW_POSITION_X) && HasParameter(parameters, EP_WINDOW_POSITION_Y))
-            graphics->SetWindowPosition(GetParameter(parameters, EP_WINDOW_POSITION_X).GetInt(),
-                GetParameter(parameters, EP_WINDOW_POSITION_Y).GetInt());
+            graphics->SetWindowPosition(GetParameter(parameters, EP_WINDOW_POSITION_X).GetI32(),
+                GetParameter(parameters, EP_WINDOW_POSITION_Y).GetI32());
 
         if (Graphics::GetGAPI() == GAPI_OPENGL)
         {
@@ -271,17 +271,17 @@ bool Engine::Initialize(const VariantMap& parameters)
         }
 
         if (!graphics->SetMode(
-            GetParameter(parameters, EP_WINDOW_WIDTH, 0).GetInt(),
-            GetParameter(parameters, EP_WINDOW_HEIGHT, 0).GetInt(),
+            GetParameter(parameters, EP_WINDOW_WIDTH, 0).GetI32(),
+            GetParameter(parameters, EP_WINDOW_HEIGHT, 0).GetI32(),
             GetParameter(parameters, EP_FULL_SCREEN, true).GetBool(),
             GetParameter(parameters, EP_BORDERLESS, false).GetBool(),
             GetParameter(parameters, EP_WINDOW_RESIZABLE, false).GetBool(),
             GetParameter(parameters, EP_HIGH_DPI, true).GetBool(),
             GetParameter(parameters, EP_VSYNC, false).GetBool(),
             GetParameter(parameters, EP_TRIPLE_BUFFER, false).GetBool(),
-            GetParameter(parameters, EP_MULTI_SAMPLE, 1).GetInt(),
-            GetParameter(parameters, EP_MONITOR, 0).GetInt(),
-            GetParameter(parameters, EP_REFRESH_RATE, 0).GetInt()
+            GetParameter(parameters, EP_MULTI_SAMPLE, 1).GetI32(),
+            GetParameter(parameters, EP_MONITOR, 0).GetI32(),
+            GetParameter(parameters, EP_REFRESH_RATE, 0).GetI32()
         ))
             return false;
 
@@ -295,16 +295,16 @@ bool Engine::Initialize(const VariantMap& parameters)
         renderer->SetDrawShadows(GetParameter(parameters, EP_SHADOWS, true).GetBool());
         if (renderer->GetDrawShadows() && GetParameter(parameters, EP_LOW_QUALITY_SHADOWS, false).GetBool())
             renderer->SetShadowQuality(SHADOWQUALITY_SIMPLE_16BIT);
-        renderer->SetMaterialQuality((MaterialQuality)GetParameter(parameters, EP_MATERIAL_QUALITY, QUALITY_HIGH).GetInt());
-        renderer->SetTextureQuality((MaterialQuality)GetParameter(parameters, EP_TEXTURE_QUALITY, QUALITY_HIGH).GetInt());
-        renderer->SetTextureFilterMode((TextureFilterMode)GetParameter(parameters, EP_TEXTURE_FILTER_MODE, FILTER_TRILINEAR).GetInt());
-        renderer->SetTextureAnisotropy(GetParameter(parameters, EP_TEXTURE_ANISOTROPY, 4).GetInt());
+        renderer->SetMaterialQuality((MaterialQuality)GetParameter(parameters, EP_MATERIAL_QUALITY, QUALITY_HIGH).GetI32());
+        renderer->SetTextureQuality((MaterialQuality)GetParameter(parameters, EP_TEXTURE_QUALITY, QUALITY_HIGH).GetI32());
+        renderer->SetTextureFilterMode((TextureFilterMode)GetParameter(parameters, EP_TEXTURE_FILTER_MODE, FILTER_TRILINEAR).GetI32());
+        renderer->SetTextureAnisotropy(GetParameter(parameters, EP_TEXTURE_ANISOTROPY, 4).GetI32());
 
         if (GetParameter(parameters, EP_SOUND, true).GetBool())
         {
             GetSubsystem<Audio>()->SetMode(
-                GetParameter(parameters, EP_SOUND_BUFFER, 100).GetInt(),
-                GetParameter(parameters, EP_SOUND_MIX_RATE, 44100).GetInt(),
+                GetParameter(parameters, EP_SOUND_BUFFER, 100).GetI32(),
+                GetParameter(parameters, EP_SOUND_MIX_RATE, 44100).GetI32(),
                 GetParameter(parameters, EP_SOUND_STEREO, true).GetBool(),
                 GetParameter(parameters, EP_SOUND_INTERPOLATION, true).GetBool()
             );
@@ -326,7 +326,7 @@ bool Engine::Initialize(const VariantMap& parameters)
 
 #ifdef URHO3D_TESTING
     if (HasParameter(parameters, EP_TIME_OUT))
-        timeOut_ = GetParameter(parameters, EP_TIME_OUT, 0).GetInt() * 1000000LL;
+        timeOut_ = GetParameter(parameters, EP_TIME_OUT, 0).GetI32() * 1000000LL;
 #endif
 
 #ifdef URHO3D_PROFILING

+ 2 - 2
Source/Urho3D/Graphics/AnimatedModel.cpp

@@ -798,7 +798,7 @@ void AnimatedModel::SetAnimationStatesAttr(const VariantVector& value)
     auto* cache = GetSubsystem<ResourceCache>();
     RemoveAllAnimationStates();
     unsigned index = 0;
-    unsigned numStates = index < value.Size() ? value[index++].GetUInt() : 0;
+    unsigned numStates = index < value.Size() ? value[index++].GetU32() : 0;
     // Prevent negative or overly large value being assigned from the editor
     if (numStates > M_MAX_INT)
         numStates = 0;
@@ -819,7 +819,7 @@ void AnimatedModel::SetAnimationStatesAttr(const VariantVector& value)
             newState->SetLooped(value[index++].GetBool());
             newState->SetWeight(value[index++].GetFloat());
             newState->SetTime(value[index++].GetFloat());
-            newState->SetLayer((unsigned char)value[index++].GetInt());
+            newState->SetLayer((unsigned char)value[index++].GetI32());
         }
         else
         {

+ 1 - 1
Source/Urho3D/Graphics/AnimationController.cpp

@@ -695,7 +695,7 @@ void AnimationController::SetNodeAnimationStatesAttr(const VariantVector& value)
     auto* cache = GetSubsystem<ResourceCache>();
     nodeAnimationStates_.Clear();
     i32 index = 0;
-    i32 numStates = index < value.Size() ? value[index++].GetInt() : 0;
+    i32 numStates = index < value.Size() ? value[index++].GetI32() : 0;
     // Prevent negative or overly large value being assigned from the editor
     if (numStates < 0)
         numStates = 0;

+ 11 - 11
Source/Urho3D/Graphics/BillboardSet.cpp

@@ -359,7 +359,7 @@ void BillboardSet::SetMaterialAttr(const ResourceRef& value)
 void BillboardSet::SetBillboardsAttr(const VariantVector& value)
 {
     i32 index = 0;
-    i32 numBillboards = index < value.Size() ? value[index++].GetInt() : 0;
+    i32 numBillboards = index < value.Size() ? value[index++].GetI32() : 0;
     assert(numBillboards >= 0);
     SetNumBillboards(numBillboards);
 
@@ -638,7 +638,7 @@ void BillboardSet::UpdateVertexBuffer(const FrameInfo& frame)
             Billboard& billboard = *sortedBillboards_[i];
 
             Vector2 size(billboard.size_.x_ * billboardScale.x_, billboard.size_.y_ * billboardScale.y_);
-            unsigned color = billboard.color_.ToUInt();
+            color32 color = billboard.color_.ToU32();
             if (fixedScreenSize_)
                 size *= billboard.screenScaleFactor_;
 
@@ -650,7 +650,7 @@ void BillboardSet::UpdateVertexBuffer(const FrameInfo& frame)
             dest[0] = billboard.position_.x_;
             dest[1] = billboard.position_.y_;
             dest[2] = billboard.position_.z_;
-            ((unsigned&)dest[3]) = color;
+            ((color32&)dest[3]) = color;
             dest[4] = billboard.uv_.min_.x_;
             dest[5] = billboard.uv_.min_.y_;
             dest[6] = -size.x_ * rotationMatrix[0][0] + size.y_ * rotationMatrix[0][1];
@@ -659,7 +659,7 @@ void BillboardSet::UpdateVertexBuffer(const FrameInfo& frame)
             dest[8] = billboard.position_.x_;
             dest[9] = billboard.position_.y_;
             dest[10] = billboard.position_.z_;
-            ((unsigned&)dest[11]) = color;
+            ((color32&)dest[11]) = color;
             dest[12] = billboard.uv_.max_.x_;
             dest[13] = billboard.uv_.min_.y_;
             dest[14] = size.x_ * rotationMatrix[0][0] + size.y_ * rotationMatrix[0][1];
@@ -668,7 +668,7 @@ void BillboardSet::UpdateVertexBuffer(const FrameInfo& frame)
             dest[16] = billboard.position_.x_;
             dest[17] = billboard.position_.y_;
             dest[18] = billboard.position_.z_;
-            ((unsigned&)dest[19]) = color;
+            ((color32&)dest[19]) = color;
             dest[20] = billboard.uv_.max_.x_;
             dest[21] = billboard.uv_.max_.y_;
             dest[22] = size.x_ * rotationMatrix[0][0] - size.y_ * rotationMatrix[0][1];
@@ -677,7 +677,7 @@ void BillboardSet::UpdateVertexBuffer(const FrameInfo& frame)
             dest[24] = billboard.position_.x_;
             dest[25] = billboard.position_.y_;
             dest[26] = billboard.position_.z_;
-            ((unsigned&)dest[27]) = color;
+            ((color32&)dest[27]) = color;
             dest[28] = billboard.uv_.min_.x_;
             dest[29] = billboard.uv_.max_.y_;
             dest[30] = -size.x_ * rotationMatrix[0][0] - size.y_ * rotationMatrix[0][1];
@@ -693,7 +693,7 @@ void BillboardSet::UpdateVertexBuffer(const FrameInfo& frame)
             Billboard& billboard = *sortedBillboards_[i];
 
             Vector2 size(billboard.size_.x_ * billboardScale.x_, billboard.size_.y_ * billboardScale.y_);
-            unsigned color = billboard.color_.ToUInt();
+            color32 color = billboard.color_.ToU32();
             if (fixedScreenSize_)
                 size *= billboard.screenScaleFactor_;
 
@@ -708,7 +708,7 @@ void BillboardSet::UpdateVertexBuffer(const FrameInfo& frame)
             dest[3] = billboard.direction_.x_;
             dest[4] = billboard.direction_.y_;
             dest[5] = billboard.direction_.z_;
-            ((unsigned&)dest[6]) = color;
+            ((color32&)dest[6]) = color;
             dest[7] = billboard.uv_.min_.x_;
             dest[8] = billboard.uv_.min_.y_;
             dest[9] = -size.x_ * rot2D[0][0] + size.y_ * rot2D[0][1];
@@ -720,7 +720,7 @@ void BillboardSet::UpdateVertexBuffer(const FrameInfo& frame)
             dest[14] = billboard.direction_.x_;
             dest[15] = billboard.direction_.y_;
             dest[16] = billboard.direction_.z_;
-            ((unsigned&)dest[17]) = color;
+            ((color32&)dest[17]) = color;
             dest[18] = billboard.uv_.max_.x_;
             dest[19] = billboard.uv_.min_.y_;
             dest[20] = size.x_ * rot2D[0][0] + size.y_ * rot2D[0][1];
@@ -732,7 +732,7 @@ void BillboardSet::UpdateVertexBuffer(const FrameInfo& frame)
             dest[25] = billboard.direction_.x_;
             dest[26] = billboard.direction_.y_;
             dest[27] = billboard.direction_.z_;
-            ((unsigned&)dest[28]) = color;
+            ((color32&)dest[28]) = color;
             dest[29] = billboard.uv_.max_.x_;
             dest[30] = billboard.uv_.max_.y_;
             dest[31] = size.x_ * rot2D[0][0] - size.y_ * rot2D[0][1];
@@ -744,7 +744,7 @@ void BillboardSet::UpdateVertexBuffer(const FrameInfo& frame)
             dest[36] = billboard.direction_.x_;
             dest[37] = billboard.direction_.y_;
             dest[38] = billboard.direction_.z_;
-            ((unsigned&)dest[39]) = color;
+            ((color32&)dest[39]) = color;
             dest[40] = billboard.uv_.min_.x_;
             dest[41] = billboard.uv_.max_.y_;
             dest[42] = -size.x_ * rot2D[0][0] - size.y_ * rot2D[0][1];

+ 1 - 1
Source/Urho3D/Graphics/CustomGeometry.cpp

@@ -261,7 +261,7 @@ void CustomGeometry::DefineColor(const Color& color)
     if (vertices_.Size() < geometryIndex_ || vertices_[geometryIndex_].Empty())
         return;
 
-    vertices_[geometryIndex_].Back().color_ = color.ToUInt();
+    vertices_[geometryIndex_].Back().color_ = color.ToU32();
     elementMask_ |= VertexElements::Color;
 }
 

+ 1 - 1
Source/Urho3D/Graphics/CustomGeometry.h

@@ -17,7 +17,7 @@ struct CustomGeometryVertex
     /// Normal.
     Vector3 normal_;
     /// Color.
-    unsigned color_;
+    color32 color_;
     /// Texture coordinates.
     Vector2 texCoord_;
     /// Tangent.

+ 16 - 16
Source/Urho3D/Graphics/DebugRenderer.cpp

@@ -67,7 +67,7 @@ void DebugRenderer::SetView(Camera* camera)
 
 void DebugRenderer::AddLine(const Vector3& start, const Vector3& end, const Color& color, bool depthTest)
 {
-    AddLine(start, end, color.ToUInt(), depthTest);
+    AddLine(start, end, color.ToU32(), depthTest);
 }
 
 void DebugRenderer::AddLine(const Vector3& start, const Vector3& end, unsigned color, bool depthTest)
@@ -83,7 +83,7 @@ void DebugRenderer::AddLine(const Vector3& start, const Vector3& end, unsigned c
 
 void DebugRenderer::AddTriangle(const Vector3& v1, const Vector3& v2, const Vector3& v3, const Color& color, bool depthTest)
 {
-    AddTriangle(v1, v2, v3, color.ToUInt(), depthTest);
+    AddTriangle(v1, v2, v3, color.ToU32(), depthTest);
 }
 
 void DebugRenderer::AddTriangle(const Vector3& v1, const Vector3& v2, const Vector3& v3, unsigned color, bool depthTest)
@@ -117,9 +117,9 @@ void DebugRenderer::AddNode(Node* node, float scale, bool depthTest)
     Vector3 start = node->GetWorldPosition();
     Quaternion rotation = node->GetWorldRotation();
 
-    AddLine(start, start + rotation * (scale * Vector3::RIGHT), Color::RED.ToUInt(), depthTest);
-    AddLine(start, start + rotation * (scale * Vector3::UP), Color::GREEN.ToUInt(), depthTest);
-    AddLine(start, start + rotation * (scale * Vector3::FORWARD), Color::BLUE.ToUInt(), depthTest);
+    AddLine(start, start + rotation * (scale * Vector3::RIGHT), Color::RED.ToU32(), depthTest);
+    AddLine(start, start + rotation * (scale * Vector3::UP), Color::GREEN.ToU32(), depthTest);
+    AddLine(start, start + rotation * (scale * Vector3::FORWARD), Color::BLUE.ToU32(), depthTest);
 }
 
 void DebugRenderer::AddBoundingBox(const BoundingBox& box, const Color& color, bool depthTest, bool solid)
@@ -134,7 +134,7 @@ void DebugRenderer::AddBoundingBox(const BoundingBox& box, const Color& color, b
     Vector3 v5(max.x_, min.y_, max.z_);
     Vector3 v6(min.x_, max.y_, max.z_);
 
-    unsigned uintColor = color.ToUInt();
+    color32 uintColor = color.ToU32();
 
     if (!solid)
     {
@@ -176,7 +176,7 @@ void DebugRenderer::AddBoundingBox(const BoundingBox& box, const Matrix3x4& tran
     Vector3 v6(transform * Vector3(min.x_, max.y_, max.z_));
     Vector3 v7(transform * max);
 
-    unsigned uintColor = color.ToUInt();
+    color32 uintColor = color.ToU32();
 
     if (!solid)
     {
@@ -207,7 +207,7 @@ void DebugRenderer::AddBoundingBox(const BoundingBox& box, const Matrix3x4& tran
 void DebugRenderer::AddFrustum(const Frustum& frustum, const Color& color, bool depthTest)
 {
     const Vector3* vertices = frustum.vertices_;
-    unsigned uintColor = color.ToUInt();
+    color32 uintColor = color.ToU32();
 
     AddLine(vertices[0], vertices[1], uintColor, depthTest);
     AddLine(vertices[1], vertices[2], uintColor, depthTest);
@@ -225,7 +225,7 @@ void DebugRenderer::AddFrustum(const Frustum& frustum, const Color& color, bool
 
 void DebugRenderer::AddPolyhedron(const Polyhedron& poly, const Color& color, bool depthTest)
 {
-    unsigned uintColor = color.ToUInt();
+    color32 uintColor = color.ToU32();
 
     for (const Vector<Vector3>& face : poly.faces_)
     {
@@ -239,7 +239,7 @@ void DebugRenderer::AddPolyhedron(const Polyhedron& poly, const Color& color, bo
 
 void DebugRenderer::AddSphere(const Sphere& sphere, const Color& color, bool depthTest)
 {
-    unsigned uintColor = color.ToUInt();
+    color32 uintColor = color.ToU32();
 
     for (auto j = 0; j < 180; j += 45)
     {
@@ -273,7 +273,7 @@ void DebugRenderer::AddSphereSector(const Sphere& sphere, const Quaternion& rota
     static const unsigned numLines = 4;
     static const float arcStep = 45.0f;
 
-    const unsigned uintColor = color.ToUInt();
+    const color32 uintColor = color.ToU32();
     const float halfAngle = 0.5f * angle;
     const unsigned numArcSegments = static_cast<unsigned>(Ceil(halfAngle / arcStep)) + 1;
 
@@ -337,7 +337,7 @@ void DebugRenderer::AddSkeleton(const Skeleton& skeleton, const Color& color, bo
     if (!bones.Size())
         return;
 
-    unsigned uintColor = color.ToUInt();
+    color32 uintColor = color.ToU32();
 
     for (const Bone& bone : bones)
     {
@@ -374,7 +374,7 @@ void DebugRenderer::AddTriangleMesh(const void* vertexData, unsigned vertexSize,
 void DebugRenderer::AddTriangleMesh(const void* vertexData, unsigned vertexSize, unsigned vertexStart, const void* indexData,
     unsigned indexSize, unsigned indexStart, unsigned indexCount, const Matrix3x4& transform, const Color& color, bool depthTest)
 {
-    unsigned uintColor = color.ToUInt();
+    color32 uintColor = color.ToU32();
     const auto* srcData = ((const unsigned char*)vertexData) + vertexStart;
 
     // 16-bit indices
@@ -421,7 +421,7 @@ void DebugRenderer::AddCircle(const Vector3& center, const Vector3& normal, floa
     Quaternion orientation;
     orientation.FromRotationTo(Vector3::UP, normal.Normalized());
     Vector3 p = orientation * Vector3(radius, 0, 0) + center;
-    unsigned uintColor = color.ToUInt();
+    color32 uintColor = color.ToU32();
 
     for(int i = 1; i <= steps; ++i)
     {
@@ -438,7 +438,7 @@ void DebugRenderer::AddCircle(const Vector3& center, const Vector3& normal, floa
 
 void DebugRenderer::AddCross(const Vector3& center, float size, const Color& color, bool depthTest)
 {
-    unsigned uintColor = color.ToUInt();
+    color32 uintColor = color.ToU32();
 
     float halfSize = size / 2.0f;
     for (int i = 0; i < 3; ++i)
@@ -453,7 +453,7 @@ void DebugRenderer::AddCross(const Vector3& center, float size, const Color& col
 
 void DebugRenderer::AddQuad(const Vector3& center, float width, float height, const Color& color, bool depthTest)
 {
-    unsigned uintColor = color.ToUInt();
+    color32 uintColor = color.ToU32();
 
     Vector3 v0(center.x_ - width / 2, center.y_, center.z_ - height / 2);
     Vector3 v1(center.x_ + width / 2, center.y_, center.z_ - height / 2);

+ 1 - 1
Source/Urho3D/Graphics/Graphics.cpp

@@ -160,7 +160,7 @@ void Graphics::SetShaderParameter(StringHash param, const Variant& value)
         break;
 
     case VAR_INT:
-        SetShaderParameter(param, value.GetInt());
+        SetShaderParameter(param, value.GetI32());
         break;
 
     case VAR_FLOAT:

+ 6 - 6
Source/Urho3D/Graphics/Material.cpp

@@ -403,7 +403,7 @@ bool Material::Load(const XMLElement& source)
             TechniqueEntry newTechnique;
             newTechnique.technique_ = newTechnique.original_ = tech;
             if (techniqueElem.HasAttribute("quality"))
-                newTechnique.qualityLevel_ = (MaterialQuality)techniqueElem.GetInt("quality");
+                newTechnique.qualityLevel_ = (MaterialQuality)techniqueElem.GetI32("quality");
             if (techniqueElem.HasAttribute("loddistance"))
                 newTechnique.lodDistance_ = techniqueElem.GetFloat("loddistance");
             techniques_.Push(newTechnique);
@@ -513,7 +513,7 @@ bool Material::Load(const XMLElement& source)
 
     XMLElement renderOrderElem = source.GetChild("renderorder");
     if (renderOrderElem)
-        SetRenderOrder((i8)renderOrderElem.GetInt("value"));
+        SetRenderOrder((i8)renderOrderElem.GetI32("value"));
 
     XMLElement occlusionElem = source.GetChild("occlusion");
     if (occlusionElem)
@@ -557,7 +557,7 @@ bool Material::Load(const JSONValue& source)
             newTechnique.technique_ = newTechnique.original_ = tech;
             JSONValue qualityVal = techVal.Get("quality");
             if (!qualityVal.IsNull())
-                newTechnique.qualityLevel_ = (MaterialQuality)qualityVal.GetInt();
+                newTechnique.qualityLevel_ = (MaterialQuality)qualityVal.GetI32();
             JSONValue lodDistanceVal = techVal.Get("loddistance");
             if (!lodDistanceVal.IsNull())
                 newTechnique.lodDistance_ = lodDistanceVal.GetFloat();
@@ -673,7 +673,7 @@ bool Material::Load(const JSONValue& source)
 
     JSONValue renderOrderVal = source.Get("renderorder");
     if (!renderOrderVal.IsNull())
-        SetRenderOrder((i8)renderOrderVal.GetInt());
+        SetRenderOrder((i8)renderOrderVal.GetI32());
 
     JSONValue occlusionVal = source.Get("occlusion");
     if (!occlusionVal.IsNull())
@@ -700,7 +700,7 @@ bool Material::Save(XMLElement& dest) const
 
         XMLElement techniqueElem = dest.CreateChild("technique");
         techniqueElem.SetString("name", entry.technique_->GetName());
-        techniqueElem.SetInt("quality", entry.qualityLevel_);
+        techniqueElem.SetI32("quality", entry.qualityLevel_);
         techniqueElem.SetFloat("loddistance", entry.lodDistance_);
     }
 
@@ -781,7 +781,7 @@ bool Material::Save(XMLElement& dest) const
 
     // Write render order
     XMLElement renderOrderElem = dest.CreateChild("renderorder");
-    renderOrderElem.SetInt("value", renderOrder_);
+    renderOrderElem.SetI32("value", renderOrder_);
 
     // Write occlusion
     XMLElement occlusionElem = dest.CreateChild("occlusion");

+ 2 - 2
Source/Urho3D/Graphics/ParticleEffect.cpp

@@ -162,7 +162,7 @@ bool ParticleEffect::Load(const XMLElement& source)
     }
 
     if (source.HasChild("numparticles"))
-        SetNumParticles((unsigned)source.GetChild("numparticles").GetInt("value"));
+        SetNumParticles((unsigned)source.GetChild("numparticles").GetI32("value"));
 
     if (source.HasChild("updateinvisible"))
         updateInvisible_ = source.GetChild("updateinvisible").GetBool("enable");
@@ -319,7 +319,7 @@ bool ParticleEffect::Save(XMLElement& dest) const
     childElem.SetAttribute("name", GetResourceName(material_));
 
     childElem = dest.CreateChild("numparticles");
-    childElem.SetInt("value", numParticles_);
+    childElem.SetI32("value", numParticles_);
 
     childElem = dest.CreateChild("updateinvisible");
     childElem.SetBool("enable", updateInvisible_);

+ 3 - 3
Source/Urho3D/Graphics/ParticleEmitter.cpp

@@ -350,7 +350,7 @@ ResourceRef ParticleEmitter::GetEffectAttr() const
 void ParticleEmitter::SetParticlesAttr(const VariantVector& value)
 {
     i32 index = 0;
-    SetNumParticles(index < value.Size() ? value[index++].GetUInt() : 0);
+    SetNumParticles(index < value.Size() ? value[index++].GetU32() : 0);
 
     for (Vector<Particle>::Iterator i = particles_.Begin(); i != particles_.End() && index < value.Size(); ++i)
     {
@@ -360,8 +360,8 @@ void ParticleEmitter::SetParticlesAttr(const VariantVector& value)
         i->timeToLive_ = value[index++].GetFloat();
         i->scale_ = value[index++].GetFloat();
         i->rotationSpeed_ = value[index++].GetFloat();
-        i->colorIndex_ = value[index++].GetInt();
-        i->texIndex_ = value[index++].GetInt();
+        i->colorIndex_ = value[index++].GetI32();
+        i->texIndex_ = value[index++].GetI32();
     }
 }
 

+ 5 - 5
Source/Urho3D/Graphics/RenderPath.cpp

@@ -85,7 +85,7 @@ void RenderTargetInfo::Load(const XMLElement& element)
         size_.y_ = element.GetFloat("height");
 
     if (element.HasAttribute("multisample"))
-        multiSample_ = Clamp(element.GetInt("multisample"), 1, 16);
+        multiSample_ = Clamp(element.GetI32("multisample"), 1, 16);
     if (element.HasAttribute("autoresolve"))
         autoResolve_ = element.GetBool("autoresolve");
 }
@@ -118,7 +118,7 @@ void RenderPathCommand::Load(const XMLElement& element)
         if (element.HasAttribute("stencil"))
         {
             clearFlags_ |= CLEAR_STENCIL;
-            clearStencil_ = (unsigned)element.GetInt("stencil");
+            clearStencil_ = (unsigned)element.GetI32("stencil");
         }
         break;
 
@@ -164,20 +164,20 @@ void RenderPathCommand::Load(const XMLElement& element)
     if (element.HasAttribute("output"))
         outputs_[0].first_ = element.GetAttribute("output");
     if (element.HasAttribute("face"))
-        outputs_[0].second_ = (CubeMapFace)element.GetInt("face");
+        outputs_[0].second_ = (CubeMapFace)element.GetI32("face");
     if (element.HasAttribute("depthstencil"))
         depthStencilName_ = element.GetAttribute("depthstencil");
     // Check for defining multiple outputs
     XMLElement outputElem = element.GetChild("output");
     while (outputElem)
     {
-        unsigned index = (unsigned)outputElem.GetInt("index");
+        unsigned index = (unsigned)outputElem.GetI32("index");
         if (index < MAX_RENDERTARGETS)
         {
             if (index >= outputs_.Size())
                 outputs_.Resize(index + 1);
             outputs_[index].first_ = outputElem.GetAttribute("name");
-            outputs_[index].second_ = outputElem.HasAttribute("face") ? (CubeMapFace)outputElem.GetInt("face") : FACE_POSITIVE_X;
+            outputs_[index].second_ = outputElem.HasAttribute("face") ? (CubeMapFace)outputElem.GetI32("face") : FACE_POSITIVE_X;
         }
         outputElem = outputElem.GetNext("output");
     }

+ 14 - 14
Source/Urho3D/Graphics/RibbonTrail.cpp

@@ -571,19 +571,19 @@ void RibbonTrail::UpdateVertexBuffer(const FrameInfo& frame)
 
             // This point
             float factor = SmoothStep(0.0f, trailLength, point.elapsedLength_);
-            unsigned c = endColor_.Lerp(startColor_, factor).ToUInt();
+            color32 c = endColor_.Lerp(startColor_, factor).ToU32();
             float width = Lerp(width_ * endScale_, width_ * startScale_, factor);
 
             // Next point
             float nextFactor = SmoothStep(0.0f, trailLength, point.next_->elapsedLength_);
-            unsigned nextC = endColor_.Lerp(startColor_, nextFactor).ToUInt();
+            color32 nextC = endColor_.Lerp(startColor_, nextFactor).ToU32();
             float nextWidth = Lerp(width_ * endScale_, width_ * startScale_, nextFactor);
 
             // First row
             dest[0] = point.position_.x_;
             dest[1] = point.position_.y_;
             dest[2] = point.position_.z_;
-            ((unsigned&)dest[3]) = c;
+            ((color32&)dest[3]) = c;
             dest[4] = factor;
             dest[5] = 0.0f;
             dest[6] = point.forward_.x_;
@@ -594,7 +594,7 @@ void RibbonTrail::UpdateVertexBuffer(const FrameInfo& frame)
             dest[10] = point.next_->position_.x_;
             dest[11] = point.next_->position_.y_;
             dest[12] = point.next_->position_.z_;
-            ((unsigned&)dest[13]) = nextC;
+            ((color32&)dest[13]) = nextC;
             dest[14] = nextFactor;
             dest[15] = 0.0f;
             dest[16] = point.next_->forward_.x_;
@@ -614,7 +614,7 @@ void RibbonTrail::UpdateVertexBuffer(const FrameInfo& frame)
                 dest[0] = point.position_.x_;
                 dest[1] = point.position_.y_;
                 dest[2] = point.position_.z_;
-                ((unsigned&)dest[3]) = c;
+                ((color32&)dest[3]) = c;
                 dest[4] = factor;
                 dest[5] = elapsed;
                 dest[6] = point.forward_.x_;
@@ -625,7 +625,7 @@ void RibbonTrail::UpdateVertexBuffer(const FrameInfo& frame)
                 dest[10] = point.next_->position_.x_;
                 dest[11] = point.next_->position_.y_;
                 dest[12] = point.next_->position_.z_;
-                ((unsigned&)dest[13]) = nextC;
+                ((color32&)dest[13]) = nextC;
                 dest[14] = nextFactor;
                 dest[15] = elapsed;
                 dest[16] = point.next_->forward_.x_;
@@ -672,7 +672,7 @@ void RibbonTrail::UpdateVertexBuffer(const FrameInfo& frame)
 
             // This point
             float factor = SmoothStep(0.0f, trailLength, point.elapsedLength_);
-            unsigned c = endColor_.Lerp(startColor_, factor).ToUInt();
+            color32 c = endColor_.Lerp(startColor_, factor).ToU32();
 
             float rightScale = Lerp(endScale_, startScale_, factor);
             float shift = (rightScale - 1.0f) / 2.0f;
@@ -680,7 +680,7 @@ void RibbonTrail::UpdateVertexBuffer(const FrameInfo& frame)
 
             // Next point
             float nextFactor = SmoothStep(0.0f, trailLength, point.next_->elapsedLength_);
-            unsigned nextC = endColor_.Lerp(startColor_, nextFactor).ToUInt();
+            color32 nextC = endColor_.Lerp(startColor_, nextFactor).ToU32();
 
             float nextRightScale = Lerp(endScale_, startScale_, nextFactor);
             float nextShift = (nextRightScale - 1.0f) / 2.0f;
@@ -693,7 +693,7 @@ void RibbonTrail::UpdateVertexBuffer(const FrameInfo& frame)
             dest[3] = point.forward_.x_;
             dest[4] = point.forward_.y_;
             dest[5] = point.forward_.z_;
-            ((unsigned&)dest[6]) = c;
+            ((color32&)dest[6]) = c;
             dest[7] = factor;
             dest[8] = 0.0f;
             dest[9] = point.parentPos_.x_;
@@ -707,7 +707,7 @@ void RibbonTrail::UpdateVertexBuffer(const FrameInfo& frame)
             dest[16] = point.next_->forward_.x_;
             dest[17] = point.next_->forward_.y_;
             dest[18] = point.next_->forward_.z_;
-            ((unsigned&)dest[19]) = nextC;
+            ((color32&)dest[19]) = nextC;
             dest[20] = nextFactor;
             dest[21] = 0.0f;
             dest[22] = point.next_->parentPos_.x_;
@@ -728,7 +728,7 @@ void RibbonTrail::UpdateVertexBuffer(const FrameInfo& frame)
                 dest[3] = point.forward_.x_;
                 dest[4] = point.forward_.y_;
                 dest[5] = point.forward_.z_;
-                ((unsigned&)dest[6]) = c;
+                ((color32&)dest[6]) = c;
                 dest[7] = factor;
                 dest[8] = elapsed;
                 dest[9] = point.parentPos_.x_;
@@ -742,7 +742,7 @@ void RibbonTrail::UpdateVertexBuffer(const FrameInfo& frame)
                 dest[16] = point.next_->forward_.x_;
                 dest[17] = point.next_->forward_.y_;
                 dest[18] = point.next_->forward_.z_;
-                ((unsigned&)dest[19]) = nextC;
+                ((color32&)dest[19]) = nextC;
                 dest[20] = nextFactor;
                 dest[21] = elapsed;
                 dest[22] = point.next_->parentPos_.x_;
@@ -760,7 +760,7 @@ void RibbonTrail::UpdateVertexBuffer(const FrameInfo& frame)
             dest[3] = point.forward_.x_;
             dest[4] = point.forward_.y_;
             dest[5] = point.forward_.z_;
-            ((unsigned&)dest[6]) = c;
+            ((color32&)dest[6]) = c;
             dest[7] = factor;
             dest[8] = 1.0f;
             dest[9] = point.parentPos_.x_;
@@ -774,7 +774,7 @@ void RibbonTrail::UpdateVertexBuffer(const FrameInfo& frame)
             dest[16] = point.next_->forward_.x_;
             dest[17] = point.next_->forward_.y_;
             dest[18] = point.next_->forward_.z_;
-            ((unsigned&)dest[19]) = nextC;
+            ((color32&)dest[19]) = nextC;
             dest[20] = nextFactor;
             dest[21] = 1.0f;
             dest[22] = point.next_->parentPos_.x_;

+ 3 - 3
Source/Urho3D/Graphics/StaticModelGroup.cpp

@@ -67,7 +67,7 @@ void StaticModelGroup::ApplyAttributes()
         // The first index stores the number of IDs redundantly. This is for editing
         for (unsigned i = 1; i < nodeIDsAttr_.Size(); ++i)
         {
-            Node* node = scene->GetNode(nodeIDsAttr_[i].GetUInt());
+            Node* node = scene->GetNode(nodeIDsAttr_[i].GetU32());
             if (node)
             {
                 WeakPtr<Node> instanceWeak(node);
@@ -308,7 +308,7 @@ void StaticModelGroup::SetNodeIDsAttr(const VariantVector& value)
         nodeIDsAttr_.Clear();
 
         unsigned index = 0;
-        unsigned numInstances = value[index++].GetUInt();
+        unsigned numInstances = value[index++].GetU32();
         // Prevent crash on entering negative value in the editor
         if (numInstances > M_MAX_INT)
             numInstances = 0;
@@ -318,7 +318,7 @@ void StaticModelGroup::SetNodeIDsAttr(const VariantVector& value)
         {
             // If vector contains less IDs than should, fill the rest with zeroes
             if (index < value.Size())
-                nodeIDsAttr_.Push(value[index++].GetUInt());
+                nodeIDsAttr_.Push(value[index++].GetU32());
             else
                 nodeIDsAttr_.Push(0);
         }

+ 5 - 5
Source/Urho3D/GraphicsAPI/Texture.cpp

@@ -184,7 +184,7 @@ void Texture::SetParameters(const XMLElement& element)
             String mode = paramElem.GetAttributeLower("mode");
             SetFilterMode((TextureFilterMode)GetStringListIndex(mode.CString(), filterModeNames, FILTER_DEFAULT));
             if (paramElem.HasAttribute("anisotropy"))
-                SetAnisotropy(paramElem.GetUInt("anisotropy"));
+                SetAnisotropy(paramElem.GetU32("anisotropy"));
         }
 
         if (name == "mipmap")
@@ -193,13 +193,13 @@ void Texture::SetParameters(const XMLElement& element)
         if (name == "quality")
         {
             if (paramElem.HasAttribute("low"))
-                SetMipsToSkip(QUALITY_LOW, paramElem.GetInt("low"));
+                SetMipsToSkip(QUALITY_LOW, paramElem.GetI32("low"));
             if (paramElem.HasAttribute("med"))
-                SetMipsToSkip(QUALITY_MEDIUM, paramElem.GetInt("med"));
+                SetMipsToSkip(QUALITY_MEDIUM, paramElem.GetI32("med"));
             if (paramElem.HasAttribute("medium"))
-                SetMipsToSkip(QUALITY_MEDIUM, paramElem.GetInt("medium"));
+                SetMipsToSkip(QUALITY_MEDIUM, paramElem.GetI32("medium"));
             if (paramElem.HasAttribute("high"))
-                SetMipsToSkip(QUALITY_HIGH, paramElem.GetInt("high"));
+                SetMipsToSkip(QUALITY_HIGH, paramElem.GetI32("high"));
         }
 
         if (name == "srgb")

+ 2 - 2
Source/Urho3D/IO/Serializer.cpp

@@ -238,10 +238,10 @@ bool Serializer::WriteVariantData(const Variant& value)
         return true;
 
     case VAR_INT:
-        return WriteI32(value.GetInt());
+        return WriteI32(value.GetI32());
 
     case VAR_INT64:
-        return WriteI64(value.GetInt64());
+        return WriteI64(value.GetI64());
 
     case VAR_BOOL:
         return WriteBool(value.GetBool());

+ 7 - 7
Source/Urho3D/Input/Input.cpp

@@ -2446,7 +2446,7 @@ void Input::HandleScreenJoystickTouch(StringHash eventType, VariantMap& eventDat
     using namespace TouchBegin;
 
     // Only interested in events from screen joystick(s)
-    TouchState& state = touches_[eventData[P_TOUCHID].GetInt()];
+    TouchState& state = touches_[eventData[P_TOUCHID].GetI32()];
     IntVector2 position(int(state.position_.x_ / GetSubsystem<UI>()->GetScale()), int(state.position_.y_ / GetSubsystem<UI>()->GetScale()));
     UIElement* element = eventType == E_TOUCHBEGIN ? GetSubsystem<UI>()->GetElementAt(position) : state.touchedElement_;
     if (!element)
@@ -2454,7 +2454,7 @@ void Input::HandleScreenJoystickTouch(StringHash eventType, VariantMap& eventDat
     Variant variant = element->GetVar(VAR_SCREEN_JOYSTICK_ID);
     if (variant.IsEmpty())
         return;
-    SDL_JoystickID joystickID = variant.GetInt();
+    SDL_JoystickID joystickID = variant.GetI32();
 
     if (eventType == E_TOUCHEND)
         state.touchedElement_.Reset();
@@ -2484,7 +2484,7 @@ void Input::HandleScreenJoystickTouch(StringHash eventType, VariantMap& eventDat
             if (!keyBindingVar.IsEmpty())
             {
                 evt.type = eventType == E_TOUCHBEGIN ? SDL_KEYDOWN : SDL_KEYUP;
-                evt.key.keysym.sym = ToLower(keyBindingVar.GetInt());
+                evt.key.keysym.sym = ToLower(keyBindingVar.GetI32());
                 evt.key.keysym.scancode = SDL_SCANCODE_UNKNOWN;
             }
             if (!mouseButtonBindingVar.IsEmpty())
@@ -2496,7 +2496,7 @@ void Input::HandleScreenJoystickTouch(StringHash eventType, VariantMap& eventDat
 
                 SDL_Event mouseEvent;
                 mouseEvent.type = eventType == E_TOUCHBEGIN ? SDL_MOUSEBUTTONDOWN : SDL_MOUSEBUTTONUP;
-                mouseEvent.button.button = (Uint8)mouseButtonBindingVar.GetInt();
+                mouseEvent.button.button = (Uint8)mouseButtonBindingVar.GetI32();
                 HandleSDLEvent(&mouseEvent);
 
                 touchEmulation_ = oldTouchEmulation;
@@ -2533,7 +2533,7 @@ void Input::HandleScreenJoystickTouch(StringHash eventType, VariantMap& eventDat
             if (eventType == E_TOUCHEND)
             {
                 evt.type = SDL_KEYUP;
-                evt.key.keysym.sym = element->GetVar(VAR_LAST_KEYSYM).GetInt();
+                evt.key.keysym.sym = element->GetVar(VAR_LAST_KEYSYM).GetI32();
                 if (!evt.key.keysym.sym)
                     return;
 
@@ -2554,12 +2554,12 @@ void Input::HandleScreenJoystickTouch(StringHash eventType, VariantMap& eventDat
                 else
                     return;
 
-                if (eventType == E_TOUCHMOVE && evt.key.keysym.sym != element->GetVar(VAR_LAST_KEYSYM).GetInt())
+                if (eventType == E_TOUCHMOVE && evt.key.keysym.sym != element->GetVar(VAR_LAST_KEYSYM).GetI32())
                 {
                     // Dragging past the directional boundary will cause an additional key up event for previous key symbol
                     SDL_Event keyEvent;
                     keyEvent.type = SDL_KEYUP;
-                    keyEvent.key.keysym.sym = element->GetVar(VAR_LAST_KEYSYM).GetInt();
+                    keyEvent.key.keysym.sym = element->GetVar(VAR_LAST_KEYSYM).GetI32();
                     if (keyEvent.key.keysym.sym)
                     {
                         keyEvent.key.keysym.scancode = SDL_SCANCODE_UNKNOWN;

+ 13 - 13
Source/Urho3D/Math/Color.cpp

@@ -12,22 +12,22 @@
 namespace Urho3D
 {
 
-unsigned Color::ToUInt() const
+color32 Color::ToU32() const
 {
-    auto r = (unsigned)Clamp(((int)(r_ * 255.0f)), 0, 255);
-    auto g = (unsigned)Clamp(((int)(g_ * 255.0f)), 0, 255);
-    auto b = (unsigned)Clamp(((int)(b_ * 255.0f)), 0, 255);
-    auto a = (unsigned)Clamp(((int)(a_ * 255.0f)), 0, 255);
+    u32 r = (u32)Clamp(((i32)(r_ * 255.0f)), 0, 255);
+    u32 g = (u32)Clamp(((i32)(g_ * 255.0f)), 0, 255);
+    u32 b = (u32)Clamp(((i32)(b_ * 255.0f)), 0, 255);
+    u32 a = (u32)Clamp(((i32)(a_ * 255.0f)), 0, 255);
     return (a << 24u) | (b << 16u) | (g << 8u) | r;
 }
 
-unsigned Color::ToUIntMask(const ChannelMask& mask) const
+color32 Color::ToU32(const ChannelMask& mask) const
 {
-    const auto max = static_cast<double>(M_MAX_UNSIGNED);
-    const auto r = static_cast<unsigned>(Clamp(static_cast<double>(r_) * mask.r_, 0.0, max)) & mask.r_;
-    const auto g = static_cast<unsigned>(Clamp(static_cast<double>(g_) * mask.g_, 0.0, max)) & mask.g_;
-    const auto b = static_cast<unsigned>(Clamp(static_cast<double>(b_) * mask.b_, 0.0, max)) & mask.b_;
-    const auto a = static_cast<unsigned>(Clamp(static_cast<double>(a_) * mask.a_, 0.0, max)) & mask.a_;
+    const double max = static_cast<double>(M_MAX_U32);
+    const u32 r = static_cast<u32>(Clamp(static_cast<double>(r_) * mask.r_, 0.0, max)) & mask.r_;
+    const u32 g = static_cast<u32>(Clamp(static_cast<double>(g_) * mask.g_, 0.0, max)) & mask.g_;
+    const u32 b = static_cast<u32>(Clamp(static_cast<double>(b_) * mask.b_, 0.0, max)) & mask.b_;
+    const u32 a = static_cast<u32>(Clamp(static_cast<double>(a_) * mask.a_, 0.0, max)) & mask.a_;
     return r | g | b | a;
 }
 
@@ -55,7 +55,7 @@ Vector3 Color::ToHSV() const
     return Vector3(h, s, v);
 }
 
-void Color::FromUInt(unsigned color)
+void Color::FromU32(color32 color)
 {
     a_ = ((color >> 24u) & 0xffu) / 255.0f;
     b_ = ((color >> 16u) & 0xffu) / 255.0f;
@@ -63,7 +63,7 @@ void Color::FromUInt(unsigned color)
     r_ = ((color >> 0u)  & 0xffu) / 255.0f;
 }
 
-void Color::FromUIntMask(unsigned color, const ChannelMask& mask)
+void Color::FromU32(color32 color, const ChannelMask& mask)
 {
     // Channel offset is irrelevant during division, but double should be used to avoid precision loss.
     r_ = !mask.r_ ? 0.0f : static_cast<float>((color & mask.r_) / static_cast<double>(mask.r_));

+ 9 - 7
Source/Urho3D/Math/Color.h

@@ -10,6 +10,8 @@ namespace Urho3D
 
 class String;
 
+using color32 = u32;
+
 /// RGBA color.
 class URHO3D_API Color
 {
@@ -80,7 +82,7 @@ public:
     }
 
     /// Construct from 32-bit integer. Default format is 0xAABBGGRR.
-    explicit Color(unsigned color, const ChannelMask& mask = ABGR) { FromUIntMask(color, mask); }
+    explicit Color(unsigned color, const ChannelMask& mask = ABGR) { FromU32(color, mask); }
 
     /// Construct from 3-vector.
     explicit Color(const Vector3& color) : Color(color.x_, color.y_, color.z_) {}
@@ -123,17 +125,17 @@ public:
     const float* Data() const { return &r_; }
 
     /// Return color packed to a 32-bit integer, with R component in the lowest 8 bits. Components are clamped to [0, 1] range.
-    unsigned ToUInt() const;
+    color32 ToU32() const;
     /// Return color packed to a 32-bit integer with arbitrary channel mask. Components are clamped to [0, 1] range.
-    unsigned ToUIntMask(const ChannelMask& mask) const;
+    color32 ToU32(const ChannelMask& mask) const;
     /// Return HSL color-space representation as a Vector3; the RGB values are clipped before conversion but not changed in the process.
     Vector3 ToHSL() const;
     /// Return HSV color-space representation as a Vector3; the RGB values are clipped before conversion but not changed in the process.
     Vector3 ToHSV() const;
     /// Set RGBA values from packed 32-bit integer, with R component in the lowest 8 bits (format 0xAABBGGRR).
-    void FromUInt(unsigned color);
+    void FromU32(color32 color);
     /// Set RGBA values from packed 32-bit integer with arbitrary channel mask.
-    void FromUIntMask(unsigned color, const ChannelMask& mask);
+    void FromU32(color32 color, const ChannelMask& mask);
     /// Set RGBA values from specified HSL values and alpha.
     void FromHSL(float h, float s, float l, float a = 1.0f);
     /// Set RGBA values from specified HSV values and alpha.
@@ -230,10 +232,10 @@ public:
     String ToString() const;
 
     /// Return color packed to a 32-bit integer, with B component in the lowest 8 bits. Components are clamped to [0, 1] range.
-    unsigned ToUIntArgb() const { return ToUIntMask(ARGB); }
+    color32 ToU32Argb() const { return ToU32(ARGB); }
 
     /// Return hash value for HashSet & HashMap.
-    hash32 ToHash() const { return ToUInt(); }
+    hash32 ToHash() const { return ToU32(); }
 
     /// Red value.
     float r_;

+ 9 - 9
Source/Urho3D/Navigation/CrowdManager.cpp

@@ -265,7 +265,7 @@ void CrowdManager::SetQueryFilterTypesAttr(const VariantVector& value)
 
     unsigned index = 0;
     unsigned queryFilterType = 0;
-    numQueryFilterTypes_ = index < value.Size() ? Min(value[index++].GetUInt(), (unsigned)DT_CROWD_MAX_QUERY_FILTER_TYPE) : 0;
+    numQueryFilterTypes_ = index < value.Size() ? Min(value[index++].GetU32(), (unsigned)DT_CROWD_MAX_QUERY_FILTER_TYPE) : 0;
 
     while (queryFilterType < numQueryFilterTypes_)
     {
@@ -273,10 +273,10 @@ void CrowdManager::SetQueryFilterTypesAttr(const VariantVector& value)
         {
             dtQueryFilter* filter = crowd_->getEditableFilter(queryFilterType);
             assert(filter);
-            filter->setIncludeFlags((unsigned short)value[index++].GetUInt());
-            filter->setExcludeFlags((unsigned short)value[index++].GetUInt());
+            filter->setIncludeFlags((unsigned short)value[index++].GetU32());
+            filter->setExcludeFlags((unsigned short)value[index++].GetU32());
             unsigned prevNumAreas = numAreas_[queryFilterType];
-            numAreas_[queryFilterType] = Min(value[index++].GetUInt(), (unsigned)DT_MAX_AREAS);
+            numAreas_[queryFilterType] = Min(value[index++].GetU32(), (unsigned)DT_MAX_AREAS);
 
             // Must loop through based on previous number of areas, the new area cost (if any) can only be set in the next attribute get/set iteration
             if (index + prevNumAreas <= value.Size())
@@ -334,7 +334,7 @@ void CrowdManager::SetObstacleAvoidanceTypesAttr(const VariantVector& value)
 
     unsigned index = 0;
     unsigned obstacleAvoidanceType = 0;
-    numObstacleAvoidanceTypes_ = index < value.Size() ? Min(value[index++].GetUInt(), (unsigned)DT_CROWD_MAX_OBSTAVOIDANCE_PARAMS) : 0;
+    numObstacleAvoidanceTypes_ = index < value.Size() ? Min(value[index++].GetU32(), (unsigned)DT_CROWD_MAX_OBSTAVOIDANCE_PARAMS) : 0;
 
     while (obstacleAvoidanceType < numObstacleAvoidanceTypes_)
     {
@@ -347,10 +347,10 @@ void CrowdManager::SetObstacleAvoidanceTypesAttr(const VariantVector& value)
             params.weightSide = value[index++].GetFloat();
             params.weightToi = value[index++].GetFloat();
             params.horizTime = value[index++].GetFloat();
-            params.gridSize = (unsigned char)value[index++].GetUInt();
-            params.adaptiveDivs = (unsigned char)value[index++].GetUInt();
-            params.adaptiveRings = (unsigned char)value[index++].GetUInt();
-            params.adaptiveDepth = (unsigned char)value[index++].GetUInt();
+            params.gridSize = (unsigned char)value[index++].GetU32();
+            params.adaptiveDivs = (unsigned char)value[index++].GetU32();
+            params.adaptiveRings = (unsigned char)value[index++].GetU32();
+            params.adaptiveDepth = (unsigned char)value[index++].GetU32();
             crowd_->setObstacleAvoidanceParams(obstacleAvoidanceType, &params);
         }
         ++obstacleAvoidanceType;

+ 2 - 2
Source/Urho3D/Physics/RaycastVehicle.cpp

@@ -186,7 +186,7 @@ void RaycastVehicle::ApplyAttributes()
     Scene* scene = GetScene();
     vehicleData_->Init(scene, hullBody_, IsEnabledEffective(), coordinateSystem_);
     VariantVector& value = loadedWheelData_;
-    int numObjects = value[index++].GetInt();
+    int numObjects = value[index++].GetI32();
     int wheelIndex = 0;
     origRotation_.Clear();
     skidInfoCumulative_.Clear();
@@ -194,7 +194,7 @@ void RaycastVehicle::ApplyAttributes()
 
     for (int i = 0; i < numObjects; i++)
     {
-        int node_id = value[index++].GetInt();
+        int node_id = value[index++].GetI32();
         Vector3 direction = value[index++].GetVector3();
         Vector3 axle = value[index++].GetVector3();
         float restLength = value[index++].GetFloat();

+ 7 - 7
Source/Urho3D/Resource/Image.cpp

@@ -901,12 +901,12 @@ bool Image::SetSize(int width, int height, int depth, unsigned components)
 
 void Image::SetPixel(int x, int y, const Color& color)
 {
-    SetPixelInt(x, y, 0, color.ToUInt());
+    SetPixelInt(x, y, 0, color.ToU32());
 }
 
 void Image::SetPixel(int x, int y, int z, const Color& color)
 {
-    SetPixelInt(x, y, z, color.ToUInt());
+    SetPixelInt(x, y, z, color.ToU32());
 }
 
 void Image::SetPixelInt(int x, int y, unsigned uintColor)
@@ -1164,7 +1164,7 @@ bool Image::Resize(int width, int height)
             // Calculate float coordinates between 0 - 1 for resampling
             float xF = (width_ > 1) ? (float)x / (float)(width - 1) : 0.0f;
             float yF = (height_ > 1) ? (float)y / (float)(height - 1) : 0.0f;
-            unsigned uintColor = GetPixelBilinear(xF, yF).ToUInt();
+            color32 uintColor = GetPixelBilinear(xF, yF).ToU32();
             unsigned char* dest = newData + (y * width + x) * components_;
             auto* src = (unsigned char*)&uintColor;
 
@@ -1195,10 +1195,10 @@ bool Image::Resize(int width, int height)
 
 void Image::Clear(const Color& color)
 {
-    ClearInt(color.ToUInt());
+    Clear(color.ToU32());
 }
 
-void Image::ClearInt(unsigned uintColor)
+void Image::Clear(color32 uintColor)
 {
     URHO3D_PROFILE(ClearImage);
 
@@ -1213,7 +1213,7 @@ void Image::ClearInt(unsigned uintColor)
 
     if (components_ == 4)
     {
-        unsigned color = uintColor;
+        color32 color = uintColor;
         auto* data = (unsigned*)GetData();
         auto* data_end = (unsigned*)(GetData() + width_ * height_ * depth_ * components_);
         for (; data < data_end; ++data)
@@ -2388,7 +2388,7 @@ bool Image::SetSubimage(const Image* image, const IntRect& rect)
                 // Calculate float coordinates between 0 - 1 for resampling
                 const float xF = (image->width_ > 1) ? static_cast<float>(x) / (destWidth - 1) : 0.0f;
                 const float yF = (image->height_ > 1) ? static_cast<float>(y) / (destHeight - 1) : 0.0f;
-                const unsigned uintColor = image->GetPixelBilinear(xF, yF).ToUInt();
+                const color32 uintColor = image->GetPixelBilinear(xF, yF).ToU32();
 
                 memcpy(dest, reinterpret_cast<const unsigned char*>(&uintColor), components_);
 

+ 1 - 1
Source/Urho3D/Resource/Image.h

@@ -104,7 +104,7 @@ public:
     /// Clear the image with a color.
     void Clear(const Color& color);
     /// Clear the image with an integer color. R component is in the 8 lowest bits.
-    void ClearInt(unsigned uintColor);
+    void Clear(color32 uintColor);
     /// Save in BMP format. Return true if successful.
     bool SaveBMP(const String& fileName) const;
     /// Save in PNG format. Return true if successful.

+ 2 - 2
Source/Urho3D/Resource/JSONFile.cpp

@@ -137,11 +137,11 @@ static void ToRapidjsonValue(rapidjson::Value& rapidjsonValue, const JSONValue&
             switch (jsonValue.GetNumberType())
             {
             case JSONNT_INT:
-                rapidjsonValue.SetInt(jsonValue.GetInt());
+                rapidjsonValue.SetInt(jsonValue.GetI32());
                 break;
 
             case JSONNT_UINT:
-                rapidjsonValue.SetUint(jsonValue.GetUInt());
+                rapidjsonValue.SetUint(jsonValue.GetU32());
                 break;
 
             default:

+ 2 - 2
Source/Urho3D/Resource/JSONValue.cpp

@@ -399,7 +399,7 @@ void JSONValue::SetVariantValue(const Variant& variant, Context* context)
         return;
 
     case VAR_INT:
-        *this = variant.GetInt();
+        *this = variant.GetI32();
         return;
 
     case VAR_FLOAT:
@@ -478,7 +478,7 @@ Variant JSONValue::GetVariantValue(VariantType type) const
         break;
 
     case VAR_INT:
-        variant = GetInt();
+        variant = GetI32();
         break;
 
     case VAR_FLOAT:

+ 3 - 3
Source/Urho3D/Resource/JSONValue.h

@@ -194,9 +194,9 @@ public:
     /// Return boolean value.
     bool GetBool(bool defaultValue = false) const { return IsBool() ? boolValue_ : defaultValue;}
     /// Return integer value.
-    int GetInt(int defaultValue = 0) const { return IsNumber() ? (int)numberValue_ : defaultValue; }
+    i32 GetI32(i32 defaultValue = 0) const { return IsNumber() ? (i32)numberValue_ : defaultValue; }
     /// Return unsigned integer value.
-    unsigned GetUInt(unsigned defaultValue = 0) const { return IsNumber() ? (unsigned)numberValue_ : defaultValue; }
+    u32 GetU32(u32 defaultValue = 0) const { return IsNumber() ? (u32)numberValue_ : defaultValue; }
     /// Return float value.
     float GetFloat(float defaultValue = 0.0f) const { return IsNumber() ? (float)numberValue_ : defaultValue; }
     /// Return double value.
@@ -295,7 +295,7 @@ public:
     static JSONNumberType GetNumberTypeFromName(const char* typeName);
 
 private:
-    /// type.
+    /// Type.
     unsigned type_;
 
     // https://github.com/doxygen/doxygen/issues/7623

+ 6 - 6
Source/Urho3D/Resource/PListFile.cpp

@@ -25,10 +25,10 @@ PListValue::PListValue() :                                  // NOLINT(hicpp-memb
 {
 }
 
-PListValue::PListValue(int value) :                         // NOLINT(hicpp-member-init)
+PListValue::PListValue(i32 value) :                         // NOLINT(hicpp-member-init)
     type_(PLVT_NONE)
 {
-    SetInt(value);
+    SetI32(value);
 }
 
 PListValue::PListValue(bool value) :                        // NOLINT(hicpp-member-init)
@@ -80,7 +80,7 @@ PListValue& PListValue::operator =(const PListValue& rhs)
         Reset();
         break;
     case PLVT_INT:
-        SetInt(rhs.int_);
+        SetI32(rhs.int_);
         break;
     case PLVT_BOOL:
         SetBool(rhs.bool_);
@@ -102,7 +102,7 @@ PListValue& PListValue::operator =(const PListValue& rhs)
     return *this;
 }
 
-void PListValue::SetInt(int value)
+void PListValue::SetI32(i32 value)
 {
     if (type_ != PLVT_INT)
     {
@@ -170,7 +170,7 @@ void PListValue::SetValueVector(const PListValueVector& valueVector)
     *valueVector_ = valueVector;
 }
 
-int PListValue::GetInt() const
+i32 PListValue::GetI32() const
 {
     return type_ == PLVT_INT ? int_ : 0;
 }
@@ -371,7 +371,7 @@ bool PListFile::LoadValue(PListValue& value, const XMLElement& valueElem)
     else if (valueType == "real")
         value.SetFloat(ToFloat(valueElem.GetValue()));
     else if (valueType == "integer")
-        value.SetInt(ToI32(valueElem.GetValue()));
+        value.SetI32(ToI32(valueElem.GetValue()));
     else if (valueType == "true")
         value.SetBool(true);
     else if (valueType == "false")

+ 3 - 3
Source/Urho3D/Resource/PListFile.h

@@ -63,7 +63,7 @@ public:
     explicit operator bool() const { return type_ != PLVT_NONE; }
 
     /// Set int.
-    void SetInt(int value);
+    void SetI32(i32 value);
     /// Set boolean.
     void SetBool(bool value);
     /// Set float.
@@ -79,7 +79,7 @@ public:
     PListValueType GetType() const { return type_; }
 
     /// Return int.
-    int GetInt() const;
+    i32 GetI32() const;
     /// Return boolean.
     bool GetBool() const;
     /// Return float.
@@ -111,7 +111,7 @@ private:
     /// Values.
     union
     {
-        int int_;
+        i32 int_;
         bool bool_;
         float float_;
         String* string_;

+ 10 - 10
Source/Urho3D/Resource/XMLElement.cpp

@@ -344,22 +344,22 @@ bool XMLElement::SetDouble(const String& name, double value)
     return SetAttribute(name, String(value));
 }
 
-bool XMLElement::SetUInt(const String& name, unsigned value)
+bool XMLElement::SetU32(const String& name, u32 value)
 {
     return SetAttribute(name, String(value));
 }
 
-bool XMLElement::SetInt(const String& name, int value)
+bool XMLElement::SetI32(const String& name, i32 value)
 {
     return SetAttribute(name, String(value));
 }
 
-bool XMLElement::SetUInt64(const String& name, unsigned long long value)
+bool XMLElement::SetU64(const String& name, u64 value)
 {
     return SetAttribute(name, String(value));
 }
 
-bool XMLElement::SetInt64(const String& name, long long value)
+bool XMLElement::SetI64(const String& name, i64 value)
 {
     return SetAttribute(name, String(value));
 }
@@ -498,7 +498,7 @@ bool XMLElement::SetVariantMap(const VariantMap& value)
         XMLElement variantElem = CreateChild("variant");
         if (!variantElem)
             return false;
-        variantElem.SetUInt("hash", i->first_.Value());
+        variantElem.SetU32("hash", i->first_.Value());
         variantElem.SetVariant(i->second_);
     }
 
@@ -784,22 +784,22 @@ double XMLElement::GetDouble(const String& name) const
     return ToDouble(GetAttribute(name));
 }
 
-unsigned XMLElement::GetUInt(const String& name) const
+u32 XMLElement::GetU32(const String& name) const
 {
     return ToU32(GetAttribute(name));
 }
 
-int XMLElement::GetInt(const String& name) const
+i32 XMLElement::GetI32(const String& name) const
 {
     return ToI32(GetAttribute(name));
 }
 
-unsigned long long XMLElement::GetUInt64(const String& name) const
+u64 XMLElement::GetU64(const String& name) const
 {
     return ToU64(GetAttribute(name));
 }
 
-long long XMLElement::GetInt64(const String& name) const
+i64 XMLElement::GetI64(const String& name) const
 {
     return ToI64(GetAttribute(name));
 }
@@ -924,7 +924,7 @@ VariantMap XMLElement::GetVariantMap() const
         if (variantElem.HasAttribute("name"))
             ret[StringHash(variantElem.GetAttribute("name"))] = variantElem.GetVariant();
         else if (variantElem.HasAttribute("hash"))
-            ret[StringHash(variantElem.GetUInt("hash"))] = variantElem.GetVariant();
+            ret[StringHash(variantElem.GetU32("hash"))] = variantElem.GetVariant();
 
         variantElem = variantElem.GetNext("variant");
     }

+ 8 - 8
Source/Urho3D/Resource/XMLElement.h

@@ -109,13 +109,13 @@ public:
     /// Set a double attribute.
     bool SetDouble(const String& name, double value);
     /// Set an unsigned integer attribute.
-    bool SetUInt(const String& name, unsigned value);
+    bool SetU32(const String& name, u32 value);
     /// Set an integer attribute.
-    bool SetInt(const String& name, int value);
+    bool SetI32(const String& name, i32 value);
     /// Set an unsigned long long integer attribute.
-    bool SetUInt64(const String& name, unsigned long long value);
+    bool SetU64(const String& name, u64 value);
     /// Set a long long integer attribute.
-    bool SetInt64(const String& name, long long value);
+    bool SetI64(const String& name, i64 value);
     /// Set an IntRect attribute.
     bool SetIntRect(const String& name, const IntRect& value);
     /// Set an IntVector2 attribute.
@@ -224,13 +224,13 @@ public:
     /// Return a double attribute, or zero if missing.
     double GetDouble(const String& name) const;
     /// Return an unsigned integer attribute, or zero if missing.
-    unsigned GetUInt(const String& name) const;
+    u32 GetU32(const String& name) const;
     /// Return an integer attribute, or zero if missing.
-    int GetInt(const String& name) const;
+    i32 GetI32(const String& name) const;
     /// Return an unsigned long long integer attribute, or zero if missing.
-    unsigned long long GetUInt64(const String& name) const;
+    u64 GetU64(const String& name) const;
     /// Return a long long integer attribute, or zero if missing.
-    long long GetInt64(const String& name) const;
+    i64 GetI64(const String& name) const;
     /// Return an IntRect attribute, or default if missing.
     IntRect GetIntRect(const String& name) const;
     /// Return an IntVector2 attribute, or default if missing.

+ 1 - 1
Source/Urho3D/Scene/Component.cpp

@@ -56,7 +56,7 @@ bool Component::SaveXML(XMLElement& dest) const
     // Write type and ID
     if (!dest.SetString("type", GetTypeName()))
         return false;
-    if (!dest.SetUInt("id", id_))
+    if (!dest.SetU32("id", id_))
         return false;
 
     // Write attributes

+ 7 - 7
Source/Urho3D/Scene/Node.cpp

@@ -135,7 +135,7 @@ bool Node::LoadXML(const XMLElement& source)
     SceneResolver resolver;
 
     // Read own ID. Will not be applied, only stored for resolving possible references
-    NodeId nodeID = source.GetUInt("id");
+    NodeId nodeID = source.GetU32("id");
     resolver.AddNode(nodeID, this);
 
     // Read attributes, components and child nodes
@@ -154,7 +154,7 @@ bool Node::LoadJSON(const JSONValue& source)
     SceneResolver resolver;
 
     // Read own ID. Will not be applied, only stored for resolving possible references
-    NodeId nodeID = source.Get("id").GetUInt();
+    NodeId nodeID = source.Get("id").GetU32();
     resolver.AddNode(nodeID, this);
 
     // Read attributes, components and child nodes
@@ -171,7 +171,7 @@ bool Node::LoadJSON(const JSONValue& source)
 bool Node::SaveXML(XMLElement& dest) const
 {
     // Write node ID
-    if (!dest.SetUInt("id", id_))
+    if (!dest.SetU32("id", id_))
         return false;
 
     // Write attributes
@@ -1590,7 +1590,7 @@ bool Node::LoadXML(const XMLElement& source, SceneResolver& resolver, bool loadC
     while (compElem)
     {
         String typeName = compElem.GetAttribute("type");
-        ComponentId compID = compElem.GetUInt("id");
+        ComponentId compID = compElem.GetU32("id");
         Component* newComponent = SafeCreateComponent(typeName, StringHash(typeName),
             (mode == REPLICATED && Scene::IsReplicatedID(compID)) ? REPLICATED : LOCAL, rewriteIDs ? 0 : compID);
         if (newComponent)
@@ -1609,7 +1609,7 @@ bool Node::LoadXML(const XMLElement& source, SceneResolver& resolver, bool loadC
     XMLElement childElem = source.GetChild("node");
     while (childElem)
     {
-        NodeId nodeID = childElem.GetUInt("id");
+        NodeId nodeID = childElem.GetU32("id");
         Node* newNode = CreateChild(rewriteIDs ? 0 : nodeID, (mode == REPLICATED && Scene::IsReplicatedID(nodeID)) ? REPLICATED :
             LOCAL);
         resolver.AddNode(nodeID, newNode);
@@ -1637,7 +1637,7 @@ bool Node::LoadJSON(const JSONValue& source, SceneResolver& resolver, bool loadC
     {
         const JSONValue& compVal = componentsArray.At(i);
         String typeName = compVal.Get("type").GetString();
-        ComponentId compID = compVal.Get("id").GetUInt();
+        ComponentId compID = compVal.Get("id").GetU32();
         Component* newComponent = SafeCreateComponent(typeName, StringHash(typeName),
             (mode == REPLICATED && Scene::IsReplicatedID(compID)) ? REPLICATED : LOCAL, rewriteIDs ? 0 : compID);
         if (newComponent)
@@ -1656,7 +1656,7 @@ bool Node::LoadJSON(const JSONValue& source, SceneResolver& resolver, bool loadC
     {
         const JSONValue& childVal = childrenArray.At(i);
 
-        NodeId nodeID = childVal.Get("id").GetUInt();
+        NodeId nodeID = childVal.Get("id").GetU32();
         Node* newNode = CreateChild(rewriteIDs ? 0 : nodeID, (mode == REPLICATED && Scene::IsReplicatedID(nodeID)) ? REPLICATED :
             LOCAL);
         resolver.AddNode(nodeID, newNode);

+ 6 - 6
Source/Urho3D/Scene/Scene.cpp

@@ -400,7 +400,7 @@ bool Scene::LoadAsyncXML(File* file, LoadMode mode)
         }
 
         // Store own old ID for resolving possible root node references
-        NodeId nodeID = rootElement.GetUInt("id");
+        NodeId nodeID = rootElement.GetU32("id");
         resolver_.AddNode(nodeID, this);
 
         // Load the root level components first
@@ -469,7 +469,7 @@ bool Scene::LoadAsyncJSON(File* file, LoadMode mode)
         }
 
         // Store own old ID for resolving possible root node references
-        NodeId nodeID = rootVal.Get("id").GetUInt();
+        NodeId nodeID = rootVal.Get("id").GetU32();
         resolver_.AddNode(nodeID, this);
 
         // Load the root level components first
@@ -534,7 +534,7 @@ Node* Scene::InstantiateXML(const XMLElement& source, const Vector3& position, c
     URHO3D_PROFILE(InstantiateXML);
 
     SceneResolver resolver;
-    NodeId nodeID = source.GetUInt("id");
+    NodeId nodeID = source.GetU32("id");
     // Rewrite IDs when instantiating
     Node* node = CreateChild(0, mode);
     resolver.AddNode(nodeID, node);
@@ -557,7 +557,7 @@ Node* Scene::InstantiateJSON(const JSONValue& source, const Vector3& position, c
     URHO3D_PROFILE(InstantiateJSON);
 
     SceneResolver resolver;
-    NodeId nodeID = source.Get("id").GetUInt();
+    NodeId nodeID = source.Get("id").GetU32();
     // Rewrite IDs when instantiating
     Node* node = CreateChild(0, mode);
     resolver.AddNode(nodeID, node);
@@ -1189,7 +1189,7 @@ void Scene::UpdateAsyncLoading()
         /// \todo Works poorly in scenes where one root-level child node contains all content
         if (asyncProgress_.xmlFile_)
         {
-            NodeId nodeID = asyncProgress_.xmlElement_.GetUInt("id");
+            NodeId nodeID = asyncProgress_.xmlElement_.GetU32("id");
             Node* newNode = CreateChild(nodeID, IsReplicatedID(nodeID) ? REPLICATED : LOCAL);
             resolver_.AddNode(nodeID, newNode);
             newNode->LoadXML(asyncProgress_.xmlElement_, resolver_);
@@ -1199,7 +1199,7 @@ void Scene::UpdateAsyncLoading()
         {
             const JSONValue& childValue = asyncProgress_.jsonFile_->GetRoot().Get("children").GetArray().At(asyncProgress_.jsonIndex_);
 
-            NodeId nodeID = childValue.Get("id").GetUInt();
+            NodeId nodeID = childValue.Get("id").GetU32();
             Node* newNode = CreateChild(nodeID, IsReplicatedID(nodeID) ? REPLICATED : LOCAL);
             resolver_.AddNode(nodeID, newNode);
             newNode->LoadJSON(childValue, resolver_);

+ 4 - 4
Source/Urho3D/Scene/SceneResolver.cpp

@@ -59,7 +59,7 @@ void SceneResolver::Resolve()
             if (info.mode_ & AM_NODEID)
             {
                 hasIDAttributes = true;
-                NodeId oldNodeID = component->GetAttribute(j).GetUInt();
+                NodeId oldNodeID = component->GetAttribute(j).GetU32();
 
                 if (oldNodeID)
                 {
@@ -77,7 +77,7 @@ void SceneResolver::Resolve()
             else if (info.mode_ & AM_COMPONENTID)
             {
                 hasIDAttributes = true;
-                ComponentId oldComponentID = component->GetAttribute(j).GetUInt();
+                ComponentId oldComponentID = component->GetAttribute(j).GetU32();
 
                 if (oldComponentID)
                 {
@@ -101,13 +101,13 @@ void SceneResolver::Resolve()
                 if (oldNodeIDs.Size())
                 {
                     // The first index stores the number of IDs redundantly. This is for editing
-                    unsigned numIDs = oldNodeIDs[0].GetUInt();
+                    unsigned numIDs = oldNodeIDs[0].GetU32();
                     VariantVector newIDs;
                     newIDs.Push(numIDs);
 
                     for (unsigned k = 1; k < oldNodeIDs.Size(); ++k)
                     {
-                        NodeId oldNodeID = oldNodeIDs[k].GetUInt();
+                        NodeId oldNodeID = oldNodeIDs[k].GetU32();
                         HashMap<NodeId, WeakPtr<Node>>::ConstIterator l = nodes_.Find(oldNodeID);
 
                         if (l != nodes_.End() && l->second_)

+ 5 - 5
Source/Urho3D/Scene/Serializable.cpp

@@ -67,13 +67,13 @@ void Serializable::OnSetAttribute(const AttributeInfo& attr, const Variant& src)
     case VAR_INT:
         // If enum type, use the low 8 bits only
         if (attr.enumNames_)
-            *(reinterpret_cast<unsigned char*>(dest)) = src.GetInt();
+            *(reinterpret_cast<unsigned char*>(dest)) = src.GetI32();
         else
-            *(reinterpret_cast<int*>(dest)) = src.GetInt();
+            *(reinterpret_cast<int*>(dest)) = src.GetI32();
         break;
 
     case VAR_INT64:
-        *(reinterpret_cast<long long*>(dest)) = src.GetInt64();
+        *(reinterpret_cast<long long*>(dest)) = src.GetI64();
         break;
 
     case VAR_BOOL:
@@ -519,7 +519,7 @@ bool Serializable::SaveXML(XMLElement& dest) const
         // If enums specified, set as an enum string. Otherwise set directly as a Variant
         if (attr.enumNames_)
         {
-            int enumValue = value.GetInt();
+            int enumValue = value.GetI32();
             attrElem.SetAttribute("value", attr.enumNames_[enumValue]);
         }
         else
@@ -555,7 +555,7 @@ bool Serializable::SaveJSON(JSONValue& dest) const
         // If enums specified, set as an enum string. Otherwise set directly as a Variant
         if (attr.enumNames_)
         {
-            int enumValue = value.GetInt();
+            int enumValue = value.GetI32();
             attrVal = attr.enumNames_[enumValue];
         }
         else

+ 3 - 3
Source/Urho3D/Scene/SplinePath.cpp

@@ -72,7 +72,7 @@ void SplinePath::ApplyAttributes()
         // The first index stores the number of IDs redundantly. This is for editing
         for (unsigned i = 1; i < controlPointIdsAttr_.Size(); ++i)
         {
-            Node* node = scene->GetNode(controlPointIdsAttr_[i].GetUInt());
+            Node* node = scene->GetNode(controlPointIdsAttr_[i].GetU32());
             if (node)
             {
                 WeakPtr<Node> controlPoint(node);
@@ -229,7 +229,7 @@ void SplinePath::SetControlPointIdsAttr(const VariantVector& value)
         controlPointIdsAttr_.Clear();
 
         unsigned index = 0;
-        unsigned numInstances = value[index++].GetUInt();
+        unsigned numInstances = value[index++].GetU32();
         // Prevent crash on entering negative value in the editor
         if (numInstances > M_MAX_INT)
             numInstances = 0;
@@ -239,7 +239,7 @@ void SplinePath::SetControlPointIdsAttr(const VariantVector& value)
         {
             // If vector contains less IDs than should, fill the rest with zeros
             if (index < value.Size())
-                controlPointIdsAttr_.Push(value[index++].GetUInt());
+                controlPointIdsAttr_.Push(value[index++].GetU32());
             else
                 controlPointIdsAttr_.Push(0);
         }

+ 1 - 1
Source/Urho3D/Scene/UnknownComponent.cpp

@@ -184,7 +184,7 @@ bool UnknownComponent::SaveXML(XMLElement& dest) const
     // Write type and ID
     if (!dest.SetString("type", GetTypeName()))
         return false;
-    if (!dest.SetInt("id", id_))
+    if (!dest.SetI32("id", id_))
         return false;
 
     for (unsigned i = 0; i < xmlAttributeInfos_.Size(); ++i)

+ 3 - 3
Source/Urho3D/Scene/ValueAnimation.cpp

@@ -93,7 +93,7 @@ bool ValueAnimation::LoadXML(const XMLElement& source)
     while (eventFrameElem)
     {
         float time = eventFrameElem.GetFloat("time");
-        unsigned eventType = eventFrameElem.GetUInt("eventtype");
+        unsigned eventType = eventFrameElem.GetU32("eventtype");
         VariantMap eventData = eventFrameElem.GetChild("eventdata").GetVariantMap();
 
         SetEventFrame(time, StringHash(eventType), eventData);
@@ -120,7 +120,7 @@ bool ValueAnimation::SaveXML(XMLElement& dest) const
     {
         XMLElement eventFrameElem = dest.CreateChild("eventframe");
         eventFrameElem.SetFloat("time", eventFrame.time_);
-        eventFrameElem.SetUInt("eventtype", eventFrame.eventType_.Value());
+        eventFrameElem.SetU32("eventtype", eventFrame.eventType_.Value());
         eventFrameElem.CreateChild("eventdata").SetVariantMap(eventFrame.eventData_);
     }
 
@@ -153,7 +153,7 @@ bool ValueAnimation::LoadJSON(const JSONValue& source)
     for (const JSONValue& eventFrameVal : eventFramesArray)
     {
         float time = eventFrameVal.Get("time").GetFloat();
-        unsigned eventType = eventFrameVal.Get("eventtype").GetUInt();
+        unsigned eventType = eventFrameVal.Get("eventtype").GetU32();
         VariantMap eventData = eventFrameVal.Get("eventdata").GetVariantMap();
         SetEventFrame(time, StringHash(eventType), eventData);
     }

+ 1 - 1
Source/Urho3D/UI/DropDownList.cpp

@@ -318,7 +318,7 @@ void DropDownList::HandleListViewKey(StringHash eventType, VariantMap& eventData
     using namespace UnhandledKey;
 
     // If enter pressed in the list view, close and propagate selection
-    int key = eventData[P_KEY].GetInt();
+    int key = eventData[P_KEY].GetI32();
     if (key == KEY_RETURN || key == KEY_RETURN2 || key == KEY_KP_ENTER)
         HandleItemClicked(eventType, eventData);
 }

+ 1 - 1
Source/Urho3D/UI/FileSelector.cpp

@@ -410,7 +410,7 @@ void FileSelector::HandleFileListKey(StringHash eventType, VariantMap& eventData
 
     using namespace UnhandledKey;
 
-    int key = eventData[P_KEY].GetInt();
+    int key = eventData[P_KEY].GetI32();
     if (key == KEY_RETURN || key == KEY_RETURN2 || key == KEY_KP_ENTER)
     {
         bool entered = EnterFile();

+ 2 - 2
Source/Urho3D/UI/Font.cpp

@@ -186,8 +186,8 @@ void Font::LoadParameters()
 
     if (absoluteElem)
     {
-        absoluteOffset_.x_ = absoluteElem.GetInt("x");
-        absoluteOffset_.y_ = absoluteElem.GetInt("y");
+        absoluteOffset_.x_ = absoluteElem.GetI32("x");
+        absoluteOffset_.y_ = absoluteElem.GetI32("y");
     }
 
     XMLElement scaledElem = rootElem.GetChild("scaledoffset");

+ 32 - 32
Source/Urho3D/UI/FontFaceBitmap.cpp

@@ -57,11 +57,11 @@ bool FontFaceBitmap::Load(const unsigned char* fontData, unsigned fontDataSize,
 
     XMLElement infoElem = root.GetChild("info");
     if (!infoElem.IsNull())
-        pointSize_ = infoElem.GetInt("size");
+        pointSize_ = infoElem.GetI32("size");
 
     XMLElement commonElem = root.GetChild("common");
-    rowHeight_ = commonElem.GetInt("lineHeight");
-    unsigned pages = commonElem.GetUInt("pages");
+    rowHeight_ = commonElem.GetI32("lineHeight");
+    unsigned pages = commonElem.GetU32("pages");
     textures_.Reserve(pages);
 
     auto* resourceCache = font_->GetSubsystem<ResourceCache>();
@@ -104,22 +104,22 @@ bool FontFaceBitmap::Load(const unsigned char* fontData, unsigned fontDataSize,
     }
 
     XMLElement charsElem = root.GetChild("chars");
-    int count = charsElem.GetInt("count");
+    int count = charsElem.GetI32("count");
 
     XMLElement charElem = charsElem.GetChild("char");
     while (!charElem.IsNull())
     {
-        int id = charElem.GetInt("id");
+        int id = charElem.GetI32("id");
 
         FontGlyph glyph;
-        glyph.x_ = (short)charElem.GetInt("x");
-        glyph.y_ = (short)charElem.GetInt("y");
-        glyph.width_ = glyph.texWidth_ = (short)charElem.GetInt("width");
-        glyph.height_ = glyph.texHeight_ = (short)charElem.GetInt("height");
-        glyph.offsetX_ = (short)charElem.GetInt("xoffset");
-        glyph.offsetY_ = (short)charElem.GetInt("yoffset");
-        glyph.advanceX_ = (short)charElem.GetInt("xadvance");
-        glyph.page_ = charElem.GetInt("page");
+        glyph.x_ = (short)charElem.GetI32("x");
+        glyph.y_ = (short)charElem.GetI32("y");
+        glyph.width_ = glyph.texWidth_ = (short)charElem.GetI32("width");
+        glyph.height_ = glyph.texHeight_ = (short)charElem.GetI32("height");
+        glyph.offsetX_ = (short)charElem.GetI32("xoffset");
+        glyph.offsetY_ = (short)charElem.GetI32("yoffset");
+        glyph.advanceX_ = (short)charElem.GetI32("xadvance");
+        glyph.page_ = charElem.GetI32("page");
         assert(glyph.page_ >= 0);
 
         glyphMapping_[id] = glyph;
@@ -133,10 +133,10 @@ bool FontFaceBitmap::Load(const unsigned char* fontData, unsigned fontDataSize,
         XMLElement kerningElem = kerningsElem.GetChild("kerning");
         while (!kerningElem.IsNull())
         {
-            unsigned first = kerningElem.GetInt("first");
-            unsigned second = kerningElem.GetInt("second");
+            unsigned first = kerningElem.GetI32("first");
+            unsigned second = kerningElem.GetI32("second");
             unsigned value = first << 16u | second;
-            kerningMapping_[value] = (short)kerningElem.GetInt("amount");
+            kerningMapping_[value] = (short)kerningElem.GetI32("amount");
 
             kerningElem = kerningElem.GetNext("kerning");
         }
@@ -259,9 +259,9 @@ bool FontFaceBitmap::Save(Serializer& dest, int pointSize, const String& indenta
 
     // Common
     childElem = rootElem.CreateChild("common");
-    childElem.SetInt("lineHeight", rowHeight_);
+    childElem.SetI32("lineHeight", rowHeight_);
     unsigned pages = textures_.Size();
-    childElem.SetUInt("pages", pages);
+    childElem.SetU32("pages", pages);
 
     // Construct the path to store the texture
     String pathName;
@@ -278,7 +278,7 @@ bool FontFaceBitmap::Save(Serializer& dest, int pointSize, const String& indenta
     for (unsigned i = 0; i < pages; ++i)
     {
         XMLElement pageElem = childElem.CreateChild("page");
-        pageElem.SetInt("id", i);
+        pageElem.SetI32("id", i);
         String texFileName = fileName + "_" + String(i) + ".png";
         pageElem.SetAttribute("file", texFileName);
 
@@ -289,23 +289,23 @@ bool FontFaceBitmap::Save(Serializer& dest, int pointSize, const String& indenta
     // Chars and kernings
     XMLElement charsElem = rootElem.CreateChild("chars");
     unsigned numGlyphs = glyphMapping_.Size();
-    charsElem.SetInt("count", numGlyphs);
+    charsElem.SetI32("count", numGlyphs);
 
     for (HashMap<c32, FontGlyph>::ConstIterator i = glyphMapping_.Begin(); i != glyphMapping_.End(); ++i)
     {
         // Char
         XMLElement charElem = charsElem.CreateChild("char");
-        charElem.SetInt("id", i->first_);
+        charElem.SetI32("id", i->first_);
 
         const FontGlyph& glyph = i->second_;
-        charElem.SetInt("x", glyph.x_);
-        charElem.SetInt("y", glyph.y_);
-        charElem.SetInt("width", glyph.width_);
-        charElem.SetInt("height", glyph.height_);
-        charElem.SetInt("xoffset", glyph.offsetX_);
-        charElem.SetInt("yoffset", glyph.offsetY_);
-        charElem.SetInt("xadvance", glyph.advanceX_);
-        charElem.SetInt("page", glyph.page_);
+        charElem.SetI32("x", glyph.x_);
+        charElem.SetI32("y", glyph.y_);
+        charElem.SetI32("width", glyph.width_);
+        charElem.SetI32("height", glyph.height_);
+        charElem.SetI32("xoffset", glyph.offsetX_);
+        charElem.SetI32("yoffset", glyph.offsetY_);
+        charElem.SetI32("xadvance", glyph.advanceX_);
+        charElem.SetI32("page", glyph.page_);
     }
 
     if (!kerningMapping_.Empty())
@@ -314,9 +314,9 @@ bool FontFaceBitmap::Save(Serializer& dest, int pointSize, const String& indenta
         for (HashMap<u32, float>::ConstIterator i = kerningMapping_.Begin(); i != kerningMapping_.End(); ++i)
         {
             XMLElement kerningElem = kerningsElem.CreateChild("kerning");
-            kerningElem.SetInt("first", i->first_ >> 16u);
-            kerningElem.SetInt("second", i->first_ & 0xffffu);
-            kerningElem.SetInt("amount", i->second_);
+            kerningElem.SetI32("first", i->first_ >> 16u);
+            kerningElem.SetI32("second", i->first_ & 0xffffu);
+            kerningElem.SetI32("amount", i->second_);
         }
     }
 

+ 8 - 8
Source/Urho3D/UI/ListView.cpp

@@ -96,8 +96,8 @@ public:
     {
         using namespace ViewChanged;
 
-        int x = eventData[P_X].GetInt();
-        int y = eventData[P_Y].GetInt();
+        int x = eventData[P_X].GetI32();
+        int y = eventData[P_Y].GetI32();
 
         IntRect panelBorder = GetParent()->GetClipBorder();
         overlayContainer_->SetChildOffset(IntVector2(-x + panelBorder.left_, -y + panelBorder.top_));
@@ -1028,9 +1028,9 @@ void ListView::HandleUIMouseClick(StringHash eventType, VariantMap& eventData)
     if (selectOnClickEnd_ && GetSubsystem<UI>()->IsDragging())
         return;
 
-    int button = eventData[UIMouseClick::P_BUTTON].GetInt();
-    int buttons = eventData[UIMouseClick::P_BUTTONS].GetInt();
-    int qualifiers = eventData[UIMouseClick::P_QUALIFIERS].GetInt();
+    int button = eventData[UIMouseClick::P_BUTTON].GetI32();
+    int buttons = eventData[UIMouseClick::P_BUTTONS].GetI32();
+    int qualifiers = eventData[UIMouseClick::P_QUALIFIERS].GetI32();
 
     auto* element = static_cast<UIElement*>(eventData[UIMouseClick::P_ELEMENT].GetPtr());
 
@@ -1113,9 +1113,9 @@ void ListView::HandleUIMouseClick(StringHash eventType, VariantMap& eventData)
 
 void ListView::HandleUIMouseDoubleClick(StringHash eventType, VariantMap& eventData)
 {
-    int button = eventData[UIMouseClick::P_BUTTON].GetInt();
-    int buttons = eventData[UIMouseClick::P_BUTTONS].GetInt();
-    int qualifiers = eventData[UIMouseClick::P_QUALIFIERS].GetInt();
+    int button = eventData[UIMouseClick::P_BUTTON].GetI32();
+    int buttons = eventData[UIMouseClick::P_BUTTONS].GetI32();
+    int qualifiers = eventData[UIMouseClick::P_QUALIFIERS].GetI32();
 
     auto* element = static_cast<UIElement*>(eventData[UIMouseClick::P_ELEMENT].GetPtr());
     // Check if the clicked element belongs to the list

+ 3 - 3
Source/Urho3D/UI/Menu.cpp

@@ -149,7 +149,7 @@ bool Menu::LoadXML(const XMLElement& source, XMLFile* styleFile)
         String typeName = childElem.GetAttribute("type");
         if (typeName.Empty())
             typeName = "UIElement";
-        i32 index = childElem.HasAttribute("index") ? childElem.GetInt("index") : ENDPOS;
+        i32 index = childElem.HasAttribute("index") ? childElem.GetI32("index") : ENDPOS;
         UIElement* child = nullptr;
 
         if (!internalElem)
@@ -408,8 +408,8 @@ void Menu::HandleKeyDown(StringHash eventType, VariantMap& eventData)
     using namespace KeyDown;
 
     // Activate if accelerator key pressed
-    if (eventData[P_KEY].GetInt() == acceleratorKey_ &&
-        (acceleratorQualifiers_ == QUAL_ANY || eventData[P_QUALIFIERS].GetInt() == acceleratorQualifiers_) &&
+    if (eventData[P_KEY].GetI32() == acceleratorKey_ &&
+        (acceleratorQualifiers_ == QUAL_ANY || eventData[P_QUALIFIERS].GetI32() == acceleratorQualifiers_) &&
         eventData[P_REPEAT].GetBool() == false)
     {
         // Ignore if UI has modal element or focused LineEdit

+ 3 - 3
Source/Urho3D/UI/ScrollBar.cpp

@@ -278,7 +278,7 @@ void ScrollBar::HandleSliderPaged(StringHash eventType, VariantMap& eventData)
     using namespace SliderPaged;
 
     // Synthesize hover event to the forward/back buttons
-    if (eventData[P_OFFSET].GetInt() < 0)
+    if (eventData[P_OFFSET].GetI32() < 0)
         backButton_->OnHover(IntVector2::ZERO, backButton_->ElementToScreen(IntVector2::ZERO), MOUSEB_NONE, QUAL_NONE, nullptr);
     else
         forwardButton_->OnHover(IntVector2::ZERO, forwardButton_->ElementToScreen(IntVector2::ZERO), MOUSEB_NONE, QUAL_NONE, nullptr);
@@ -286,7 +286,7 @@ void ScrollBar::HandleSliderPaged(StringHash eventType, VariantMap& eventData)
     // Synthesize click / release events to the buttons
     if (eventData[P_PRESSED].GetBool())
     {
-        if (eventData[P_OFFSET].GetInt() < 0)
+        if (eventData[P_OFFSET].GetI32() < 0)
             backButton_->OnClickBegin(IntVector2::ZERO, backButton_->ElementToScreen(IntVector2::ZERO),
                 MOUSEB_LEFT, MOUSEB_LEFT, QUAL_NONE, nullptr);
         else
@@ -295,7 +295,7 @@ void ScrollBar::HandleSliderPaged(StringHash eventType, VariantMap& eventData)
     }
     else
     {
-        if (eventData[P_OFFSET].GetInt() < 0)
+        if (eventData[P_OFFSET].GetI32() < 0)
             backButton_->OnClickEnd(IntVector2::ZERO, backButton_->ElementToScreen(IntVector2::ZERO),
                 MOUSEB_LEFT, MOUSEB_NONE, QUAL_NONE, nullptr, backButton_);
         else

+ 4 - 4
Source/Urho3D/UI/ScrollView.cpp

@@ -536,8 +536,8 @@ void ScrollView::HandleTouchMove(StringHash eventType, VariantMap& eventData)
     {
         scrollTouchDown_ = true;
         // Take new scrolling speed if it's faster than the current accumulated value
-        auto dX = (float)-eventData[P_DX].GetInt();
-        auto dY = (float)-eventData[P_DY].GetInt();
+        auto dX = (float)-eventData[P_DX].GetI32();
+        auto dY = (float)-eventData[P_DY].GetI32();
 
         if (Abs(dX) > Abs(touchScrollSpeed_.x_))
             touchScrollSpeed_.x_ = dX;
@@ -560,8 +560,8 @@ void ScrollView::HandleTouchMove(StringHash eventType, VariantMap& eventData)
     }
     else if (eventType == E_TOUCHBEGIN)
     {
-        int X = eventData[P_X].GetInt();
-        int Y = eventData[P_Y].GetInt();
+        int X = eventData[P_X].GetI32();
+        int Y = eventData[P_Y].GetI32();
         IntVector2 pos = IntVector2(X, Y);
 
         // Prevent conflict between touch scroll and scrollbar scroll

+ 25 - 25
Source/Urho3D/UI/UI.cpp

@@ -262,7 +262,7 @@ bool UI::SetModalElement(UIElement* modalElement, bool enable)
 
         // Revert back to original parent
         modalElement->SetParent(static_cast<UIElement*>(modalElement->GetVar(VAR_ORIGINAL_PARENT).GetPtr()),
-            modalElement->GetVar(VAR_ORIGINAL_CHILD_INDEX).GetUInt());
+            modalElement->GetVar(VAR_ORIGINAL_CHILD_INDEX).GetU32());
         auto& vars = const_cast<VariantMap&>(modalElement->GetVars());
         vars.Erase(VAR_ORIGINAL_PARENT);
         vars.Erase(VAR_ORIGINAL_CHILD_INDEX);
@@ -276,7 +276,7 @@ bool UI::SetModalElement(UIElement* modalElement, bool enable)
             {
                 const_cast<VariantMap&>(originElement->GetVars()).Erase(VAR_PARENT_CHANGED);
                 element->SetParent(static_cast<UIElement*>(element->GetVar(VAR_ORIGINAL_PARENT).GetPtr()),
-                    element->GetVar(VAR_ORIGINAL_CHILD_INDEX).GetUInt());
+                    element->GetVar(VAR_ORIGINAL_CHILD_INDEX).GetU32());
                 vars = const_cast<VariantMap&>(element->GetVars());
                 vars.Erase(VAR_ORIGINAL_PARENT);
                 vars.Erase(VAR_ORIGINAL_CHILD_INDEX);
@@ -1738,8 +1738,8 @@ void UI::HandleMouseButtonDown(StringHash eventType, VariantMap& eventData)
 {
     using namespace MouseButtonDown;
 
-    mouseButtons_ = MouseButtonFlags(eventData[P_BUTTONS].GetUInt());
-    qualifiers_ = QualifierFlags(eventData[P_QUALIFIERS].GetUInt());
+    mouseButtons_ = MouseButtonFlags(eventData[P_BUTTONS].GetU32());
+    qualifiers_ = QualifierFlags(eventData[P_QUALIFIERS].GetU32());
     usingTouchInput_ = false;
 
     IntVector2 cursorPos;
@@ -1752,37 +1752,37 @@ void UI::HandleMouseButtonDown(StringHash eventType, VariantMap& eventData)
     auto* input = GetSubsystem<Input>();
 
     if (!input->IsMouseGrabbed())
-        ProcessClickBegin(cursorPos, MouseButton(eventData[P_BUTTON].GetUInt()), mouseButtons_, qualifiers_, cursor_, cursorVisible);
+        ProcessClickBegin(cursorPos, MouseButton(eventData[P_BUTTON].GetU32()), mouseButtons_, qualifiers_, cursor_, cursorVisible);
 }
 
 void UI::HandleMouseButtonUp(StringHash eventType, VariantMap& eventData)
 {
     using namespace MouseButtonUp;
 
-    mouseButtons_ = MouseButtonFlags(eventData[P_BUTTONS].GetUInt());
-    qualifiers_ = QualifierFlags(eventData[P_QUALIFIERS].GetUInt());
+    mouseButtons_ = MouseButtonFlags(eventData[P_BUTTONS].GetU32());
+    qualifiers_ = QualifierFlags(eventData[P_QUALIFIERS].GetU32());
 
     IntVector2 cursorPos;
     bool cursorVisible;
     GetCursorPositionAndVisible(cursorPos, cursorVisible);
 
-    ProcessClickEnd(cursorPos, (MouseButton)eventData[P_BUTTON].GetUInt(), mouseButtons_, qualifiers_, cursor_, cursorVisible);
+    ProcessClickEnd(cursorPos, (MouseButton)eventData[P_BUTTON].GetU32(), mouseButtons_, qualifiers_, cursor_, cursorVisible);
 }
 
 void UI::HandleMouseMove(StringHash eventType, VariantMap& eventData)
 {
     using namespace MouseMove;
 
-    mouseButtons_ = MouseButtonFlags(eventData[P_BUTTONS].GetUInt());
-    qualifiers_ = QualifierFlags(eventData[P_QUALIFIERS].GetUInt());
+    mouseButtons_ = MouseButtonFlags(eventData[P_BUTTONS].GetU32());
+    qualifiers_ = QualifierFlags(eventData[P_QUALIFIERS].GetU32());
     usingTouchInput_ = false;
 
     auto* input = GetSubsystem<Input>();
     const IntVector2& rootSize = rootElement_->GetSize();
     const IntVector2& rootPos = rootElement_->GetPosition();
 
-    const IntVector2 mouseDeltaPos{ eventData[P_DX].GetInt(), eventData[P_DY].GetInt() };
-    const IntVector2 mousePos{ eventData[P_X].GetInt(), eventData[P_Y].GetInt() };
+    const IntVector2 mouseDeltaPos{ eventData[P_DX].GetI32(), eventData[P_DY].GetI32() };
+    const IntVector2 mousePos{ eventData[P_X].GetI32(), eventData[P_Y].GetI32() };
 
     if (cursor_)
     {
@@ -1822,9 +1822,9 @@ void UI::HandleMouseWheel(StringHash eventType, VariantMap& eventData)
 
     using namespace MouseWheel;
 
-    mouseButtons_ = MouseButtonFlags(eventData[P_BUTTONS].GetInt());
-    qualifiers_ = QualifierFlags(eventData[P_QUALIFIERS].GetInt());
-    int delta = eventData[P_WHEEL].GetInt();
+    mouseButtons_ = MouseButtonFlags(eventData[P_BUTTONS].GetI32());
+    qualifiers_ = QualifierFlags(eventData[P_QUALIFIERS].GetI32());
+    int delta = eventData[P_WHEEL].GetI32();
     usingTouchInput_ = false;
 
     IntVector2 cursorPos;
@@ -1866,11 +1866,11 @@ void UI::HandleTouchBegin(StringHash eventType, VariantMap& eventData)
 
     using namespace TouchBegin;
 
-    IntVector2 pos(eventData[P_X].GetInt(), eventData[P_Y].GetInt());
+    IntVector2 pos(eventData[P_X].GetI32(), eventData[P_Y].GetI32());
     pos = ConvertSystemToUI(pos);
     usingTouchInput_ = true;
 
-    const MouseButton touchId = MakeTouchIDMask(eventData[P_TOUCHID].GetInt());
+    const MouseButton touchId = MakeTouchIDMask(eventData[P_TOUCHID].GetI32());
     WeakPtr<UIElement> element(GetElementAt(pos));
 
     if (element)
@@ -1886,11 +1886,11 @@ void UI::HandleTouchEnd(StringHash eventType, VariantMap& eventData)
 {
     using namespace TouchEnd;
 
-    IntVector2 pos(eventData[P_X].GetInt(), eventData[P_Y].GetInt());
+    IntVector2 pos(eventData[P_X].GetI32(), eventData[P_Y].GetI32());
     pos = ConvertSystemToUI(pos);
 
     // Get the touch index
-    const MouseButton touchId = MakeTouchIDMask(eventData[P_TOUCHID].GetInt());
+    const MouseButton touchId = MakeTouchIDMask(eventData[P_TOUCHID].GetI32());
 
     // Transmit hover end to the position where the finger was lifted
     WeakPtr<UIElement> element(GetElementAt(pos));
@@ -1915,13 +1915,13 @@ void UI::HandleTouchMove(StringHash eventType, VariantMap& eventData)
 {
     using namespace TouchMove;
 
-    IntVector2 pos(eventData[P_X].GetInt(), eventData[P_Y].GetInt());
-    IntVector2 deltaPos(eventData[P_DX].GetInt(), eventData[P_DY].GetInt());
+    IntVector2 pos(eventData[P_X].GetI32(), eventData[P_Y].GetI32());
+    IntVector2 deltaPos(eventData[P_DX].GetI32(), eventData[P_DY].GetI32());
     pos = ConvertSystemToUI(pos);
     deltaPos = ConvertSystemToUI(deltaPos);
     usingTouchInput_ = true;
 
-    const MouseButton touchId = MakeTouchIDMask(eventData[P_TOUCHID].GetInt());
+    const MouseButton touchId = MakeTouchIDMask(eventData[P_TOUCHID].GetI32());
 
     ProcessMove(pos, deltaPos, touchId, QUAL_NONE, nullptr, true);
 }
@@ -1930,9 +1930,9 @@ void UI::HandleKeyDown(StringHash eventType, VariantMap& eventData)
 {
     using namespace KeyDown;
 
-    mouseButtons_ = MouseButtonFlags(eventData[P_BUTTONS].GetUInt());
-    qualifiers_ = QualifierFlags(eventData[P_QUALIFIERS].GetUInt());
-    auto key = (Key)eventData[P_KEY].GetUInt();
+    mouseButtons_ = MouseButtonFlags(eventData[P_BUTTONS].GetU32());
+    qualifiers_ = QualifierFlags(eventData[P_QUALIFIERS].GetU32());
+    auto key = (Key)eventData[P_KEY].GetU32();
 
     // Cancel UI dragging
     if (key == KEY_ESCAPE && dragElementsCount_ > 0)

+ 14 - 14
Source/Urho3D/UI/UIBatch.cpp

@@ -37,14 +37,14 @@ void UIBatch::SetColor(const Color& color, bool overrideAlpha)
 
     useGradient_ = false;
     color_ =
-        overrideAlpha ? color.ToUInt() : Color(color.r_, color.g_, color.b_, color.a_ * element_->GetDerivedOpacity()).ToUInt();
+        overrideAlpha ? color.ToU32() : Color(color.r_, color.g_, color.b_, color.a_ * element_->GetDerivedOpacity()).ToU32();
 }
 
 void UIBatch::SetDefaultColor()
 {
     if (element_)
     {
-        color_ = element_->GetDerivedColor().ToUInt();
+        color_ = element_->GetDerivedColor().ToU32();
         useGradient_ = element_->HasColorGradient();
     }
     else
@@ -221,7 +221,7 @@ void UIBatch::AddQuad(const Matrix3x4& transform, int x, int y, int width, int h
 
 void UIBatch::AddQuad(int x, int y, int width, int height, int texOffsetX, int texOffsetY, int texWidth, int texHeight, bool tiled)
 {
-    if (!(element_->HasColorGradient() || element_->GetDerivedColor().ToUInt() & 0xff000000))
+    if (!(element_->HasColorGradient() || element_->GetDerivedColor().ToU32() & 0xff000000))
         return; // No gradient and alpha is 0, so do not add the quad
 
     if (!tiled)
@@ -328,10 +328,10 @@ void UIBatch::AddQuad(const Matrix3x4& transform, const IntVector2& a, const Int
     Vector2 uv3((float)texC.x_ * invTextureSize_.x_, (float)texC.y_ * invTextureSize_.y_);
     Vector2 uv4((float)texD.x_ * invTextureSize_.x_, (float)texD.y_ * invTextureSize_.y_);
 
-    unsigned c1 = colA.ToUInt();
-    unsigned c2 = colB.ToUInt();
-    unsigned c3 = colC.ToUInt();
-    unsigned c4 = colD.ToUInt();
+    color32 c1 = colA.ToU32();
+    color32 c2 = colB.ToU32();
+    color32 c3 = colC.ToU32();
+    color32 c4 = colD.ToU32();
 
     unsigned begin = vertexData_->Size();
     vertexData_->Resize(begin + 6 * UI_VERTEX_SIZE);
@@ -341,35 +341,35 @@ void UIBatch::AddQuad(const Matrix3x4& transform, const IntVector2& a, const Int
     dest[0] = v1.x_;
     dest[1] = v1.y_;
     dest[2] = 0.0f;
-    ((unsigned&)dest[3]) = c1;
+    ((color32&)dest[3]) = c1;
     dest[4] = uv1.x_;
     dest[5] = uv1.y_;
 
     dest[6] = v2.x_;
     dest[7] = v2.y_;
     dest[8] = 0.0f;
-    ((unsigned&)dest[9]) = c2;
+    ((color32&)dest[9]) = c2;
     dest[10] = uv2.x_;
     dest[11] = uv2.y_;
 
     dest[12] = v3.x_;
     dest[13] = v3.y_;
     dest[14] = 0.0f;
-    ((unsigned&)dest[15]) = c3;
+    ((color32&)dest[15]) = c3;
     dest[16] = uv3.x_;
     dest[17] = uv3.y_;
 
     dest[18] = v1.x_;
     dest[19] = v1.y_;
     dest[20] = 0.0f;
-    ((unsigned&)dest[21]) = c1;
+    ((color32&)dest[21]) = c1;
     dest[22] = uv1.x_;
     dest[23] = uv1.y_;
 
     dest[24] = v3.x_;
     dest[25] = v3.y_;
     dest[26] = 0.0f;
-    ((unsigned&)dest[27]) = c3;
+    ((color32&)dest[27]) = c3;
     dest[28] = uv3.x_;
     dest[29] = uv3.y_;
 
@@ -407,13 +407,13 @@ unsigned UIBatch::GetInterpolatedColor(float x, float y)
         Color bottomColor = element_->GetColor(C_BOTTOMLEFT).Lerp(element_->GetColor(C_BOTTOMRIGHT), cLerpX);
         Color color = topColor.Lerp(bottomColor, cLerpY);
         color.a_ *= element_->GetDerivedOpacity();
-        return color.ToUInt();
+        return color.ToU32();
     }
     else
     {
         Color color = element_->GetColor(C_TOPLEFT);
         color.a_ *= element_->GetDerivedOpacity();
-        return color.ToUInt();
+        return color.ToU32();
     }
 }
 

+ 1 - 1
Source/Urho3D/UI/UIBatch.h

@@ -87,7 +87,7 @@ public:
     /// Vertex data end index.
     unsigned vertexEnd_{};
     /// Current color. By default calculated from the element.
-    unsigned color_{};
+    color32 color_{};
     /// Gradient flag.
     bool useGradient_{};
     /// Custom material.

+ 2 - 2
Source/Urho3D/UI/UIComponent.cpp

@@ -212,8 +212,8 @@ void UIComponent::OnNodeSet(Node* node)
 
 void UIComponent::OnElementResized(StringHash eventType, VariantMap& args)
 {
-    int width = args[Resized::P_WIDTH].GetInt();
-    int height = args[Resized::P_HEIGHT].GetInt();
+    int width = args[Resized::P_WIDTH].GetI32();
+    int height = args[Resized::P_HEIGHT].GetI32();
 
     if (width < UICOMPONENT_MIN_TEXTURE_SIZE || width > UICOMPONENT_MAX_TEXTURE_SIZE ||
         height < UICOMPONENT_MIN_TEXTURE_SIZE || height > UICOMPONENT_MAX_TEXTURE_SIZE)

+ 2 - 2
Source/Urho3D/UI/UIElement.cpp

@@ -200,7 +200,7 @@ bool UIElement::LoadXML(const XMLElement& source, XMLFile* styleFile)
         String typeName = childElem.GetAttribute("type");
         if (typeName.Empty())
             typeName = "UIElement";
-        i32 index = childElem.HasAttribute("index") ? childElem.GetInt("index") : ENDPOS;
+        i32 index = childElem.HasAttribute("index") ? childElem.GetI32("index") : ENDPOS;
         UIElement* child = nullptr;
 
         if (!internalElem)
@@ -254,7 +254,7 @@ UIElement* UIElement::LoadChildXML(const XMLElement& childElem, XMLFile* styleFi
     String typeName = childElem.GetAttribute("type");
     if (typeName.Empty())
         typeName = "UIElement";
-    i32 index = childElem.HasAttribute("index") ? childElem.GetUInt("index") : ENDPOS;
+    i32 index = childElem.HasAttribute("index") ? childElem.GetU32("index") : ENDPOS;
     UIElement* child = CreateChild(typeName, String::EMPTY, index);
 
     if (child)

+ 3 - 3
Source/Urho3D/Urho2D/AnimatedSprite2D.cpp

@@ -410,7 +410,7 @@ void AnimatedSprite2D::UpdateSourceBatchesSpriter()
 
     Rect drawRect;
     Rect textureRect;
-    unsigned color = color_.ToUInt();
+    color32 color = color_.ToU32();
 
     Vertex2D vertex0;
     Vertex2D vertex1;
@@ -464,10 +464,10 @@ void AnimatedSprite2D::UpdateSourceBatchesSpriter()
         vertex3.uv_ = Vector2(textureRect.max_.x_, textureRect.min_.y_);
 
         Color finalColor;
-        finalColor.FromUInt(color);
+        finalColor.FromU32(color);
         finalColor.a_ = info.alpha_;
 
-        vertex0.color_ = vertex1.color_ = vertex2.color_ = vertex3.color_ = finalColor.ToUInt();
+        vertex0.color_ = vertex1.color_ = vertex2.color_ = vertex3.color_ = finalColor.ToU32();
 
         vertices.Push(vertex0);
         vertices.Push(vertex1);

+ 2 - 2
Source/Urho3D/Urho2D/ParticleEffect2D.cpp

@@ -500,7 +500,7 @@ SharedPtr<ParticleEffect2D> ParticleEffect2D::Clone(const String& cloneName) con
 
 int ParticleEffect2D::ReadInt(const XMLElement& element, const String& name) const
 {
-    return element.GetChild(name).GetInt("value");
+    return element.GetChild(name).GetI32("value");
 }
 
 float ParticleEffect2D::ReadFloat(const XMLElement& element, const String& name) const
@@ -523,7 +523,7 @@ Vector2 ParticleEffect2D::ReadVector2(const XMLElement& element, const String& n
 void ParticleEffect2D::WriteInt(XMLElement& element, const String& name, int value) const
 {
     XMLElement child = element.CreateChild(name);
-    child.SetInt("value", value);
+    child.SetI32("value", value);
 }
 
 void ParticleEffect2D::WriteFloat(XMLElement& element, const String& name, float value) const

+ 1 - 1
Source/Urho3D/Urho2D/ParticleEmitter2D.cpp

@@ -236,7 +236,7 @@ void ParticleEmitter2D::UpdateSourceBatches()
         vertex2.position_ = Vector3(p.position_.x_ + sub, p.position_.y_ + add, p.position_.z_);
         vertex3.position_ = Vector3(p.position_.x_ + add, p.position_.y_ - sub, p.position_.z_);
 
-        vertex0.color_ = vertex1.color_ = vertex2.color_ = vertex3.color_ = p.color_.ToUInt();
+        vertex0.color_ = vertex1.color_ = vertex2.color_ = vertex3.color_ = p.color_.ToU32();
 
         vertices.Push(vertex0);
         vertices.Push(vertex1);

+ 16 - 16
Source/Urho3D/Urho2D/SpriteSheet2D.cpp

@@ -221,20 +221,20 @@ bool SpriteSheet2D::EndLoadFromXMLFile()
     {
         String name = subTextureElem.GetAttribute("name");
 
-        int x = subTextureElem.GetInt("x");
-        int y = subTextureElem.GetInt("y");
-        int width = subTextureElem.GetInt("width");
-        int height = subTextureElem.GetInt("height");
+        int x = subTextureElem.GetI32("x");
+        int y = subTextureElem.GetI32("y");
+        int width = subTextureElem.GetI32("width");
+        int height = subTextureElem.GetI32("height");
         IntRect rectangle(x, y, x + width, y + height);
 
         Vector2 hotSpot(0.5f, 0.5f);
         IntVector2 offset(0, 0);
         if (subTextureElem.HasAttribute("frameWidth") && subTextureElem.HasAttribute("frameHeight"))
         {
-            offset.x_ = subTextureElem.GetInt("frameX");
-            offset.y_ = subTextureElem.GetInt("frameY");
-            int frameWidth = subTextureElem.GetInt("frameWidth");
-            int frameHeight = subTextureElem.GetInt("frameHeight");
+            offset.x_ = subTextureElem.GetI32("frameX");
+            offset.y_ = subTextureElem.GetI32("frameY");
+            int frameWidth = subTextureElem.GetI32("frameWidth");
+            int frameHeight = subTextureElem.GetI32("frameHeight");
             hotSpot.x_ = (offset.x_ + frameWidth / 2.f) / width;
             hotSpot.y_ = 1.0f - (offset.y_ + frameHeight / 2.f) / height;
         }
@@ -296,10 +296,10 @@ bool SpriteSheet2D::EndLoadFromJSONFile()
     {
         String name = subTextureVal.Get("name").GetString();
 
-        int x = subTextureVal.Get("x").GetInt();
-        int y = subTextureVal.Get("y").GetInt();
-        int width = subTextureVal.Get("width").GetInt();
-        int height = subTextureVal.Get("height").GetInt();
+        int x = subTextureVal.Get("x").GetI32();
+        int y = subTextureVal.Get("y").GetI32();
+        int width = subTextureVal.Get("width").GetI32();
+        int height = subTextureVal.Get("height").GetI32();
         IntRect rectangle(x, y, x + width, y + height);
 
         Vector2 hotSpot(0.5f, 0.5f);
@@ -309,10 +309,10 @@ bool SpriteSheet2D::EndLoadFromJSONFile()
 
         if (!frameWidthVal.IsNull() && !frameHeightVal.IsNull())
         {
-            offset.x_ = subTextureVal.Get("frameX").GetInt();
-            offset.y_ = subTextureVal.Get("frameY").GetInt();
-            int frameWidth = frameWidthVal.GetInt();
-            int frameHeight = frameHeightVal.GetInt();
+            offset.x_ = subTextureVal.Get("frameX").GetI32();
+            offset.y_ = subTextureVal.Get("frameY").GetI32();
+            int frameWidth = frameWidthVal.GetI32();
+            int frameHeight = frameHeightVal.GetI32();
             hotSpot.x_ = (offset.x_ + frameWidth / 2.f) / width;
             hotSpot.y_ = 1.0f - (offset.y_ + frameHeight / 2.f) / height;
         }

+ 1 - 1
Source/Urho3D/Urho2D/StaticSprite2D.cpp

@@ -316,7 +316,7 @@ void StaticSprite2D::UpdateSourceBatches()
     vertex2.uv_ = textureRect_.max_;
     (swapXY_ ? vertex1.uv_ : vertex3.uv_) = Vector2(textureRect_.max_.x_, textureRect_.min_.y_);
 
-    vertex0.color_ = vertex1.color_ = vertex2.color_ = vertex3.color_ = color_.ToUInt();
+    vertex0.color_ = vertex1.color_ = vertex2.color_ = vertex3.color_ = color_.ToU32();
 
     vertices.Push(vertex0);
     vertices.Push(vertex1);

+ 2 - 2
Source/Urho3D/Urho2D/StretchableSprite2D.cpp

@@ -60,7 +60,7 @@ void prepareUVCoords(float coords[4], float low, float high, float lowBorder, fl
     coords[3] = high;
 }
 
-void prepareVertices(Vertex2D vtx[4][4], const float xs[4], const float ys[4], const float us[4], const float vs[4], unsigned color,
+void prepareVertices(Vertex2D vtx[4][4], const float xs[4], const float ys[4], const float us[4], const float vs[4], color32 color,
     const Vector3& position, const Quaternion& rotation)
 {
     for (unsigned i = 0; i < 4; ++i)
@@ -167,7 +167,7 @@ void StretchableSprite2D::UpdateSourceBatches()
         -effectiveBorder.max_.y_ /* texture y direction inverted*/, drawRect_.max_.y_ - drawRect_.min_.y_);
 
     Vertex2D vtx[4][4]; // prepare all vertices
-    prepareVertices(vtx, xs, ys, us, vs, color_.ToUInt(), node_->GetWorldPosition(), node_->GetWorldRotation());
+    prepareVertices(vtx, xs, ys, us, vs, color_.ToU32(), node_->GetWorldPosition(), node_->GetWorldRotation());
 
     pushVertices(vertices, vtx); // push the vertices that make up each patch
 

+ 17 - 17
Source/Urho3D/Urho2D/TmxFile2D.cpp

@@ -48,10 +48,10 @@ const String& TmxLayer2D::GetProperty(const String& name) const
 void TmxLayer2D::LoadInfo(const XMLElement& element)
 {
     name_ = element.GetAttribute("name");
-    width_ = element.GetInt("width");
-    height_ = element.GetInt("height");
+    width_ = element.GetI32("width");
+    height_ = element.GetI32("height");
     if (element.HasAttribute("visible"))
-        visible_ = element.GetInt("visible") != 0;
+        visible_ = element.GetI32("visible") != 0;
     else
         visible_ = true;
 }
@@ -121,7 +121,7 @@ bool TmxTileLayer2D::Load(const XMLElement& element, const TileMapInfo2D& info)
                 if (!tileElem)
                     return false;
 
-                unsigned gid = tileElem.GetUInt("gid");
+                unsigned gid = tileElem.GetU32("gid");
                 if (gid > 0)
                 {
                     SharedPtr<Tile2D> tile(new Tile2D());
@@ -256,7 +256,7 @@ void TmxObjectGroup2D::StoreObject(const XMLElement& objectElem, const SharedPtr
 
         case OT_TILE:
             object->position_ = info.ConvertPosition(position);
-            object->gid_ = objectElem.GetUInt("gid");
+            object->gid_ = objectElem.GetU32("gid");
             object->sprite_ = tmxFile_->GetTileSprite(object->gid_ & ~FLIP_ALL);
 
             if (objectElem.HasAttribute("width") || objectElem.HasAttribute("height"))
@@ -455,8 +455,8 @@ bool TmxFile2D::EndLoad()
         return false;
     }
 
-    info_.width_ = rootElem.GetInt("width");
-    info_.height_ = rootElem.GetInt("height");
+    info_.width_ = rootElem.GetI32("width");
+    info_.height_ = rootElem.GetI32("height");
     info_.tileWidth_ = rootElem.GetFloat("tilewidth") * PIXEL_SIZE;
     info_.tileHeight_ = rootElem.GetFloat("tileheight") * PIXEL_SIZE;
 
@@ -598,7 +598,7 @@ struct TileImageInfo {
 
 bool TmxFile2D::LoadTileSet(const XMLElement& element)
 {
-    unsigned firstgid = element.GetUInt("firstgid");
+    unsigned firstgid = element.GetU32("firstgid");
 
     XMLElement tileSetElem;
     if (element.HasAttribute("source"))
@@ -622,10 +622,10 @@ bool TmxFile2D::LoadTileSet(const XMLElement& element)
     else
         tileSetElem = element;
 
-    int tileWidth = tileSetElem.GetInt("tilewidth");
-    int tileHeight = tileSetElem.GetInt("tileheight");
-    int spacing = tileSetElem.GetInt("spacing");
-    int margin = tileSetElem.GetInt("margin");
+    int tileWidth = tileSetElem.GetI32("tilewidth");
+    int tileHeight = tileSetElem.GetI32("tileheight");
+    int spacing = tileSetElem.GetI32("spacing");
+    int margin = tileSetElem.GetI32("margin");
     int imageWidth;
     int imageHeight;
     bool isSingleTileSet = false;
@@ -653,8 +653,8 @@ bool TmxFile2D::LoadTileSet(const XMLElement& element)
                 hotSpot.y_ += offsetElem.GetFloat("y") / (float)tileHeight;
             }
 
-            imageWidth = imageElem.GetInt("width");
-            imageHeight = imageElem.GetInt("height");
+            imageWidth = imageElem.GetI32("width");
+            imageHeight = imageElem.GetI32("height");
 
             unsigned gid = firstgid;
             for (int y = margin; y + tileHeight <= imageHeight - margin; y += tileHeight + spacing)
@@ -675,7 +675,7 @@ bool TmxFile2D::LoadTileSet(const XMLElement& element)
     Vector<TileImageInfo> tileImageInfos;
     for (XMLElement tileElem = tileSetElem.GetChild("tile"); tileElem; tileElem = tileElem.GetNext("tile"))
     {
-        unsigned gid = firstgid + tileElem.GetUInt("id");
+        unsigned gid = firstgid + tileElem.GetU32("id");
         // Tileset based on collection of images
         if (!isSingleTileSet)
         {
@@ -688,8 +688,8 @@ bool TmxFile2D::LoadTileSet(const XMLElement& element)
                     URHO3D_LOGERROR("Could not load image " + textureFilePath);
                     return false;
                 }
-                tileWidth = imageWidth = imageElem.GetInt("width");
-                tileHeight = imageHeight = imageElem.GetInt("height");
+                tileWidth = imageWidth = imageElem.GetI32("width");
+                tileHeight = imageHeight = imageElem.GetI32("height");
                 TileImageInfo info = {image, gid, imageWidth, imageHeight, 0, 0};
                 tileImageInfos.Push(info);
             }

+ 2 - 2
bin/Data/Scripts/02_HelloGUI.as

@@ -141,12 +141,12 @@ void CreateDraggableFish()
 void HandleDragBegin(StringHash eventType, VariantMap& eventData)
 {
     // Get UIElement relative position where input (touch or click) occurred (top-left = IntVector2(0,0))
-    dragBeginPosition = IntVector2(eventData["ElementX"].GetInt(), eventData["ElementY"].GetInt());
+    dragBeginPosition = IntVector2(eventData["ElementX"].GetI32(), eventData["ElementY"].GetI32());
 }
 
 void HandleDragMove(StringHash eventType, VariantMap& eventData)
 {
-    IntVector2 dragCurrentPosition = IntVector2(eventData["X"].GetInt(), eventData["Y"].GetInt());
+    IntVector2 dragCurrentPosition = IntVector2(eventData["X"].GetI32(), eventData["Y"].GetI32());
     // Get the element (fish) that is being dragged. GetPtr() returns a RefCounted handle which can be cast implicitly
     UIElement@ draggedElement = eventData["Element"].GetPtr();
     draggedElement.position = dragCurrentPosition - dragBeginPosition;

+ 1 - 1
bin/Data/Scripts/16_Chat.as

@@ -193,7 +193,7 @@ void HandleStartServer(StringHash eventType, VariantMap& eventData)
 
 void HandleNetworkMessage(StringHash eventType, VariantMap& eventData)
 {
-    int msgID = eventData["MessageID"].GetInt();
+    int msgID = eventData["MessageID"].GetI32();
     if (msgID == MSG_CHAT)
     {
         VectorBuffer msg = eventData["Data"].GetBuffer();

+ 1 - 1
bin/Data/Scripts/17_SceneReplication.as

@@ -434,7 +434,7 @@ void HandleClientDisconnected(StringHash eventType, VariantMap& eventData)
 
 void HandleClientObjectID(StringHash eventType, VariantMap& eventData)
 {
-    clientObjectID = eventData["ID"].GetUInt();
+    clientObjectID = eventData["ID"].GetU32();
 }
 
 // Create XML patch instructions for screen joystick layout specific to this sample app

+ 2 - 2
bin/Data/Scripts/25_Urho2DParticle.as

@@ -107,8 +107,8 @@ void HandleMouseMove(StringHash eventType, VariantMap& eventData)
 {
     if (particleNode !is null)
     {
-        float x = eventData["X"].GetInt();
-        float y = eventData["Y"].GetInt();
+        float x = eventData["X"].GetI32();
+        float y = eventData["Y"].GetI32();
         Camera@ camera = cameraNode.GetComponent("Camera");
         particleNode.position = camera.ScreenToWorldPoint(Vector3(x / graphics.width, y / graphics.height, 10.0f));
     }

+ 1 - 1
bin/Data/Scripts/26_ConsoleInput.as

@@ -97,7 +97,7 @@ void HandleUpdate(StringHash eventType, VariantMap& eventData)
 void HandleEscKeyDown(StringHash eventType, VariantMap& eventData)
 {
     // Unlike the other samples, exiting the engine when ESC is pressed instead of just closing the console
-    if (eventData["Key"].GetInt() == KEY_ESCAPE)
+    if (eventData["Key"].GetI32() == KEY_ESCAPE)
         engine.Exit();
 }
 

+ 3 - 3
bin/Data/Scripts/32_Physics2DConstraints.as

@@ -426,7 +426,7 @@ void HandleMouseMove(StringHash eventType, VariantMap& eventData)
 void HandleTouchBegin3(StringHash eventType, VariantMap& eventData)
 {
     PhysicsWorld2D@ physicsWorld = scene_.GetComponent("PhysicsWorld2D");
-    RigidBody2D@ rigidBody = physicsWorld.GetRigidBody(eventData["X"].GetInt(), eventData["Y"].GetInt()); // Raycast for RigidBody2Ds to pick
+    RigidBody2D@ rigidBody = physicsWorld.GetRigidBody(eventData["X"].GetI32(), eventData["Y"].GetI32()); // Raycast for RigidBody2Ds to pick
     if (rigidBody !is null)
     {
         pickedNode = rigidBody.node;
@@ -436,7 +436,7 @@ void HandleTouchBegin3(StringHash eventType, VariantMap& eventData)
 
         // Create a ConstraintMouse2D - Temporary apply this constraint to the pickedNode to allow grasping and moving with touch
         ConstraintMouse2D@ constraintMouse = pickedNode.CreateComponent("ConstraintMouse2D");
-        Vector3 pos = camera.ScreenToWorldPoint(Vector3(float(eventData["X"].GetInt()) / graphics.width, float(eventData["Y"].GetInt()) / graphics.height, 0.0f));
+        Vector3 pos = camera.ScreenToWorldPoint(Vector3(float(eventData["X"].GetI32()) / graphics.width, float(eventData["Y"].GetI32()) / graphics.height, 0.0f));
         constraintMouse.target = Vector2(pos.x, pos.y);
         constraintMouse.maxForce = 1000 * rigidBody.mass;
         constraintMouse.collideConnected = true;
@@ -452,7 +452,7 @@ void HandleTouchMove3(StringHash eventType, VariantMap& eventData)
     if (pickedNode !is null)
     {
         ConstraintMouse2D@ constraintMouse = pickedNode.GetComponent("ConstraintMouse2D");
-        Vector3 pos = camera.ScreenToWorldPoint(Vector3(float(eventData["X"].GetInt()) / graphics.width, float(eventData["Y"].GetInt()) / graphics.height, 0.0f));
+        Vector3 pos = camera.ScreenToWorldPoint(Vector3(float(eventData["X"].GetI32()) / graphics.width, float(eventData["Y"].GetI32()) / graphics.height, 0.0f));
         constraintMouse.target = Vector2(pos.x, pos.y);
     }
 }

+ 8 - 8
bin/Data/Scripts/37_UIDrag.as

@@ -107,31 +107,31 @@ void HandleDragBegin(StringHash eventType, VariantMap& eventData)
 {
     Button@ element = eventData["Element"].GetPtr();
 
-    int lx = eventData["X"].GetInt();
-    int ly = eventData["Y"].GetInt();
+    int lx = eventData["X"].GetI32();
+    int ly = eventData["Y"].GetI32();
 
     IntVector2 p = element.position;
     element.vars[VAR_START] = p;
     element.vars[VAR_DELTA] = IntVector2(p.x - lx, p.y - ly);
 
-    int buttons = eventData["Buttons"].GetInt();
+    int buttons = eventData["Buttons"].GetI32();
     element.vars[VAR_BUTTONS] = buttons;
 
     Text@ t = element.GetChild(String("Text"));
     t.text = "Drag Begin Buttons: " + String(buttons);
 
     t = element.GetChild(String("Num Touch"));
-    t.text = "Number of buttons: " + String(eventData["NumButtons"].GetInt());
+    t.text = "Number of buttons: " + String(eventData["NumButtons"].GetI32());
 }
 
 void HandleDragMove(StringHash eventType, VariantMap& eventData)
 {
     Button@ element = eventData["Element"].GetPtr();
-    int buttons = eventData["Buttons"].GetInt();
+    int buttons = eventData["Buttons"].GetI32();
     IntVector2 d = element.vars[VAR_DELTA].GetIntVector2();
-    int X = eventData["X"].GetInt() + d.x;
-    int Y = eventData["Y"].GetInt() + d.y;
-    int BUTTONS = element.vars[VAR_BUTTONS].GetInt();
+    int X = eventData["X"].GetI32() + d.x;
+    int Y = eventData["Y"].GetI32() + d.y;
+    int BUTTONS = element.vars[VAR_BUTTONS].GetI32();
 
     Text@ t = element.GetChild(String("Event Touch"));
     t.text = "Drag Move Buttons: " + String(buttons);

+ 3 - 3
bin/Data/Scripts/39_CrowdNavigation.as

@@ -534,7 +534,7 @@ void HandlePostRenderUpdate(StringHash eventType, VariantMap& eventData)
 void HandleCrowdAgentFailure(StringHash eventType, VariantMap& eventData)
 {
     Node@ node = eventData["Node"].GetPtr();
-    int state = eventData["CrowdAgentState"].GetInt();
+    int state = eventData["CrowdAgentState"].GetI32();
 
     // If the agent's state is invalid, likely from spawning on the side of a box, find a point in a larger area
     if (state == CA_STATE_INVALID)
@@ -548,8 +548,8 @@ void HandleCrowdAgentFailure(StringHash eventType, VariantMap& eventData)
 
 void HandleCrowdAgentFormation(StringHash eventType, VariantMap& eventData)
 {
-    uint index = eventData["Index"].GetUInt();
-    uint size = eventData["Size"].GetUInt();
+    uint index = eventData["Index"].GetU32();
+    uint size = eventData["Size"].GetU32();
     Vector3 position = eventData["Position"].GetVector3();
 
     // The first agent will always move to the exact position, all other agents will select a random point nearby

+ 2 - 2
bin/Data/Scripts/41_DatabaseDemo.as

@@ -94,7 +94,7 @@ void HandleUpdate(StringHash eventType, VariantMap& eventData)
 void HandleEscKeyDown(StringHash eventType, VariantMap& eventData)
 {
     // Unlike the other samples, exiting the engine when ESC is pressed instead of just closing the console
-    if (eventData["Key"].GetInt() == KEY_ESCAPE)
+    if (eventData["Key"].GetI32() == KEY_ESCAPE)
         engine.Exit();
 }
 
@@ -102,7 +102,7 @@ void HandleDbCursor(StringHash eventType, VariantMap& eventData)
 {
     // In a real application the P_SQL can be used to do the logic branching in a shared event handler
     // However, this is not required in this sample demo
-    uint numCols = eventData["NumCols"].GetUInt();
+    uint numCols = eventData["NumCols"].GetU32();
     Array<Variant>@ colValues = eventData["ColValues"].GetVariantVector();
     Array<String>@ colHeaders = eventData["ColHeaders"].GetStringVector();
 

+ 2 - 2
bin/Data/Scripts/48_Hello3DUI.as

@@ -203,12 +203,12 @@ void CreateDraggableFish()
 void HandleDragBegin(StringHash eventType, VariantMap& eventData)
 {
     // Get UIElement relative position where input (touch or click) occurred (top-left = IntVector2(0,0))
-    dragBeginPosition = IntVector2(eventData["ElementX"].GetInt(), eventData["ElementY"].GetInt());
+    dragBeginPosition = IntVector2(eventData["ElementX"].GetI32(), eventData["ElementY"].GetI32());
 }
 
 void HandleDragMove(StringHash eventType, VariantMap& eventData)
 {
-    IntVector2 dragCurrentPosition = IntVector2(eventData["X"].GetInt(), eventData["Y"].GetInt());
+    IntVector2 dragCurrentPosition = IntVector2(eventData["X"].GetI32(), eventData["Y"].GetI32());
     // Get the element (fish) that is being dragged. GetPtr() returns a RefCounted handle which can be cast implicitly
     UIElement@ draggedElement = eventData["Element"].GetPtr();
     draggedElement.position = dragCurrentPosition - dragBeginPosition;

+ 1 - 1
bin/Data/Scripts/51_Urho2DStretchableSprite.as

@@ -131,7 +131,7 @@ void HandleUpdate(StringHash eventType, VariantMap& eventData)
 
 void OnKeyUp(StringHash eventType, VariantMap& eventData)
 {
-    int key = eventData["Key"].GetInt();
+    int key = eventData["Key"].GetI32();
 
     if(key == KEY_TAB)
     {

+ 1 - 1
bin/Data/Scripts/53_LANDiscovery.as

@@ -94,7 +94,7 @@ void HandleNetworkHostDiscovered(StringHash eventType, VariantMap& eventData)
     log.Info("Server discovered!");
     String text = serverList.text;
     VariantMap data = eventData["Beacon"].GetVariantMap();
-    text += "\n" + data["Name"].GetString() + "(" + String(data["Players"].GetInt()) + ")" + eventData["Address"].GetString() + ":" + String(eventData["Port"].GetInt());
+    text += "\n" + data["Name"].GetString() + "(" + String(data["Players"].GetI32()) + ")" + eventData["Address"].GetString() + ":" + String(eventData["Port"].GetI32());
     serverList.text = text;
 }
 

+ 1 - 1
bin/Data/Scripts/55_Clicker.as

@@ -119,7 +119,7 @@ void HandleUpdate(StringHash eventType, VariantMap& eventData)
 // Handle the mouse click event
 void HandleMouseButtonDown(StringHash eventType, VariantMap& eventData)
 {
-    MouseButton button = eventData["Button"].GetUInt();
+    MouseButton button = eventData["Button"].GetU32();
     
     if (button == MOUSEB_RIGHT)
     {

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно