ソースを参照

Merge pull request #2108 from eugeneko/cpp11-upgrade

C++11 upgrade: typedef to using, 0 to nullptr, added override
Eugene Kozlov 8 年 前
コミット
dbfbda76c3
100 ファイル変更315 行追加315 行削除
  1. 2 2
      Source/Samples/01_HelloWorld/HelloWorld.h
  2. 2 2
      Source/Samples/02_HelloGUI/HelloGUI.h
  3. 2 2
      Source/Samples/03_Sprites/Sprites.h
  4. 1 1
      Source/Samples/04_StaticScene/StaticScene.h
  5. 1 1
      Source/Samples/05_AnimatingScene/AnimatingScene.h
  6. 1 1
      Source/Samples/05_AnimatingScene/Rotator.h
  7. 1 1
      Source/Samples/06_SkeletalAnimation/Mover.h
  8. 2 2
      Source/Samples/06_SkeletalAnimation/SkeletalAnimation.h
  9. 2 2
      Source/Samples/07_Billboards/Billboards.h
  10. 1 1
      Source/Samples/08_Decals/Decals.cpp
  11. 2 2
      Source/Samples/08_Decals/Decals.h
  12. 2 2
      Source/Samples/09_MultipleViewports/MultipleViewports.h
  13. 1 1
      Source/Samples/10_RenderToTexture/RenderToTexture.h
  14. 1 1
      Source/Samples/10_RenderToTexture/Rotator.h
  15. 2 2
      Source/Samples/11_Physics/Physics.h
  16. 2 2
      Source/Samples/12_PhysicsStressTest/PhysicsStressTest.h
  17. 1 1
      Source/Samples/13_Ragdolls/CreateRagdoll.h
  18. 2 2
      Source/Samples/13_Ragdolls/Ragdolls.h
  19. 1 1
      Source/Samples/14_SoundEffects/SoundEffects.cpp
  20. 3 3
      Source/Samples/14_SoundEffects/SoundEffects.h
  21. 1 1
      Source/Samples/15_Navigation/Navigation.cpp
  22. 2 2
      Source/Samples/15_Navigation/Navigation.h
  23. 2 2
      Source/Samples/16_Chat/Chat.cpp
  24. 2 2
      Source/Samples/16_Chat/Chat.h
  25. 2 2
      Source/Samples/17_SceneReplication/SceneReplication.h
  26. 2 2
      Source/Samples/18_CharacterDemo/Character.h
  27. 3 3
      Source/Samples/18_CharacterDemo/CharacterDemo.h
  28. 2 2
      Source/Samples/19_VehicleDemo/Vehicle.h
  29. 1 1
      Source/Samples/19_VehicleDemo/VehicleDemo.h
  30. 1 1
      Source/Samples/20_HugeObjectCount/HugeObjectCount.cpp
  31. 2 2
      Source/Samples/20_HugeObjectCount/HugeObjectCount.h
  32. 1 1
      Source/Samples/21_AngelScriptIntegration/AngelScriptIntegration.h
  33. 1 1
      Source/Samples/22_LuaIntegration/LuaIntegration.h
  34. 1 1
      Source/Samples/23_Water/Water.h
  35. 2 2
      Source/Samples/24_Urho2DSprite/Urho2DSprite.h
  36. 2 2
      Source/Samples/25_Urho2DParticle/Urho2DParticle.h
  37. 2 2
      Source/Samples/26_ConsoleInput/ConsoleInput.h
  38. 2 2
      Source/Samples/27_Urho2DPhysics/Urho2DPhysics.h
  39. 2 2
      Source/Samples/28_Urho2DPhysicsRope/Urho2DPhysicsRope.h
  40. 3 3
      Source/Samples/29_SoundSynthesis/SoundSynthesis.h
  41. 1 1
      Source/Samples/30_LightAnimation/LightAnimation.h
  42. 1 1
      Source/Samples/31_MaterialAnimation/MaterialAnimation.h
  43. 2 2
      Source/Samples/32_Urho2DConstraints/Urho2DConstraints.cpp
  44. 2 2
      Source/Samples/32_Urho2DConstraints/Urho2DConstraints.h
  45. 2 2
      Source/Samples/33_Urho2DSpriterAnimation/Urho2DSpriterAnimation.h
  46. 2 2
      Source/Samples/34_DynamicGeometry/DynamicGeometry.h
  47. 1 1
      Source/Samples/35_SignedDistanceFieldText/SignedDistanceFieldText.h
  48. 1 1
      Source/Samples/36_Urho2DTileMap/Urho2DTileMap.cpp
  49. 2 2
      Source/Samples/36_Urho2DTileMap/Urho2DTileMap.h
  50. 2 2
      Source/Samples/37_UIDrag/UIDrag.h
  51. 1 1
      Source/Samples/38_SceneAndUILoad/SceneAndUILoad.h
  52. 1 1
      Source/Samples/39_CrowdNavigation/CrowdNavigation.cpp
  53. 2 2
      Source/Samples/39_CrowdNavigation/CrowdNavigation.h
  54. 1 1
      Source/Samples/40_Localization/L10n.h
  55. 2 2
      Source/Samples/41_DatabaseDemo/DatabaseDemo.cpp
  56. 3 3
      Source/Samples/41_DatabaseDemo/DatabaseDemo.h
  57. 4 4
      Source/Samples/42_PBRMaterials/PBRMaterials.cpp
  58. 1 1
      Source/Samples/42_PBRMaterials/PBRMaterials.h
  59. 2 2
      Source/Samples/43_HttpRequestDemo/HttpRequestDemo.h
  60. 1 1
      Source/Samples/44_RibbonTrailDemo/RibbonTrailDemo.h
  61. 1 1
      Source/Samples/45_InverseKinematics/InverseKinematics.h
  62. 1 1
      Source/Samples/46_RaycastVehicle/RaycastVehicleDemo.h
  63. 4 4
      Source/Samples/46_RaycastVehicle/Vehicle.h
  64. 3 3
      Source/Samples/47_Typography/Typography.cpp
  65. 2 2
      Source/Samples/47_Typography/Typography.h
  66. 2 2
      Source/Samples/48_Hello3DUI/Hello3DUI.h
  67. 3 3
      Source/Samples/Sample.h
  68. 13 13
      Source/Tools/AssetImporter/AssetImporter.cpp
  69. 1 1
      Source/Tools/OgreImporter/OgreImporter.cpp
  70. 1 1
      Source/Tools/SpritePacker/SpritePacker.cpp
  71. 3 3
      Source/Tools/Urho3DPlayer/Urho3DPlayer.h
  72. 10 10
      Source/Urho3D/AngelScript/APITemplates.h
  73. 42 42
      Source/Urho3D/AngelScript/Addons.cpp
  74. 3 3
      Source/Urho3D/AngelScript/CoreAPI.cpp
  75. 1 1
      Source/Urho3D/AngelScript/DatabaseAPI.cpp
  76. 7 7
      Source/Urho3D/AngelScript/GraphicsAPI.cpp
  77. 1 1
      Source/Urho3D/AngelScript/IOAPI.cpp
  78. 1 1
      Source/Urho3D/AngelScript/PhysicsAPI.cpp
  79. 5 5
      Source/Urho3D/AngelScript/SceneAPI.cpp
  80. 7 7
      Source/Urho3D/AngelScript/Script.cpp
  81. 1 1
      Source/Urho3D/AngelScript/Script.h
  82. 3 3
      Source/Urho3D/AngelScript/ScriptAPI.cpp
  83. 1 1
      Source/Urho3D/AngelScript/ScriptAPIDump.cpp
  84. 25 25
      Source/Urho3D/AngelScript/ScriptFile.cpp
  85. 14 14
      Source/Urho3D/AngelScript/ScriptFile.h
  86. 14 14
      Source/Urho3D/AngelScript/ScriptInstance.cpp
  87. 17 17
      Source/Urho3D/AngelScript/ScriptInstance.h
  88. 2 2
      Source/Urho3D/AngelScript/UIAPI.cpp
  89. 1 1
      Source/Urho3D/AngelScript/Urho2DAPI.cpp
  90. 1 1
      Source/Urho3D/Audio/Audio.cpp
  91. 1 1
      Source/Urho3D/Audio/Audio.h
  92. 2 2
      Source/Urho3D/Audio/BufferedSoundStream.h
  93. 2 2
      Source/Urho3D/Audio/OggVorbisSoundStream.cpp
  94. 3 3
      Source/Urho3D/Audio/OggVorbisSoundStream.h
  95. 3 3
      Source/Urho3D/Audio/Sound.cpp
  96. 2 2
      Source/Urho3D/Audio/Sound.h
  97. 1 1
      Source/Urho3D/Audio/SoundListener.h
  98. 6 6
      Source/Urho3D/Audio/SoundSource.cpp
  99. 1 1
      Source/Urho3D/Audio/SoundSource.h
  100. 2 2
      Source/Urho3D/Audio/SoundSource3D.h

+ 2 - 2
Source/Samples/01_HelloWorld/HelloWorld.h

@@ -38,11 +38,11 @@ public:
     HelloWorld(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 protected:
     /// Return XML patch instructions for screen joystick layout for a specific sample app, if any.
-    virtual String GetScreenJoystickPatchString() const { return
+    virtual String GetScreenJoystickPatchString() const override { return
         "<patch>"
         "    <add sel=\"/element/element[./attribute[@name='Name' and @value='Hat0']]\">"
         "        <attribute name=\"Is Visible\" value=\"false\" />"

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

@@ -49,11 +49,11 @@ public:
     HelloGUI(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 protected:
     /// Return XML patch instructions for screen joystick layout for a specific sample app, if any.
-    virtual String GetScreenJoystickPatchString() const { return
+    virtual String GetScreenJoystickPatchString() const override { return
         "<patch>"
         "    <add sel=\"/element/element[./attribute[@name='Name' and @value='Hat0']]\">"
         "        <attribute name=\"Is Visible\" value=\"false\" />"

+ 2 - 2
Source/Samples/03_Sprites/Sprites.h

@@ -39,11 +39,11 @@ public:
     Sprites(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 protected:
     /// Return XML patch instructions for screen joystick layout for a specific sample app, if any.
-    virtual String GetScreenJoystickPatchString() const { return
+    virtual String GetScreenJoystickPatchString() const override { return
         "<patch>"
         "    <add sel=\"/element/element[./attribute[@name='Name' and @value='Hat0']]\">"
         "        <attribute name=\"Is Visible\" value=\"false\" />"

+ 1 - 1
Source/Samples/04_StaticScene/StaticScene.h

@@ -46,7 +46,7 @@ public:
     StaticScene(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 private:
     /// Construct the scene content.

+ 1 - 1
Source/Samples/05_AnimatingScene/AnimatingScene.h

@@ -46,7 +46,7 @@ public:
     AnimatingScene(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 private:
     /// Construct the scene content.

+ 1 - 1
Source/Samples/05_AnimatingScene/Rotator.h

@@ -39,7 +39,7 @@ public:
     /// Set rotation speed about the Euler axes. Will be scaled with scene update time step.
     void SetRotationSpeed(const Vector3& speed);
     /// Handle scene update. Called by LogicComponent base class.
-    virtual void Update(float timeStep);
+    virtual void Update(float timeStep) override;
     
     /// Return rotation speed.
     const Vector3& GetRotationSpeed() const { return rotationSpeed_; }

+ 1 - 1
Source/Samples/06_SkeletalAnimation/Mover.h

@@ -38,7 +38,7 @@ public:
     /// Set motion parameters: forward movement speed, rotation speed, and movement boundaries.
     void SetParameters(float moveSpeed, float rotateSpeed, const BoundingBox& bounds);
     /// Handle scene update. Called by LogicComponent base class.
-    virtual void Update(float timeStep);
+    virtual void Update(float timeStep) override;
     
     /// Return forward movement speed.
     float GetMoveSpeed() const { return moveSpeed_; }

+ 2 - 2
Source/Samples/06_SkeletalAnimation/SkeletalAnimation.h

@@ -48,11 +48,11 @@ public:
     SkeletalAnimation(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 protected:
     /// Return XML patch instructions for screen joystick layout for a specific sample app, if any.
-    virtual String GetScreenJoystickPatchString() const { return
+    virtual String GetScreenJoystickPatchString() const override { return
         "<patch>"
         "    <remove sel=\"/element/element[./attribute[@name='Name' and @value='Button1']]/attribute[@name='Is Visible']\" />"
         "    <replace sel=\"/element/element[./attribute[@name='Name' and @value='Button1']]/element[./attribute[@name='Name' and @value='Label']]/attribute[@name='Text']/@value\">Debug</replace>"

+ 2 - 2
Source/Samples/07_Billboards/Billboards.h

@@ -46,11 +46,11 @@ public:
     Billboards(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 protected:
     /// Return XML patch instructions for screen joystick layout for a specific sample app, if any.
-    virtual String GetScreenJoystickPatchString() const { return
+    virtual String GetScreenJoystickPatchString() const override { return
         "<patch>"
         "    <remove sel=\"/element/element[./attribute[@name='Name' and @value='Button1']]/attribute[@name='Is Visible']\" />"
         "    <replace sel=\"/element/element[./attribute[@name='Name' and @value='Button1']]/element[./attribute[@name='Name' and @value='Label']]/attribute[@name='Text']/@value\">Debug</replace>"

+ 1 - 1
Source/Samples/08_Decals/Decals.cpp

@@ -278,7 +278,7 @@ void Decals::PaintDecal()
 
 bool Decals::Raycast(float maxDistance, Vector3& hitPos, Drawable*& hitDrawable)
 {
-    hitDrawable = 0;
+    hitDrawable = nullptr;
 
     UI* ui = GetSubsystem<UI>();
     IntVector2 pos = ui->GetCursorPosition();

+ 2 - 2
Source/Samples/08_Decals/Decals.h

@@ -48,11 +48,11 @@ public:
     Decals(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 protected:
     /// Return XML patch instructions for screen joystick layout for a specific sample app, if any.
-    virtual String GetScreenJoystickPatchString() const { return
+    virtual String GetScreenJoystickPatchString() const override { return
         "<patch>"
         "    <remove sel=\"/element/element[./attribute[@name='Name' and @value='Button0']]/attribute[@name='Is Visible']\" />"
         "    <replace sel=\"/element/element[./attribute[@name='Name' and @value='Button0']]/element[./attribute[@name='Name' and @value='Label']]/attribute[@name='Text']/@value\">Paint</replace>"

+ 2 - 2
Source/Samples/09_MultipleViewports/MultipleViewports.h

@@ -45,11 +45,11 @@ public:
     MultipleViewports(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 protected:
     /// Return XML patch instructions for screen joystick layout for a specific sample app, if any.
-    virtual String GetScreenJoystickPatchString() const { return
+    virtual String GetScreenJoystickPatchString() const override { return
         "<patch>"
         "    <add sel=\"/element\">"
         "        <element type=\"Button\">"

+ 1 - 1
Source/Samples/10_RenderToTexture/RenderToTexture.h

@@ -45,7 +45,7 @@ public:
     RenderToTexture(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 private:
     /// Construct the scene content.

+ 1 - 1
Source/Samples/10_RenderToTexture/Rotator.h

@@ -39,7 +39,7 @@ public:
     /// Set rotation speed about the Euler axes. Will be scaled with scene update time step.
     void SetRotationSpeed(const Vector3& speed);
     /// Handle scene update. Called by LogicComponent base class.
-    virtual void Update(float timeStep);
+    virtual void Update(float timeStep) override;
     
     /// Return rotation speed.
     const Vector3& GetRotationSpeed() const { return rotationSpeed_; }

+ 2 - 2
Source/Samples/11_Physics/Physics.h

@@ -47,11 +47,11 @@ public:
     Physics(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 protected:
     /// Return XML patch instructions for screen joystick layout for a specific sample app, if any.
-    virtual String GetScreenJoystickPatchString() const { return
+    virtual String GetScreenJoystickPatchString() const override { return
         "<patch>"
         "    <remove sel=\"/element/element[./attribute[@name='Name' and @value='Button0']]/attribute[@name='Is Visible']\" />"
         "    <replace sel=\"/element/element[./attribute[@name='Name' and @value='Button0']]/element[./attribute[@name='Name' and @value='Label']]/attribute[@name='Text']/@value\">Spawn</replace>"

+ 2 - 2
Source/Samples/12_PhysicsStressTest/PhysicsStressTest.h

@@ -46,11 +46,11 @@ public:
     PhysicsStressTest(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 protected:
     /// Return XML patch instructions for screen joystick layout for a specific sample app, if any.
-    virtual String GetScreenJoystickPatchString() const { return
+    virtual String GetScreenJoystickPatchString() const override { return
         "<patch>"
         "    <remove sel=\"/element/element[./attribute[@name='Name' and @value='Button0']]/attribute[@name='Is Visible']\" />"
         "    <replace sel=\"/element/element[./attribute[@name='Name' and @value='Button0']]/element[./attribute[@name='Name' and @value='Label']]/attribute[@name='Text']/@value\">Spawn</replace>"

+ 1 - 1
Source/Samples/13_Ragdolls/CreateRagdoll.h

@@ -38,7 +38,7 @@ public:
     
 protected:
     /// Handle node being assigned.
-    virtual void OnNodeSet(Node* node);
+    virtual void OnNodeSet(Node* node) override;
     
 private:
     /// Handle scene node's physics collision.

+ 2 - 2
Source/Samples/13_Ragdolls/Ragdolls.h

@@ -46,11 +46,11 @@ public:
     Ragdolls(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 protected:
     /// Return XML patch instructions for screen joystick layout for a specific sample app, if any.
-    virtual String GetScreenJoystickPatchString() const { return
+    virtual String GetScreenJoystickPatchString() const override { return
         "<patch>"
         "    <remove sel=\"/element/element[./attribute[@name='Name' and @value='Button0']]/attribute[@name='Is Visible']\" />"
         "    <replace sel=\"/element/element[./attribute[@name='Name' and @value='Button0']]/element[./attribute[@name='Name' and @value='Label']]/attribute[@name='Text']/@value\">Spawn</replace>"

+ 1 - 1
Source/Samples/14_SoundEffects/SoundEffects.cpp

@@ -60,7 +60,7 @@ URHO3D_DEFINE_APPLICATION_MAIN(SoundEffects)
 
 SoundEffects::SoundEffects(Context* context) :
     Sample(context),
-    musicSource_(0)
+    musicSource_(nullptr)
 {
 }
 

+ 3 - 3
Source/Samples/14_SoundEffects/SoundEffects.h

@@ -46,16 +46,16 @@ public:
     SoundEffects(Context* context);
 
     /// Setup before engine initialization. Modifies the engine parameters.
-    virtual void Setup();
+    virtual void Setup() override;
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 protected:
 
     SoundSource* musicSource_;
 
     /// Return XML patch instructions for screen joystick layout for a specific sample app, if any.
-    virtual String GetScreenJoystickPatchString() const { return
+    virtual String GetScreenJoystickPatchString() const override { return
         "<patch>"
         "    <add sel=\"/element/element[./attribute[@name='Name' and @value='Button2']]\">"
         "        <attribute name=\"Is Visible\" value=\"false\" />"

+ 1 - 1
Source/Samples/15_Navigation/Navigation.cpp

@@ -348,7 +348,7 @@ Node* Navigation::CreateMushroom(const Vector3& pos)
 
 bool Navigation::Raycast(float maxDistance, Vector3& hitPos, Drawable*& hitDrawable)
 {
-    hitDrawable = 0;
+    hitDrawable = nullptr;
 
     UI* ui = GetSubsystem<UI>();
     IntVector2 pos = ui->GetCursorPosition();

+ 2 - 2
Source/Samples/15_Navigation/Navigation.h

@@ -50,11 +50,11 @@ public:
     Navigation(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 protected:
     /// Return XML patch instructions for screen joystick layout for a specific sample app, if any.
-    virtual String GetScreenJoystickPatchString() const { return
+    virtual String GetScreenJoystickPatchString() const override { return
         "<patch>"
         "    <add sel=\"/element\">"
         "        <element type=\"Button\">"

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

@@ -175,7 +175,7 @@ void Chat::UpdateButtons()
     bool serverRunning = network->IsServerRunning();
 
     // Show and hide buttons so that eg. Connect and Disconnect are never shown at the same time
-    sendButton_->SetVisible(serverConnection != 0);
+    sendButton_->SetVisible(serverConnection != nullptr);
     connectButton_->SetVisible(!serverConnection && !serverRunning);
     disconnectButton_->SetVisible(serverConnection || serverRunning);
     startServerButton_->SetVisible(!serverConnection && !serverRunning);
@@ -221,7 +221,7 @@ void Chat::HandleConnect(StringHash eventType, VariantMap& eventData)
     // Connect to server, do not specify a client scene as we are not using scene replication, just messages.
     // At connect time we could also send identity parameters (such as username) in a VariantMap, but in this
     // case we skip it for simplicity
-    network->Connect(address, CHAT_SERVER_PORT, 0);
+    network->Connect(address, CHAT_SERVER_PORT, nullptr);
 
     UpdateButtons();
 }

+ 2 - 2
Source/Samples/16_Chat/Chat.h

@@ -47,11 +47,11 @@ public:
     Chat(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 protected:
     /// Return XML patch instructions for screen joystick layout for a specific sample app, if any.
-    virtual String GetScreenJoystickPatchString() const { return
+    virtual String GetScreenJoystickPatchString() const override { return
         "<patch>"
         "    <add sel=\"/element/element[./attribute[@name='Name' and @value='Button2']]\">"
         "        <attribute name=\"Is Visible\" value=\"false\" />"

+ 2 - 2
Source/Samples/17_SceneReplication/SceneReplication.h

@@ -50,11 +50,11 @@ public:
     SceneReplication(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 protected:
     /// Return XML patch instructions for screen joystick layout for a specific sample app, if any.
-    virtual String GetScreenJoystickPatchString() const { return
+    virtual String GetScreenJoystickPatchString() const override { return
         "<patch>"
         "    <add sel=\"/element/element[./attribute[@name='Name' and @value='Hat0']]\">"
         "        <attribute name=\"Is Visible\" value=\"false\" />"

+ 2 - 2
Source/Samples/18_CharacterDemo/Character.h

@@ -53,9 +53,9 @@ public:
     static void RegisterObject(Context* context);
     
     /// Handle startup. Called by LogicComponent base class.
-    virtual void Start();
+    virtual void Start() override;
     /// Handle physics world update. Called by LogicComponent base class.
-    virtual void FixedUpdate(float timeStep);
+    virtual void FixedUpdate(float timeStep) override;
     
     /// Movement controls. Assigned by the main program each frame.
     Controls controls_;

+ 3 - 3
Source/Samples/18_CharacterDemo/CharacterDemo.h

@@ -51,14 +51,14 @@ public:
     /// Construct.
     CharacterDemo(Context* context);
     /// Destruct.
-    ~CharacterDemo();
+    virtual ~CharacterDemo() override;
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 protected:
     /// Return XML patch instructions for screen joystick layout for a specific sample app, if any.
-    virtual String GetScreenJoystickPatchString() const { return
+    virtual String GetScreenJoystickPatchString() const override { return
         "<patch>"
         "    <add sel=\"/element\">"
         "        <element type=\"Button\">"

+ 2 - 2
Source/Samples/19_VehicleDemo/Vehicle.h

@@ -59,9 +59,9 @@ public:
     static void RegisterObject(Context* context);
     
     /// Perform post-load after deserialization. Acquire the components from the scene nodes.
-    virtual void ApplyAttributes();
+    virtual void ApplyAttributes() override;
     /// Handle physics world update. Called by LogicComponent base class.
-    virtual void FixedUpdate(float timeStep);
+    virtual void FixedUpdate(float timeStep) override;
     
     /// Initialize the vehicle. Create rendering and physics components. Called by the application.
     void Init();

+ 1 - 1
Source/Samples/19_VehicleDemo/VehicleDemo.h

@@ -48,7 +48,7 @@ public:
     VehicleDemo(Context* context);
     
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
     
 private:
     /// Create static scene content.

+ 1 - 1
Source/Samples/20_HugeObjectCount/HugeObjectCount.cpp

@@ -126,7 +126,7 @@ void HugeObjectCount::CreateScene()
         light->SetSpecularIntensity(1.5f);
 
         // Create StaticModelGroups in the scene
-        StaticModelGroup* lastGroup = 0;
+        StaticModelGroup* lastGroup = nullptr;
 
         for (int y = -125; y < 125; ++y)
         {

+ 2 - 2
Source/Samples/20_HugeObjectCount/HugeObjectCount.h

@@ -48,11 +48,11 @@ public:
     HugeObjectCount(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 protected:
     /// Return XML patch instructions for screen joystick layout for a specific sample app, if any.
-    virtual String GetScreenJoystickPatchString() const { return
+    virtual String GetScreenJoystickPatchString() const override { return
         "<patch>"
         "    <remove sel=\"/element/element[./attribute[@name='Name' and @value='Button0']]/attribute[@name='Is Visible']\" />"
         "    <replace sel=\"/element/element[./attribute[@name='Name' and @value='Button0']]/element[./attribute[@name='Name' and @value='Label']]/attribute[@name='Text']/@value\">Group</replace>"

+ 1 - 1
Source/Samples/21_AngelScriptIntegration/AngelScriptIntegration.h

@@ -45,7 +45,7 @@ public:
     AngelScriptIntegration(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 private:
     /// Construct the scene content.

+ 1 - 1
Source/Samples/22_LuaIntegration/LuaIntegration.h

@@ -45,7 +45,7 @@ public:
     LuaIntegration(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 private:
     /// Construct the scene content.

+ 1 - 1
Source/Samples/23_Water/Water.h

@@ -47,7 +47,7 @@ public:
     Water(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 private:
     /// Construct the scene content.

+ 2 - 2
Source/Samples/24_Urho2DSprite/Urho2DSprite.h

@@ -44,11 +44,11 @@ public:
     Urho2DSprite(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 protected:
     /// Return XML patch instructions for screen joystick layout for a specific sample app, if any.
-    virtual String GetScreenJoystickPatchString() const { return
+    virtual String GetScreenJoystickPatchString() const override { return
         "<patch>"
         "    <remove sel=\"/element/element[./attribute[@name='Name' and @value='Button0']]/attribute[@name='Is Visible']\" />"
         "    <replace sel=\"/element/element[./attribute[@name='Name' and @value='Button0']]/element[./attribute[@name='Name' and @value='Label']]/attribute[@name='Text']/@value\">Zoom In</replace>"

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

@@ -44,11 +44,11 @@ public:
     Urho2DParticle(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 protected:
     /// Return XML patch instructions for screen joystick layout for a specific sample app, if any.
-    virtual String GetScreenJoystickPatchString() const { return
+    virtual String GetScreenJoystickPatchString() const override { return
         "<patch>"
         "    <add sel=\"/element/element[./attribute[@name='Name' and @value='Hat0']]\">"
         "        <attribute name=\"Is Visible\" value=\"false\" />"

+ 2 - 2
Source/Samples/26_ConsoleInput/ConsoleInput.h

@@ -38,11 +38,11 @@ public:
     ConsoleInput(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 protected:
     /// Return XML patch instructions for screen joystick layout for a specific sample app, if any.
-    virtual String GetScreenJoystickPatchString() const { return
+    virtual String GetScreenJoystickPatchString() const override { return
         "<patch>"
         "    <add sel=\"/element/element[./attribute[@name='Name' and @value='Button2']]\">"
         "        <attribute name=\"Is Visible\" value=\"false\" />"

+ 2 - 2
Source/Samples/27_Urho2DPhysics/Urho2DPhysics.h

@@ -43,11 +43,11 @@ public:
     Urho2DPhysics(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 protected:
     /// Return XML patch instructions for screen joystick layout for a specific sample app, if any.
-    virtual String GetScreenJoystickPatchString() const { return
+    virtual String GetScreenJoystickPatchString() const override { return
         "<patch>"
         "    <remove sel=\"/element/element[./attribute[@name='Name' and @value='Button0']]/attribute[@name='Is Visible']\" />"
         "    <replace sel=\"/element/element[./attribute[@name='Name' and @value='Button0']]/element[./attribute[@name='Name' and @value='Label']]/attribute[@name='Text']/@value\">Zoom In</replace>"

+ 2 - 2
Source/Samples/28_Urho2DPhysicsRope/Urho2DPhysicsRope.h

@@ -45,11 +45,11 @@ public:
     Urho2DPhysicsRope(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 protected:
     /// Return XML patch instructions for screen joystick layout for a specific sample app, if any.
-    virtual String GetScreenJoystickPatchString() const { return
+    virtual String GetScreenJoystickPatchString() const override { return
         "<patch>"
         "    <remove sel=\"/element/element[./attribute[@name='Name' and @value='Button0']]/attribute[@name='Is Visible']\" />"
         "    <replace sel=\"/element/element[./attribute[@name='Name' and @value='Button0']]/element[./attribute[@name='Name' and @value='Label']]/attribute[@name='Text']/@value\">Zoom In</replace>"

+ 3 - 3
Source/Samples/29_SoundSynthesis/SoundSynthesis.h

@@ -44,13 +44,13 @@ public:
     SoundSynthesis(Context* context);
 
     /// Setup before engine initialization. Modifies the engine parameters.
-    virtual void Setup();
+    virtual void Setup() override;
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 protected:
     /// Return XML patch instructions for screen joystick layout for a specific sample app, if any.
-    virtual String GetScreenJoystickPatchString() const { return
+    virtual String GetScreenJoystickPatchString() const override { return
         "<patch>"
         "    <add sel=\"/element/element[./attribute[@name='Name' and @value='Button2']]\">"
         "        <attribute name=\"Is Visible\" value=\"false\" />"

+ 1 - 1
Source/Samples/30_LightAnimation/LightAnimation.h

@@ -44,7 +44,7 @@ public:
     LightAnimation(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 private:
     /// Construct the scene content.

+ 1 - 1
Source/Samples/31_MaterialAnimation/MaterialAnimation.h

@@ -44,7 +44,7 @@ public:
     MaterialAnimation(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 private:
     /// Construct the scene content.

+ 2 - 2
Source/Samples/32_Urho2DConstraints/Urho2DConstraints.cpp

@@ -537,7 +537,7 @@ void Urho2DConstraints::HandleMouseButtonUp(StringHash eventType, VariantMap& ev
         staticSprite->SetColor(Color(1.0f, 1.0f, 1.0f, 1.0f)); // Restore picked sprite color
 
         pickedNode->RemoveComponent<ConstraintMouse2D>(); // Remove temporary constraint
-        pickedNode = NULL;
+        pickedNode = nullptr;
     }
     UnsubscribeFromEvent(E_MOUSEMOVE);
     UnsubscribeFromEvent(E_MOUSEBUTTONUP);
@@ -607,7 +607,7 @@ void Urho2DConstraints::HandleTouchEnd3(StringHash eventType, VariantMap& eventD
         staticSprite->SetColor(Color(1.0f, 1.0f, 1.0f, 1.0f)); // Restore picked sprite color
 
         pickedNode->RemoveComponent<ConstraintMouse2D>(); // Remove temporary constraint
-        pickedNode = NULL;
+        pickedNode = nullptr;
     }
     UnsubscribeFromEvent(E_TOUCHMOVE);
     UnsubscribeFromEvent(E_TOUCHEND);

+ 2 - 2
Source/Samples/32_Urho2DConstraints/Urho2DConstraints.h

@@ -59,11 +59,11 @@ public:
     Urho2DConstraints(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 protected:
     /// Return XML patch instructions for screen joystick layout for a specific sample app, if any.
-    virtual String GetScreenJoystickPatchString() const { return
+    virtual String GetScreenJoystickPatchString() const override { return
         "<patch>"
         "    <remove sel=\"/element/element[./attribute[@name='Name' and @value='Button0']]/attribute[@name='Is Visible']\" />"
         "    <replace sel=\"/element/element[./attribute[@name='Name' and @value='Button0']]/element[./attribute[@name='Name' and @value='Label']]/attribute[@name='Text']/@value\">Zoom In</replace>"

+ 2 - 2
Source/Samples/33_Urho2DSpriterAnimation/Urho2DSpriterAnimation.h

@@ -44,11 +44,11 @@ public:
     Urho2DSpriterAnimation(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 protected:
     /// Return XML patch instructions for screen joystick layout for a specific sample app, if any.
-    virtual String GetScreenJoystickPatchString() const { return
+    virtual String GetScreenJoystickPatchString() const override { return
         "<patch>"
         "    <remove sel=\"/element/element[./attribute[@name='Name' and @value='Button0']]/attribute[@name='Is Visible']\" />"
         "    <replace sel=\"/element/element[./attribute[@name='Name' and @value='Button0']]/element[./attribute[@name='Name' and @value='Label']]/attribute[@name='Text']/@value\">Zoom In</replace>"

+ 2 - 2
Source/Samples/34_DynamicGeometry/DynamicGeometry.h

@@ -46,11 +46,11 @@ public:
     DynamicGeometry(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 protected:
     /// Return XML patch instructions for screen joystick layout for a specific sample app, if any.
-    virtual String GetScreenJoystickPatchString() const { return
+    virtual String GetScreenJoystickPatchString() const override { return
         "<patch>"
         "    <remove sel=\"/element/element[./attribute[@name='Name' and @value='Button0']]/attribute[@name='Is Visible']\" />"
         "    <replace sel=\"/element/element[./attribute[@name='Name' and @value='Button0']]/element[./attribute[@name='Name' and @value='Label']]/attribute[@name='Text']/@value\">Animation</replace>"

+ 1 - 1
Source/Samples/35_SignedDistanceFieldText/SignedDistanceFieldText.h

@@ -47,7 +47,7 @@ public:
     SignedDistanceFieldText(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 private:
     /// Construct the scene content.

+ 1 - 1
Source/Samples/36_Urho2DTileMap/Urho2DTileMap.cpp

@@ -215,7 +215,7 @@ void Urho2DTileMap::HandleMouseButtonDown(StringHash eventType, VariantMap& even
                 sprite->SetSprite(layer->GetTile(0, 0)->GetSprite()); // Replace grass by water sprite used in top tile
             else sprite->SetSprite(layer->GetTile(24, 24)->GetSprite()); // Replace water by grass sprite used in bottom tile
         }
-        else sprite->SetSprite(NULL); // 'Remove' sprite
+        else sprite->SetSprite(nullptr); // 'Remove' sprite
     }
 }
 

+ 2 - 2
Source/Samples/36_Urho2DTileMap/Urho2DTileMap.h

@@ -39,11 +39,11 @@ public:
     Urho2DTileMap(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 protected:
     /// Return XML patch instructions for screen joystick layout for a specific sample app, if any.
-    virtual String GetScreenJoystickPatchString() const { return
+    virtual String GetScreenJoystickPatchString() const override { return
         "<patch>"
         "    <remove sel=\"/element/element[./attribute[@name='Name' and @value='Button0']]/attribute[@name='Is Visible']\" />"
         "    <replace sel=\"/element/element[./attribute[@name='Name' and @value='Button0']]/element[./attribute[@name='Name' and @value='Label']]/attribute[@name='Text']/@value\">Zoom In</replace>"

+ 2 - 2
Source/Samples/37_UIDrag/UIDrag.h

@@ -45,11 +45,11 @@ public:
     UIDrag(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 protected:
     /// Return XML patch instructions for screen joystick layout for a specific sample app, if any.
-    virtual String GetScreenJoystickPatchString() const { return
+    virtual String GetScreenJoystickPatchString() const override { return
         "<patch>"
         "    <add sel=\"/element/element[./attribute[@name='Name' and @value='Hat0']]\">"
         "        <attribute name=\"Is Visible\" value=\"false\" />"

+ 1 - 1
Source/Samples/38_SceneAndUILoad/SceneAndUILoad.h

@@ -47,7 +47,7 @@ public:
     SceneAndUILoad(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 private:
     /// Construct the scene content.

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

@@ -381,7 +381,7 @@ void CrowdNavigation::AddOrRemoveObject()
 
 bool CrowdNavigation::Raycast(float maxDistance, Vector3& hitPos, Drawable*& hitDrawable)
 {
-    hitDrawable = 0;
+    hitDrawable = nullptr;
 
     UI* ui = GetSubsystem<UI>();
     IntVector2 pos = ui->GetCursorPosition();

+ 2 - 2
Source/Samples/39_CrowdNavigation/CrowdNavigation.h

@@ -52,11 +52,11 @@ public:
     CrowdNavigation(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 protected:
     /// Return XML patch instructions for screen joystick layout for a specific sample app, if any.
-    virtual String GetScreenJoystickPatchString() const { return
+    virtual String GetScreenJoystickPatchString() const override { return
         "<patch>"
         "    <add sel=\"/element\">"
         "        <element type=\"Button\">"

+ 1 - 1
Source/Samples/40_Localization/L10n.h

@@ -38,7 +38,7 @@ public:
     L10n(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 private:
     // Load strings from JSON files and subscribe to the change language event

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

@@ -38,7 +38,7 @@ URHO3D_DEFINE_APPLICATION_MAIN(DatabaseDemo)
 
 DatabaseDemo::DatabaseDemo(Context* context) :
     Sample(context),
-    connection_(0),
+    connection_(nullptr),
     row_(0),
     maxRows_(50)
 {
@@ -49,7 +49,7 @@ DatabaseDemo::~DatabaseDemo()
     // Although the managed database connection will be disconnected by Database subsystem automatically in its destructor,
     // it is a good practice for a class to balance the number of connect() and disconnect() calls.
     GetSubsystem<Database>()->Disconnect(connection_);
-    connection_ = 0;
+    connection_ = nullptr;
 }
 
 void DatabaseDemo::Start()

+ 3 - 3
Source/Samples/41_DatabaseDemo/DatabaseDemo.h

@@ -33,14 +33,14 @@ public:
     /// Construct.
     DatabaseDemo(Context* context);
     /// Destruct.
-    virtual ~DatabaseDemo();
+    virtual ~DatabaseDemo() override;
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 protected:
     /// Return XML patch instructions for screen joystick layout for a specific sample app, if any.
-    virtual String GetScreenJoystickPatchString() const { return
+    virtual String GetScreenJoystickPatchString() const override { return
         "<patch>"
         "    <add sel=\"/element/element[./attribute[@name='Name' and @value='Button2']]\">"
         "        <attribute name=\"Is Visible\" value=\"false\" />"

+ 4 - 4
Source/Samples/42_PBRMaterials/PBRMaterials.cpp

@@ -48,10 +48,10 @@ URHO3D_DEFINE_APPLICATION_MAIN(PBRMaterials)
 
 PBRMaterials::PBRMaterials(Context* context) :
     Sample(context),
-    dynamicMaterial_(0),
-    roughnessLabel_(0),
-    metallicLabel_(0),
-    ambientLabel_(0)
+    dynamicMaterial_(nullptr),
+    roughnessLabel_(nullptr),
+    metallicLabel_(nullptr),
+    ambientLabel_(nullptr)
 {
 }
 

+ 1 - 1
Source/Samples/42_PBRMaterials/PBRMaterials.h

@@ -49,7 +49,7 @@ public:
     PBRMaterials(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 private:
     /// Construct the scene content.

+ 2 - 2
Source/Samples/43_HttpRequestDemo/HttpRequestDemo.h

@@ -42,11 +42,11 @@ public:
     HttpRequestDemo(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 protected:
     /// Return XML patch instructions for screen joystick layout for a specific sample app, if any.
-    virtual String GetScreenJoystickPatchString() const { return
+    virtual String GetScreenJoystickPatchString() const override { return
         "<patch>"
         "    <add sel=\"/element/element[./attribute[@name='Name' and @value='Hat0']]\">"
         "        <attribute name=\"Is Visible\" value=\"false\" />"

+ 1 - 1
Source/Samples/44_RibbonTrailDemo/RibbonTrailDemo.h

@@ -44,7 +44,7 @@ public:
     RibbonTrailDemo(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 protected:
     /// Trail that emitted from sword.

+ 1 - 1
Source/Samples/45_InverseKinematics/InverseKinematics.h

@@ -44,7 +44,7 @@ public:
     InverseKinematics(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 protected:
     /// Animation controller of Jack.

+ 1 - 1
Source/Samples/46_RaycastVehicle/RaycastVehicleDemo.h

@@ -48,7 +48,7 @@ public:
     RaycastVehicleDemo(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 private:
     /// Create static scene content.

+ 4 - 4
Source/Samples/46_RaycastVehicle/Vehicle.h

@@ -54,21 +54,21 @@ public :
     /// Construct.
     Vehicle(Context* context);
     /// Destruct.
-    ~Vehicle();
+    virtual ~Vehicle() override;
 
     /// Register object factory and attributes.
     static void RegisterObject(Context* context);
 
     /// Perform post-load after deserialization. Acquire the components from the scene nodes.
-    virtual void ApplyAttributes();
+    virtual void ApplyAttributes() override;
 
     /// Initialize the vehicle. Create rendering and physics components. Called by the application.
     void Init();
 
     /// Handle physics world update. Called by LogicComponent base class.
-    virtual void FixedUpdate(float timeStep);
+    virtual void FixedUpdate(float timeStep) override;
     /// Updating wheel effects here.
-    virtual void PostUpdate(float timeStep);
+    virtual void PostUpdate(float timeStep) override;
 
     /// Movement controls.
     Controls controls_;

+ 3 - 3
Source/Samples/47_Typography/Typography.cpp

@@ -97,7 +97,7 @@ void Typography::Start()
         "FONT_HINT_LEVEL_NONE",
         "FONT_HINT_LEVEL_LIGHT",
         "FONT_HINT_LEVEL_NORMAL",
-        NULL
+        nullptr
     };
     CreateMenu("UI::SetFontHintLevel", levels, URHO3D_HANDLER(Typography, HandleFontHintLevel))
         ->SetSelection(ui->GetFontHintLevel());
@@ -112,7 +112,7 @@ void Typography::Start()
         "15",
         "18",
         "21",
-        NULL
+        nullptr
     };
     CreateMenu("UI::SetFontSubpixelThreshold", thresholds, URHO3D_HANDLER(Typography, HandleFontSubpixel))
         ->SetSelection(ui->GetFontSubpixelThreshold() / 3);
@@ -127,7 +127,7 @@ void Typography::Start()
         "6",
         "7",
         "8",
-        NULL
+        nullptr
     };
     CreateMenu("UI::SetFontOversampling", limits, URHO3D_HANDLER(Typography, HandleFontOversampling))
         ->SetSelection(ui->GetFontOversampling() - 1);

+ 2 - 2
Source/Samples/47_Typography/Typography.h

@@ -35,11 +35,11 @@ public:
     Typography(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 protected:
     /// Return XML patch instructions for screen joystick layout for a specific sample app, if any.
-    virtual String GetScreenJoystickPatchString() const { return
+    virtual String GetScreenJoystickPatchString() const override { return
         "<patch>"
         "    <add sel=\"/element/element[./attribute[@name='Name' and @value='Hat0']]\">"
         "        <attribute name=\"Is Visible\" value=\"false\" />"

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

@@ -42,11 +42,11 @@ public:
     Hello3DUI(Context* context);
 
     /// Setup after engine initialization and before running the main loop.
-    virtual void Start();
+    virtual void Start() override;
 
 protected:
     /// Return XML patch instructions for screen joystick layout for a specific sample app, if any.
-    virtual String GetScreenJoystickPatchString() const { return
+    virtual String GetScreenJoystickPatchString() const override { return
         "<patch>"
         "    <add sel=\"/element/element[./attribute[@name='Name' and @value='Hat0']]\">"
         "        <attribute name=\"Is Visible\" value=\"false\" />"

+ 3 - 3
Source/Samples/Sample.h

@@ -59,11 +59,11 @@ public:
     Sample(Context* context);
 
     /// Setup before engine initialization. Modifies the engine parameters.
-    virtual void Setup();
+    virtual void Setup() override;
     /// Setup after engine initialization. Creates the logo, console & debug HUD.
-    virtual void Start();
+    virtual void Start() override;
     /// Cleanup after the main loop. Called by Application.
-    virtual void Stop();
+    virtual void Stop() override;
 
 protected:
     /// Return XML patch instructions for screen joystick layout for a specific sample app, if any.

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

@@ -61,7 +61,7 @@ using namespace Urho3D;
 struct OutModel
 {
     OutModel() :
-        rootBone_(0),
+        rootBone_(nullptr),
         totalVertices_(0),
         totalIndices_(0)
     {
@@ -144,8 +144,8 @@ const char *transformSuffix[TransformationComp_MAXIMUM] =
 static const unsigned MAX_CHANNELS = 4;
 
 SharedPtr<Context> context_(new Context());
-const aiScene* scene_ = 0;
-aiNode* rootNode_ = 0;
+const aiScene* scene_ = nullptr;
+aiNode* rootNode_ = nullptr;
 String inputName_;
 String resourcePath_;
 String outPath_;
@@ -193,10 +193,10 @@ void CollectMeshes(OutModel& model, aiNode* node);
 void CollectBones(OutModel& model, bool animationOnly = false);
 void CollectBonesFinal(PODVector<aiNode*>& dest, const HashSet<aiNode*>& necessary, aiNode* node);
 void MoveToBindPose(OutModel& model, aiNode* current);
-void CollectAnimations(OutModel* model = 0);
+void CollectAnimations(OutModel* model = nullptr);
 void BuildBoneCollisionInfo(OutModel& model);
 void BuildAndSaveModel(OutModel& model);
-void BuildAndSaveAnimations(OutModel* model = 0);
+void BuildAndSaveAnimations(OutModel* model = nullptr);
 
 void ExportScene(const String& outName, bool asPrefab);
 void CollectSceneModels(OutScene& scene, aiNode* node);
@@ -527,7 +527,7 @@ void Run(const Vector<String>& arguments)
             aiSetImportPropertyInteger(aiprops, AI_CONFIG_IMPORT_FBX_PRESERVE_PIVOTS, 0);                //**false, default = true;
             aiSetImportPropertyInteger(aiprops, AI_CONFIG_IMPORT_FBX_OPTIMIZE_EMPTY_ANIMATION_CURVES, 1);//default = true;
 
-            scene_ = aiImportFileExWithProperties(GetNativePath(inFile).CString(), flags, NULL, aiprops);
+            scene_ = aiImportFileExWithProperties(GetNativePath(inFile).CString(), flags, nullptr, aiprops);
 
             // prevent processing animation suppression, both cannot work simultaneously
             suppressFbxPivotNodes_ = false;
@@ -744,7 +744,7 @@ void CollectBones(OutModel& model, bool animationOnly)
         aiMesh* mesh = model.meshes_[i];
         aiNode* meshNode = model.meshNodes_[i];
         aiNode* meshParentNode = meshNode->mParent;
-        aiNode* rootNode = 0;
+        aiNode* rootNode = nullptr;
 
         for (unsigned j = 0; j < mesh->mNumBones; ++j)
         {
@@ -1307,7 +1307,7 @@ void BuildAndSaveAnimations(OutModel* model)
         {
             aiNodeAnim* channel = anim->mChannels[j];
             String channelName = FromAIString(channel->mNodeName);
-            aiNode* boneNode = 0;
+            aiNode* boneNode = nullptr;
 
             if (model)
             {
@@ -1331,7 +1331,7 @@ void BuildAndSaveAnimations(OutModel* model)
 
                     // every first $fbx animation channel for a bone will consolidate other $fbx animation to a single channel
                     // skip subsequent $fbx animation channel for the same bone
-                    if (outAnim->GetTrack(channelName) != NULL)
+                    if (outAnim->GetTrack(channelName) != nullptr)
                         continue;
 
                     boneIndex = GetPivotlessBoneIndex(*model, channelName);
@@ -1674,7 +1674,7 @@ void BuildAndSaveScene(OutScene& scene, bool asPrefab)
 
     HashMap<aiNode*, Node*> nodeMapping;
 
-    Node* outRootNode = 0;
+    Node* outRootNode = nullptr;
     if (asPrefab)
         outRootNode = CreateSceneNode(outScene, rootNode_, nodeMapping);
     else
@@ -2181,7 +2181,7 @@ aiBone* GetMeshBone(OutModel& model, const String& boneName)
                 return bone;
         }
     }
-    return 0;
+    return nullptr;
 }
 
 Matrix3x4 GetOffsetMatrix(OutModel& model, const String& boneName)
@@ -2529,7 +2529,7 @@ PODVector<VertexElement> GetVertexElements(aiMesh* mesh, bool isSkinned)
 aiNode* GetNode(const String& name, aiNode* rootNode, bool caseSensitive)
 {
     if (!rootNode)
-        return 0;
+        return nullptr;
     if (!name.Compare(rootNode->mName.data, caseSensitive))
         return rootNode;
     for (unsigned i = 0; i < rootNode->mNumChildren; ++i)
@@ -2538,7 +2538,7 @@ aiNode* GetNode(const String& name, aiNode* rootNode, bool caseSensitive)
         if (found)
             return found;
     }
-    return 0;
+    return nullptr;
 }
 
 aiMatrix4x4 GetDerivedTransform(aiNode* node, aiNode* rootNode, bool rootInclusive)

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

@@ -959,7 +959,7 @@ void WriteOutput(const String& outputFileName, bool exportAnimations, bool rotat
                 while (track)
                 {
                     String trackName = track.GetAttribute("bone");
-                    ModelBone* bone = 0;
+                    ModelBone* bone = nullptr;
                     for (unsigned i = 0; i < bones_.Size(); ++i)
                     {
                         if (bones_[i].name_ == trackName)

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

@@ -79,7 +79,7 @@ public:
     {
     }
 
-    ~PackerInfo() {}
+    virtual ~PackerInfo() override {}
 };
 
 void Help()

+ 3 - 3
Source/Tools/Urho3DPlayer/Urho3DPlayer.h

@@ -36,11 +36,11 @@ public:
     Urho3DPlayer(Context* context);
 
     /// Setup before engine initialization. Verify that a script file has been specified.
-    virtual void Setup();
+    virtual void Setup() override;
     /// Setup after engine initialization. Load the script and execute its start function.
-    virtual void Start();
+    virtual void Start() override;
     /// Cleanup after the main loop. Run the script's stop function if it exists.
-    virtual void Stop();
+    virtual void Stop() override;
 
 private:
     /// Handle reload start of the script file.

+ 10 - 10
Source/Urho3D/AngelScript/APITemplates.h

@@ -77,7 +77,7 @@ template <class T> CScriptArray* VectorToArray(const Vector<T>& vector, const ch
         return arr;
     }
     else
-        return 0;
+        return nullptr;
 }
 
 /// Template function for PODVector to array conversion.
@@ -95,7 +95,7 @@ template <class T> CScriptArray* VectorToArray(const PODVector<T>& vector, const
         return arr;
     }
     else
-        return 0;
+        return nullptr;
 }
 
 /// Template function for data buffer to array conversion.
@@ -113,7 +113,7 @@ template <class T> CScriptArray* BufferToArray(const T* buffer, unsigned size, c
         return arr;
     }
     else
-        return 0;
+        return nullptr;
 }
 
 /// Template function for Vector to handle array conversion.
@@ -137,7 +137,7 @@ template <class T> CScriptArray* VectorToHandleArray(const Vector<T*>& vector, c
         return arr;
     }
     else
-        return 0;
+        return nullptr;
 }
 
 /// Template function for PODVector to handle array conversion.
@@ -161,7 +161,7 @@ template <class T> CScriptArray* VectorToHandleArray(const PODVector<T*>& vector
         return arr;
     }
     else
-        return 0;
+        return nullptr;
 }
 
 /// Template function for shared pointer Vector to handle array conversion.
@@ -185,7 +185,7 @@ template <class T> CScriptArray* VectorToHandleArray(const Vector<SharedPtr<T> >
         return arr;
     }
     else
-        return 0;
+        return nullptr;
 }
 
 /// Template function for array to Vector conversion.
@@ -540,7 +540,7 @@ static Component* NodeGetComponent(unsigned index, Node* ptr)
     if (index >= components.Size())
     {
         GetActiveASContext()->SetException("Index out of bounds");
-        return 0;
+        return nullptr;
     }
     else
         return components[index];
@@ -615,7 +615,7 @@ static Node* NodeGetChild(unsigned index, Node* ptr)
     if (index >= children.Size())
     {
         GetActiveASContext()->SetException("Index out of bounds");
-        return 0;
+        return nullptr;
     }
     else
         return children[index].Get();
@@ -1012,13 +1012,13 @@ static bool UIElementLoadXML(XMLFile* file, XMLFile* styleFile, UIElement* ptr)
 static UIElement* UIElementLoadChildXML(XMLFile* file, XMLFile* styleFile, UIElement* ptr)
 {
     if (!file)
-        return 0;
+        return nullptr;
 
     XMLElement rootElem = file->GetRoot("element");
     if (rootElem)
         return ptr->LoadChildXML(rootElem, styleFile);
     else
-        return 0;
+        return nullptr;
 }
 
 static bool UIElementSaveXML(File* file, const String& indentation, UIElement* ptr)

+ 42 - 42
Source/Urho3D/AngelScript/Addons.cpp

@@ -87,12 +87,12 @@ CScriptArray* CScriptArray::Create(asITypeInfo *ot, asUINT length)
 
     // Allocate the memory
     void *mem = userAlloc(sizeof(CScriptArray));
-    if( mem == 0 )
+    if( mem == nullptr )
     {
         if( ctx )
             ctx->SetException("Out of memory");
 
-        return 0;
+        return nullptr;
     }
 
     // Initialize the object
@@ -103,7 +103,7 @@ CScriptArray* CScriptArray::Create(asITypeInfo *ot, asUINT length)
     if( ctx && ctx->GetState() == asEXECUTION_EXCEPTION )
     {
         a->Release();
-        return 0;
+        return nullptr;
     }
 
     return a;
@@ -115,12 +115,12 @@ CScriptArray* CScriptArray::Create(asITypeInfo *ot, void *initList)
 
     // Allocate the memory
     void *mem = userAlloc(sizeof(CScriptArray));
-    if( mem == 0 )
+    if( mem == nullptr )
     {
         if( ctx )
             ctx->SetException("Out of memory");
 
-        return 0;
+        return nullptr;
     }
 
     // Initialize the object
@@ -131,7 +131,7 @@ CScriptArray* CScriptArray::Create(asITypeInfo *ot, void *initList)
     if( ctx && ctx->GetState() == asEXECUTION_EXCEPTION )
     {
         a->Release();
-        return 0;
+        return nullptr;
     }
 
     return a;
@@ -143,12 +143,12 @@ CScriptArray* CScriptArray::Create(asITypeInfo *ot, asUINT length, void *defVal)
 
     // Allocate the memory
     void *mem = userAlloc(sizeof(CScriptArray));
-    if( mem == 0 )
+    if( mem == nullptr )
     {
         if( ctx )
             ctx->SetException("Out of memory");
 
-        return 0;
+        return nullptr;
     }
 
     // Initialize the object
@@ -159,7 +159,7 @@ CScriptArray* CScriptArray::Create(asITypeInfo *ot, asUINT length, void *defVal)
     if( ctx && ctx->GetState() == asEXECUTION_EXCEPTION )
     {
         a->Release();
-        return 0;
+        return nullptr;
     }
 
     return a;
@@ -312,7 +312,7 @@ CScriptArray::CScriptArray(asITypeInfo *ot, void *buf)
     gcFlag = false;
     objType = ot;
     objType->AddRef();
-    buffer = 0;
+    buffer = nullptr;
 
     Precache();
 
@@ -402,7 +402,7 @@ CScriptArray::CScriptArray(asUINT length, asITypeInfo *ot)
     gcFlag = false;
     objType = ot;
     objType->AddRef();
-    buffer = 0;
+    buffer = nullptr;
 
     Precache();
 
@@ -435,7 +435,7 @@ CScriptArray::CScriptArray(const CScriptArray &other)
     gcFlag = false;
     objType = other.objType;
     objType->AddRef();
-    buffer = 0;
+    buffer = nullptr;
 
     Precache();
 
@@ -459,7 +459,7 @@ CScriptArray::CScriptArray(asUINT length, void *defVal, asITypeInfo *ot)
     gcFlag = false;
     objType = ot;
     objType->AddRef();
-    buffer = 0;
+    buffer = nullptr;
 
     Precache();
 
@@ -495,7 +495,7 @@ void CScriptArray::SetValue(asUINT index, void *value)
     // At() will take care of the out-of-bounds checking, though
     // if called from the application then nothing will be done
     void *ptr = At(index);
-    if( ptr == 0 ) return;
+    if( ptr == nullptr ) return;
 
     if( (subTypeId & ~asTYPEID_MASK_SEQNBR) && !(subTypeId & asTYPEID_OBJHANDLE) )
         objType->GetEngine()->AssignScriptObject(ptr, value, objType->GetSubType());
@@ -530,7 +530,7 @@ CScriptArray::~CScriptArray()
     if( buffer )
     {
         DeleteBuffer(buffer);
-        buffer = 0;
+        buffer = nullptr;
     }
     if( objType ) objType->Release();
 }
@@ -747,13 +747,13 @@ void CScriptArray::RemoveLast()
 // Return a pointer to the array element. Returns 0 if the index is out of bounds
 const void *CScriptArray::At(asUINT index) const
 {
-    if( buffer == 0 || index >= buffer->numElements )
+    if( buffer == nullptr || index >= buffer->numElements )
     {
         // If this is called from a script we raise a script exception
         asIScriptContext *ctx = asGetActiveContext();
         if( ctx )
             ctx->SetException("Index out of bounds");
-        return 0;
+        return nullptr;
     }
 
     if( (subTypeId & asTYPEID_MASK_OBJECT) && !(subTypeId & asTYPEID_OBJHANDLE) )
@@ -811,7 +811,7 @@ void CScriptArray::Construct(SArrayBuffer *buf, asUINT start, asUINT end)
         for( ; d < max; d++ )
         {
             *d = (void*)engine->CreateScriptObject(subType);
-            if( *d == 0 )
+            if( *d == nullptr )
             {
                 // Set the remaining entries to null so the destructor
                 // won't attempt to destroy invalid objects later
@@ -887,8 +887,8 @@ bool CScriptArray::Less(const void *a, const void *b, bool asc, asIScriptContext
         if( subTypeId & asTYPEID_OBJHANDLE )
         {
             // Allow sort to work even if the array contains null handles
-            if( *(void**)a == 0 ) return true;
-            if( *(void**)b == 0 ) return false;
+            if( *(void**)a == nullptr ) return true;
+            if( *(void**)b == nullptr ) return false;
         }
 
         // Execute object opCmp
@@ -945,7 +945,7 @@ bool CScriptArray::operator==(const CScriptArray &other) const
     if( GetSize() != other.GetSize() )
         return false;
 
-    asIScriptContext *cmpContext = 0;
+    asIScriptContext *cmpContext = nullptr;
     bool isNested = false;
 
     if( subTypeId & ~asTYPEID_MASK_SEQNBR )
@@ -957,9 +957,9 @@ bool CScriptArray::operator==(const CScriptArray &other) const
             if( cmpContext->GetEngine() == objType->GetEngine() && cmpContext->PushState() >= 0 )
                 isNested = true;
             else
-                cmpContext = 0;
+                cmpContext = nullptr;
         }
-        if( cmpContext == 0 )
+        if( cmpContext == nullptr )
         {
             // TODO: Ideally this context would be retrieved from a pool, so we don't have to
             //       create a new one every time. We could keep a context with the array object
@@ -1121,11 +1121,11 @@ int CScriptArray::Find(asUINT startAt, void *value) const
 {
     // Check if the subtype really supports find()
     // TODO: Can't this be done at compile time too by the template callback
-    SArrayCache *cache = 0;
+    SArrayCache *cache = nullptr;
     if( subTypeId & ~asTYPEID_MASK_SEQNBR )
     {
         cache = reinterpret_cast<SArrayCache*>(objType->GetUserData(ARRAY_CACHE));
-        if( !cache || (cache->cmpFunc == 0 && cache->eqFunc == 0) )
+        if( !cache || (cache->cmpFunc == nullptr && cache->eqFunc == nullptr) )
         {
             asIScriptContext *ctx = asGetActiveContext();
             asITypeInfo* subType = objType->GetEngine()->GetTypeInfoById(subTypeId);
@@ -1154,7 +1154,7 @@ int CScriptArray::Find(asUINT startAt, void *value) const
         }
     }
 
-    asIScriptContext *cmpContext = 0;
+    asIScriptContext *cmpContext = nullptr;
     bool isNested = false;
 
     if( subTypeId & ~asTYPEID_MASK_SEQNBR )
@@ -1166,9 +1166,9 @@ int CScriptArray::Find(asUINT startAt, void *value) const
             if( cmpContext->GetEngine() == objType->GetEngine() && cmpContext->PushState() >= 0 )
                 isNested = true;
             else
-                cmpContext = 0;
+                cmpContext = nullptr;
         }
-        if( cmpContext == 0 )
+        if( cmpContext == nullptr )
         {
             // TODO: Ideally this context would be retrieved from a pool, so we don't have to
             //       create a new one every time. We could keep a context with the array object
@@ -1273,7 +1273,7 @@ void CScriptArray::Sort(asUINT startAt, asUINT count, bool asc)
     SArrayCache *cache = reinterpret_cast<SArrayCache*>(objType->GetUserData(ARRAY_CACHE));
     if( subTypeId & ~asTYPEID_MASK_SEQNBR )
     {
-        if( !cache || cache->cmpFunc == 0 )
+        if( !cache || cache->cmpFunc == nullptr )
         {
             asIScriptContext *ctx = asGetActiveContext();
             asITypeInfo* subType = objType->GetEngine()->GetTypeInfoById(subTypeId);
@@ -1327,7 +1327,7 @@ void CScriptArray::Sort(asUINT startAt, asUINT count, bool asc)
     }
 
     asBYTE tmp[16];
-    asIScriptContext *cmpContext = 0;
+    asIScriptContext *cmpContext = nullptr;
     bool isNested = false;
 
     if( subTypeId & ~asTYPEID_MASK_SEQNBR )
@@ -1339,9 +1339,9 @@ void CScriptArray::Sort(asUINT startAt, asUINT count, bool asc)
             if( cmpContext->GetEngine() == objType->GetEngine() && cmpContext->PushState() >= 0 )
                 isNested = true;
             else
-                cmpContext = 0;
+                cmpContext = nullptr;
         }
-        if( cmpContext == 0 )
+        if( cmpContext == nullptr )
         {
             // TODO: Ideally this context would be retrieved from a pool, so we don't have to
             //       create a new one every time. We could keep a context with the array object
@@ -1520,7 +1520,7 @@ void CScriptArray::Precache()
                 {
                     if( cache->cmpFunc || cache->cmpFuncReturnCode )
                     {
-                        cache->cmpFunc = 0;
+                        cache->cmpFunc = nullptr;
                         cache->cmpFuncReturnCode = asMULTIPLE_FUNCTIONS;
                     }
                     else
@@ -1530,7 +1530,7 @@ void CScriptArray::Precache()
                 {
                     if( cache->eqFunc || cache->eqFuncReturnCode )
                     {
-                        cache->eqFunc = 0;
+                        cache->eqFunc = nullptr;
                         cache->eqFuncReturnCode = asMULTIPLE_FUNCTIONS;
                     }
                     else
@@ -1540,9 +1540,9 @@ void CScriptArray::Precache()
         }
     }
 
-    if( cache->eqFunc == 0 && cache->eqFuncReturnCode == 0 )
+    if( cache->eqFunc == nullptr && cache->eqFuncReturnCode == 0 )
         cache->eqFuncReturnCode = asNO_FUNCTION;
-    if( cache->cmpFunc == 0 && cache->cmpFuncReturnCode == 0 )
+    if( cache->cmpFunc == nullptr && cache->cmpFuncReturnCode == 0 )
         cache->cmpFuncReturnCode = asNO_FUNCTION;
 
     // Set the user data only at the end so others that retrieve it will know it is complete
@@ -1888,7 +1888,7 @@ const CScriptDictValue *CScriptDictionary::operator[](const String &key) const
     if( ctx )
         ctx->SetException("Invalid access to non-existing value");
 
-    return 0;
+    return nullptr;
 }
 
 void CScriptDictionary::Set(const String &key, void *value, int typeId)
@@ -2034,13 +2034,13 @@ void ScriptDictionaryListFactory_Generic(asIScriptGeneric *gen)
 
 CScriptDictValue::CScriptDictValue()
 {
-    m_valueObj = 0;
+    m_valueObj = nullptr;
     m_typeId   = 0;
 }
 
 CScriptDictValue::CScriptDictValue(asIScriptEngine *engine, void *value, int typeId)
 {
-    m_valueObj = 0;
+    m_valueObj = nullptr;
     m_typeId   = 0;
     Set(engine, value, typeId);
 }
@@ -2058,7 +2058,7 @@ void CScriptDictValue::FreeValue(asIScriptEngine *engine)
     {
         // Let the engine release the object
         engine->ReleaseScriptObject(m_valueObj, engine->GetTypeInfoById(m_typeId));
-        m_valueObj = 0;
+        m_valueObj = nullptr;
         m_typeId = 0;
     }
 
@@ -2117,7 +2117,7 @@ bool CScriptDictValue::Get(asIScriptEngine *engine, void *value, int typeId) con
         // A handle can be retrieved if the stored type is a handle of same or compatible type
         // or if the stored type is an object that implements the interface that the handle refer to.
         
-        void* cast = 0x0;
+        void* cast = nullptr;
         if ((m_typeId & asTYPEID_MASK_OBJECT) &&
             engine->RefCastObject(m_valueObj, engine->GetTypeInfoById(m_typeId), engine->GetTypeInfoById(typeId), &cast) >= 0)
         {
@@ -2306,7 +2306,7 @@ static char* StringCharAt(unsigned i, String& str)
         asIScriptContext* context = asGetActiveContext();
         if (context)
             context->SetException("Index out of bounds");
-        return 0;
+        return nullptr;
     }
     return &str[i];
 }

+ 3 - 3
Source/Urho3D/AngelScript/CoreAPI.cpp

@@ -385,11 +385,11 @@ static asIScriptObject* VariantGetScriptObject(Variant* ptr)
 {
     asIScriptObject* object = static_cast<asIScriptObject*>(ptr->GetVoidPtr());
     if (!object)
-        return 0;
+        return nullptr;
 
     asITypeInfo* scriptObjectInterface = object->GetEngine()->GetTypeInfoByName("ScriptObject");
     if (!object->GetObjectType()->Implements(scriptObjectInterface))
-        return 0;
+        return nullptr;
 
     return object;
 }
@@ -869,7 +869,7 @@ static Object* CreateObject(const String& objectType)
             return object;
         }
     }
-    return 0;
+    return nullptr;
 }
 
 static void SendEvent(const String& eventType, VariantMap& eventData)

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

@@ -56,7 +56,7 @@ static CScriptArray* DbResultGetRow(unsigned index, DbResult* ptr)
     if (index >= rows.Size())
     {
         asGetActiveContext()->SetException("Index out of bounds");
-        return 0;
+        return nullptr;
     }
     else
         return VectorToArray<Variant>(rows[index], "Array<Variant>");

+ 7 - 7
Source/Urho3D/AngelScript/GraphicsAPI.cpp

@@ -240,7 +240,7 @@ static RenderTargetInfo* RenderPathGetRenderTarget(unsigned index, RenderPath* p
         asIScriptContext* context = asGetActiveContext();
         if (context)
             context->SetException("Index out of bounds");
-        return 0;
+        return nullptr;
     }
     else
         return &ptr->renderTargets_[index];
@@ -253,7 +253,7 @@ static RenderPathCommand* RenderPathGetCommand(unsigned index, RenderPath* ptr)
         asIScriptContext* context = asGetActiveContext();
         if (context)
             context->SetException("Index out of bounds");
-        return 0;
+        return nullptr;
     }
     else
         return &ptr->commands_[index];
@@ -1035,7 +1035,7 @@ static AnimationKeyFrame* AnimationTrackGetKeyFrame(unsigned index, AnimationTra
         asIScriptContext* context = asGetActiveContext();
         if (context)
             context->SetException("Index out of bounds");
-        return 0;
+        return nullptr;
     }
     else
         return ptr->GetKeyFrame(index);
@@ -1063,7 +1063,7 @@ static AnimationTriggerPoint* AnimationGetTrigger(unsigned index, Animation* ptr
         asIScriptContext* context = asGetActiveContext();
         if (context)
             context->SetException("Index out of bounds");
-        return 0;
+        return nullptr;
     }
     else
         return ptr->GetTrigger(index);
@@ -1430,7 +1430,7 @@ static unsigned AnimationControllerGetNumAnimations(AnimationController* control
 static const AnimationControl* AnimationControllerGetAnimation(unsigned index, AnimationController* controller)
 {
     const Vector<AnimationControl>& animations = controller->GetAnimations();
-    return (index < animations.Size()) ? &animations[index] : (const AnimationControl*)0;
+    return (index < animations.Size()) ? &animations[index] : nullptr;
 }
 
 static void RegisterAnimationController(asIScriptEngine* engine)
@@ -2038,7 +2038,7 @@ static DebugRenderer* GetDebugRenderer()
     if (scene)
         return scene->GetComponent<DebugRenderer>();
     else
-        return 0;
+        return nullptr;
 }
 
 static DebugRenderer* SceneGetDebugRenderer(Scene* ptr)
@@ -2160,7 +2160,7 @@ static Octree* SceneGetOctree(Scene* ptr)
 static Octree* GetOctree()
 {
     Scene* scene = GetScriptContextScene();
-    return scene ? scene->GetComponent<Octree>() : 0;
+    return scene ? scene->GetComponent<Octree>() : nullptr;
 }
 
 static void RegisterOctree(asIScriptEngine* engine)

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

@@ -228,7 +228,7 @@ static unsigned char* VectorBufferAt(unsigned index, VectorBuffer* ptr)
     if (index >= ptr->GetSize())
     {
         asGetActiveContext()->SetException("Index out of bounds");
-        return 0;
+        return nullptr;
     }
 
     return ptr->GetModifiableData() + index;

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

@@ -43,7 +43,7 @@ static PhysicsWorld* SceneGetPhysicsWorld(Scene* ptr)
 static PhysicsWorld* GetPhysicsWorld()
 {
     Scene* scene = GetScriptContextScene();
-    return scene ? scene->GetComponent<PhysicsWorld>() : 0;
+    return scene ? scene->GetComponent<PhysicsWorld>() : nullptr;
 }
 
 static void ConstructPhysicsRaycastResult(PhysicsRaycastResult* ptr)

+ 5 - 5
Source/Urho3D/AngelScript/SceneAPI.cpp

@@ -212,7 +212,7 @@ static bool SceneSaveJSONVectorBuffer(VectorBuffer& buffer, const String& indent
 
 static Node* SceneInstantiate(File* file, const Vector3& position, const Quaternion& rotation, CreateMode mode, Scene* ptr)
 {
-    return file ? ptr->Instantiate(*file, position, rotation, mode) : 0;
+    return file ? ptr->Instantiate(*file, position, rotation, mode) : nullptr;
 }
 
 static Node* SceneInstantiateVectorBuffer(VectorBuffer& buffer, const Vector3& position, const Quaternion& rotation, CreateMode mode, Scene* ptr)
@@ -222,12 +222,12 @@ static Node* SceneInstantiateVectorBuffer(VectorBuffer& buffer, const Vector3& p
 
 static Node* SceneInstantiateXML(File* file, const Vector3& position, const Quaternion& rotation, CreateMode mode, Scene* ptr)
 {
-    return file ? ptr->InstantiateXML(*file, position, rotation, mode) : 0;
+    return file ? ptr->InstantiateXML(*file, position, rotation, mode) : nullptr;
 }
 
 static Node* SceneInstantiateJSON(File* file, const Vector3& position, const Quaternion& rotation, CreateMode mode, Scene* ptr)
 {
-    return file ? ptr->InstantiateJSON(*file, position, rotation, mode) : 0;
+    return file ? ptr->InstantiateJSON(*file, position, rotation, mode) : nullptr;
 }
 
 static Node* SceneInstantiateXMLVectorBuffer(VectorBuffer& buffer, const Vector3& position, const Quaternion& rotation, CreateMode mode, Scene* ptr)
@@ -242,12 +242,12 @@ static Node* SceneInstantiateJSONVectorBuffer(VectorBuffer& buffer, const Vector
 
 static Node* SceneInstantiateXMLFile(XMLFile* xml, const Vector3& position, const Quaternion& rotation, CreateMode mode, Scene* ptr)
 {
-    return xml ? ptr->InstantiateXML(xml->GetRoot(), position, rotation, mode) : 0;
+    return xml ? ptr->InstantiateXML(xml->GetRoot(), position, rotation, mode) : nullptr;
 }
 
 static Node* SceneInstantiateJSONFile(JSONFile* json, const Vector3& position, const Quaternion& rotation, CreateMode mode, Scene* ptr)
 {
-    return json ? ptr->InstantiateJSON(json->GetRoot(), position, rotation, mode) : 0;
+    return json ? ptr->InstantiateJSON(json->GetRoot(), position, rotation, mode) : nullptr;
 }
 
 static CScriptArray* SceneGetRequiredPackageFiles(Scene* ptr)

+ 7 - 7
Source/Urho3D/AngelScript/Script.cpp

@@ -50,7 +50,7 @@ class ScriptResourceRouter : public ResourceRouter
     }
 
     /// Check if request is for an AngelScript file and reroute to compiled version if necessary (.as file not available)
-    virtual void Route(String& name, ResourceRequest requestType)
+    virtual void Route(String& name, ResourceRequest requestType) override
     {
         String extension = GetExtension(name);
         if (extension == ".as")
@@ -68,8 +68,8 @@ class ScriptResourceRouter : public ResourceRouter
 
 Script::Script(Context* context) :
     Object(context),
-    scriptEngine_(0),
-    immediateContext_(0),
+    scriptEngine_(nullptr),
+    immediateContext_(nullptr),
     scriptNestingLevel_(0),
     executeConsoleCommands_(false)
 {
@@ -158,7 +158,7 @@ Script::~Script()
     if (immediateContext_)
     {
         immediateContext_->Release();
-        immediateContext_ = 0;
+        immediateContext_ = nullptr;
     }
 
     for (unsigned i = 0; i < scriptFileContexts_.Size(); ++i)
@@ -167,7 +167,7 @@ Script::~Script()
     if (scriptEngine_)
     {
         scriptEngine_->Release();
-        scriptEngine_ = 0;
+        scriptEngine_ = nullptr;
     }
 
     ResourceCache* cache = GetSubsystem<ResourceCache>();
@@ -185,7 +185,7 @@ bool Script::Execute(const String& line)
     String wrappedLine = "void f(){\n" + line + ";\n}";
 
     // If no immediate mode script file set, create a dummy module for compiling the line
-    asIScriptModule* module = 0;
+    asIScriptModule* module = nullptr;
     if (defaultScriptFile_)
         module = defaultScriptFile_->GetScriptModule();
     if (!module)
@@ -193,7 +193,7 @@ bool Script::Execute(const String& line)
     if (!module)
         return false;
 
-    asIScriptFunction* function = 0;
+    asIScriptFunction* function = nullptr;
     if (module->CompileFunction("", wrappedLine.CString(), -1, 0, &function) < 0)
         return false;
 

+ 1 - 1
Source/Urho3D/AngelScript/Script.h

@@ -61,7 +61,7 @@ public:
     /// Construct.
     Script(Context* context);
     /// Destruct. Release the AngelScript engine.
-    ~Script();
+    virtual ~Script() override;
 
     /// Compile and execute a line of script in immediate mode.
     bool Execute(const String& line);

+ 3 - 3
Source/Urho3D/AngelScript/ScriptAPI.cpp

@@ -61,7 +61,7 @@ static void ScriptFileDelayedExecute(float delay, bool repeat, const String& dec
 static asIScriptObject* NodeCreateScriptObjectWithFile(ScriptFile* file, const String& className, CreateMode mode, Node* ptr)
 {
     if (!file)
-        return 0;
+        return nullptr;
 
     // Try first to reuse an existing, empty ScriptInstance
     const Vector<SharedPtr<Component> >& components = ptr->GetComponents();
@@ -115,7 +115,7 @@ asIScriptObject* NodeGetScriptObject(Node* ptr)
         }
     }
 
-    return 0;
+    return nullptr;
 }
 
 asIScriptObject* NodeGetNamedScriptObject(const String& className, Node* ptr)
@@ -135,7 +135,7 @@ asIScriptObject* NodeGetNamedScriptObject(const String& className, Node* ptr)
         }
     }
 
-    return 0;
+    return nullptr;
 }
 
 static bool ScriptInstanceExecute(const String& declaration, CScriptArray* srcParams, ScriptInstance* ptr)

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

@@ -75,7 +75,7 @@ bool CompareHeaderFiles(const HeaderFile& lhs, const HeaderFile& rhs)
 void ExtractPropertyInfo(const String& functionName, const String& declaration, Vector<PropertyInfo>& propertyInfos)
 {
     String propertyName = functionName.Substring(4);
-    PropertyInfo* info = 0;
+    PropertyInfo* info = nullptr;
     for (unsigned k = 0; k < propertyInfos.Size(); ++k)
     {
         if (propertyInfos[k].name_ == propertyName)

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

@@ -51,13 +51,13 @@ public:
     }
 
     /// Read from stream (no-op).
-    virtual void Read(void* ptr, asUINT size)
+    virtual void Read(void* ptr, asUINT size) override
     {
         // No-op, can not read from a Serializer
     }
 
     /// Write to stream.
-    virtual void Write(const void* ptr, asUINT size)
+    virtual void Write(const void* ptr, asUINT size) override
     {
         dest_.Write(ptr, size);
     }
@@ -78,13 +78,13 @@ public:
     }
 
     /// Read from stream.
-    virtual void Read(void* ptr, asUINT size)
+    virtual void Read(void* ptr, asUINT size) override
     {
         source_.Read(ptr, size);
     }
 
     /// Write to stream (no-op).
-    virtual void Write(const void* ptr, asUINT size)
+    virtual void Write(const void* ptr, asUINT size) override
     {
     }
 
@@ -96,7 +96,7 @@ private:
 ScriptFile::ScriptFile(Context* context) :
     Resource(context),
     script_(GetSubsystem<Script>()),
-    scriptModule_(0),
+    scriptModule_(nullptr),
     compiled_(false),
     subscribed_(false)
 {
@@ -193,7 +193,7 @@ void ScriptFile::AddEventHandler(StringHash eventType, const String& handlerName
     if (!compiled_)
         return;
 
-    AddEventHandlerInternal(0, eventType, handlerName);
+    AddEventHandlerInternal(nullptr, eventType, handlerName);
 }
 
 void ScriptFile::AddEventHandler(Object* sender, StringHash eventType, const String& handlerName)
@@ -409,16 +409,16 @@ asIScriptObject* ScriptFile::CreateObject(const String& className, bool useInter
     URHO3D_PROFILE(CreateObject);
 
     if (!compiled_)
-        return 0;
+        return nullptr;
 
     asIScriptContext* context = script_->GetScriptFileContext();
-    asITypeInfo* type = 0;
+    asITypeInfo* type = nullptr;
     if (useInterface)
     {
         asITypeInfo* interfaceType = scriptModule_->GetTypeInfoByDecl(className.CString());
 
         if (!interfaceType)
-            return 0;
+            return nullptr;
 
         for (unsigned i = 0; i < scriptModule_->GetObjectTypeCount(); ++i)
         {
@@ -436,7 +436,7 @@ asIScriptObject* ScriptFile::CreateObject(const String& className, bool useInter
     }
 
     if (!type)
-        return 0;
+        return nullptr;
 
     // Ensure that the type implements the "ScriptObject" interface, so it can be returned to script properly
     bool found;
@@ -454,18 +454,18 @@ asIScriptObject* ScriptFile::CreateObject(const String& className, bool useInter
     if (!found)
     {
         URHO3D_LOGERRORF("Script class %s does not implement the ScriptObject interface", type->GetName());
-        return 0;
+        return nullptr;
     }
 
     // Get the factory function id from the object type
     String factoryName = String(type->GetName()) + "@ " + type->GetName() + "()";
     asIScriptFunction* factory = type->GetFactoryByDecl(factoryName.CString());
     if (!factory || context->Prepare(factory) < 0 || context->Execute() < 0)
-        return 0;
+        return nullptr;
 
     void* objAddress = context->GetAddressOfReturnValue();
     if (!objAddress)
-        return 0;
+        return nullptr;
 
     asIScriptObject* obj = *(static_cast<asIScriptObject**>(objAddress));
     if (obj)
@@ -489,7 +489,7 @@ bool ScriptFile::SaveByteCode(Serializer& dest)
 asIScriptFunction* ScriptFile::GetFunction(const String& declarationIn)
 {
     if (!compiled_)
-        return 0;
+        return nullptr;
 
     String declaration = declarationIn.Trimmed();
     // If not a full declaration, assume void with no parameters
@@ -508,7 +508,7 @@ asIScriptFunction* ScriptFile::GetFunction(const String& declarationIn)
 asIScriptFunction* ScriptFile::GetMethod(asIScriptObject* object, const String& declarationIn)
 {
     if (!compiled_ || !object)
-        return 0;
+        return nullptr;
 
     String declaration = declarationIn.Trimmed();
     // If not a full declaration, assume void with no parameters
@@ -517,7 +517,7 @@ asIScriptFunction* ScriptFile::GetMethod(asIScriptObject* object, const String&
 
     asITypeInfo* type = object->GetObjectType();
     if (!type)
-        return 0;
+        return nullptr;
 
     HashMap<asITypeInfo*, HashMap<String, asIScriptFunction*> >::ConstIterator i = methods_.Find(type);
     if (i != methods_.End())
@@ -540,7 +540,7 @@ void ScriptFile::CleanupEventInvoker(asIScriptObject* object)
 void ScriptFile::AddEventHandlerInternal(Object* sender, StringHash eventType, const String& handlerName)
 {
     String declaration = "void " + handlerName + "(StringHash, VariantMap&)";
-    asIScriptFunction* function = 0;
+    asIScriptFunction* function = nullptr;
     asIScriptObject* receiver = static_cast<asIScriptObject*>(asGetActiveContext()->GetThisPointer());
 
     if (receiver)
@@ -843,7 +843,7 @@ void ScriptFile::ReleaseModule()
         eventInvokers_.Clear();
 
         asIScriptEngine* engine = script_->GetScriptEngine();
-        scriptModule_->SetUserData(0);
+        scriptModule_->SetUserData(nullptr);
 
         // Remove the module
         {
@@ -853,7 +853,7 @@ void ScriptFile::ReleaseModule()
             engine->DiscardModule(GetName().CString());
         }
 
-        scriptModule_ = 0;
+        scriptModule_ = nullptr;
         compiled_ = false;
         SetMemoryUse(0);
 
@@ -899,7 +899,7 @@ void ScriptFile::HandleUpdate(StringHash eventType, VariantMap& eventData)
 ScriptEventInvoker::ScriptEventInvoker(ScriptFile* file, asIScriptObject* object) :
     Object(file->GetContext()),
     file_(file),
-    sharedBool_(0),
+    sharedBool_(nullptr),
     object_(object)
 {
     if (object_)
@@ -915,8 +915,8 @@ ScriptEventInvoker::~ScriptEventInvoker()
     if (sharedBool_)
         sharedBool_->Release();
 
-    sharedBool_ = 0;
-    object_ = 0;
+    sharedBool_ = nullptr;
+    object_ = nullptr;
 }
 
 bool ScriptEventInvoker::IsObjectAlive() const
@@ -959,12 +959,12 @@ void ScriptEventInvoker::HandleScriptEvent(StringHash eventType, VariantMap& eve
 ScriptFile* GetScriptContextFile()
 {
     asIScriptContext* context = asGetActiveContext();
-    asIScriptFunction* function = context ? context->GetFunction() : 0;
-    asIScriptModule* module = function ? function->GetEngine()->GetModule(function->GetModuleName()) : 0;
+    asIScriptFunction* function = context ? context->GetFunction() : nullptr;
+    asIScriptModule* module = function ? function->GetEngine()->GetModule(function->GetModuleName()) : nullptr;
     if (module)
         return static_cast<ScriptFile*>(module->GetUserData());
     else
-        return 0;
+        return nullptr;
 }
 
 }

+ 14 - 14
Source/Urho3D/AngelScript/ScriptFile.h

@@ -51,33 +51,33 @@ public:
     /// Construct.
     ScriptFile(Context* context);
     /// Destruct.
-    virtual ~ScriptFile();
+    virtual ~ScriptFile() override;
     /// Register object factory.
     static void RegisterObject(Context* context);
 
     /// Load resource from stream. May be called from a worker thread. Return true if successful.
-    virtual bool BeginLoad(Deserializer& source);
+    virtual bool BeginLoad(Deserializer& source) override;
     /// Finish resource loading. Always called from the main thread. Return true if successful.
-    virtual bool EndLoad();
+    virtual bool EndLoad() override;
 
     /// Add a scripted event handler.
-    virtual void AddEventHandler(StringHash eventType, const String& handlerName);
+    virtual void AddEventHandler(StringHash eventType, const String& handlerName) override;
     /// Add a scripted event handler for a specific sender.
-    virtual void AddEventHandler(Object* sender, StringHash eventType, const String& handlerName);
+    virtual void AddEventHandler(Object* sender, StringHash eventType, const String& handlerName) override;
     /// Remove a scripted event handler.
-    virtual void RemoveEventHandler(StringHash eventType);
+    virtual void RemoveEventHandler(StringHash eventType) override;
     /// Remove a scripted event handler for a specific sender.
-    virtual void RemoveEventHandler(Object* sender, StringHash eventType);
+    virtual void RemoveEventHandler(Object* sender, StringHash eventType) override;
     /// Remove all scripted event handlers for a specific sender.
-    virtual void RemoveEventHandlers(Object* sender);
+    virtual void RemoveEventHandlers(Object* sender) override;
     /// Remove all scripted event handlers.
-    virtual void RemoveEventHandlers();
+    virtual void RemoveEventHandlers() override;
     /// Remove all scripted event handlers, except those listed.
-    virtual void RemoveEventHandlersExcept(const PODVector<StringHash>& exceptions);
+    virtual void RemoveEventHandlersExcept(const PODVector<StringHash>& exceptions) override;
     /// Return whether has subscribed to an event.
-    virtual bool HasEventHandler(StringHash eventType) const;
+    virtual bool HasEventHandler(StringHash eventType) const override;
     /// Return whether has subscribed to a specific sender's event.
-    virtual bool HasEventHandler(Object* sender, StringHash eventType) const;
+    virtual bool HasEventHandler(Object* sender, StringHash eventType) const override;
 
     /// Query for a function by declaration and execute if found.
     bool Execute(const String& declaration, const VariantVector& parameters = Variant::emptyVariantVector, bool unprepare = true);
@@ -158,9 +158,9 @@ class URHO3D_API ScriptEventInvoker : public Object
 
 public:
     /// Constructor, will create the asILockableSharedBool if a ScriptObject is passed in.
-    ScriptEventInvoker(ScriptFile* file, asIScriptObject* object = 0);
+    ScriptEventInvoker(ScriptFile* file, asIScriptObject* object = nullptr);
     /// Destructor, release the ref it we still hold it.
-    ~ScriptEventInvoker();
+    virtual ~ScriptEventInvoker() override;
 
     /// Get the asIScriptObject to call the method on, can be null.
     asIScriptObject* GetObject() const { return object_; }

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

@@ -62,7 +62,7 @@ static const char* methodDeclarations[] = {
 
 ScriptInstance::ScriptInstance(Context* context) :
     Component(context),
-    scriptObject_(0),
+    scriptObject_(nullptr),
     subscribed_(false),
     subscribedPostFixed_(false)
 {
@@ -201,7 +201,7 @@ bool ScriptInstance::CreateObject(ScriptFile* scriptFile, const String& classNam
     className_ = String::EMPTY; // Do not create object during SetScriptFile()
     SetScriptFile(scriptFile);
     SetClassName(className);
-    return scriptObject_ != 0;
+    return scriptObject_ != nullptr;
 }
 
 void ScriptInstance::SetScriptFile(ScriptFile* scriptFile)
@@ -404,7 +404,7 @@ bool ScriptInstance::HasMethod(const String& declaration) const
     if (!scriptFile_ || !scriptObject_)
         return false;
     else
-        return scriptFile_->GetMethod(scriptObject_, declaration) != 0;
+        return scriptFile_->GetMethod(scriptObject_, declaration) != nullptr;
 }
 
 void ScriptInstance::SetScriptFileAttr(const ResourceRef& value)
@@ -574,16 +574,16 @@ void ScriptInstance::ReleaseObject()
         ClearScriptMethods();
         ClearScriptAttributes();
 
-        scriptObject_->SetUserData(0);
+        scriptObject_->SetUserData(nullptr);
         scriptObject_->Release();
-        scriptObject_ = 0;
+        scriptObject_ = nullptr;
     }
 }
 
 void ScriptInstance::ClearScriptMethods()
 {
     for (unsigned i = 0; i < MAX_SCRIPT_METHODS; ++i)
-        methods_[i] = 0;
+        methods_[i] = nullptr;
 
     delayedCalls_.Clear();
 }
@@ -829,7 +829,7 @@ void ScriptInstance::HandleSceneUpdate(StringHash eventType, VariantMap& eventDa
     if (methods_[METHOD_DELAYEDSTART])
     {
         scriptFile_->Execute(scriptObject_, methods_[METHOD_DELAYEDSTART]);
-        methods_[METHOD_DELAYEDSTART] = 0;  // Only execute once
+        methods_[METHOD_DELAYEDSTART] = nullptr;  // Only execute once
     }
 
     if (methods_[METHOD_UPDATE])
@@ -863,7 +863,7 @@ void ScriptInstance::HandlePhysicsPreStep(StringHash eventType, VariantMap& even
     if (methods_[METHOD_DELAYEDSTART])
     {
         scriptFile_->Execute(scriptObject_, methods_[METHOD_DELAYEDSTART]);
-        methods_[METHOD_DELAYEDSTART] = 0;  // Only execute once
+        methods_[METHOD_DELAYEDSTART] = nullptr;  // Only execute once
     }
 
     using namespace PhysicsPreStep;
@@ -930,28 +930,28 @@ Context* GetScriptContext()
     if (context)
         return static_cast<Script*>(context->GetEngine()->GetUserData())->GetContext();
     else
-        return 0;
+        return nullptr;
 }
 
 ScriptInstance* GetScriptContextInstance()
 {
     asIScriptContext* context = asGetActiveContext();
-    asIScriptObject* object = context ? static_cast<asIScriptObject*>(context->GetThisPointer()) : 0;
+    asIScriptObject* object = context ? static_cast<asIScriptObject*>(context->GetThisPointer()) : nullptr;
     if (object)
         return static_cast<ScriptInstance*>(object->GetUserData());
     else
-        return 0;
+        return nullptr;
 }
 
 Node* GetScriptContextNode()
 {
     ScriptInstance* instance = GetScriptContextInstance();
-    return instance ? instance->GetNode() : 0;
+    return instance ? instance->GetNode() : nullptr;
 }
 
 Scene* GetScriptContextScene()
 {
-    Scene* scene = 0;
+    Scene* scene = nullptr;
     Node* node = GetScriptContextNode();
     if (node)
         scene = node->GetScene();
@@ -975,7 +975,7 @@ ScriptEventListener* GetScriptContextEventListener()
             return GetScriptContextFile();
     }
     else
-        return 0;
+        return nullptr;
 }
 
 Object* GetScriptContextEventListenerObject()

+ 17 - 17
Source/Urho3D/AngelScript/ScriptInstance.h

@@ -63,41 +63,41 @@ public:
     /// Construct.
     ScriptInstance(Context* context);
     /// Destruct.
-    virtual ~ScriptInstance();
+    virtual ~ScriptInstance() override;
     /// Register object factory.
     static void RegisterObject(Context* context);
 
     /// Handle attribute write access.
-    virtual void OnSetAttribute(const AttributeInfo& attr, const Variant& src);
+    virtual void OnSetAttribute(const AttributeInfo& attr, const Variant& src) override;
     /// Handle attribute read access.
-    virtual void OnGetAttribute(const AttributeInfo& attr, Variant& dest) const;
+    virtual void OnGetAttribute(const AttributeInfo& attr, Variant& dest) const override;
 
     /// Return attribute descriptions, or null if none defined.
-    virtual const Vector<AttributeInfo>* GetAttributes() const { return &attributeInfos_; }
+    virtual const Vector<AttributeInfo>* GetAttributes() const override { return &attributeInfos_; }
 
     /// Apply attribute changes that can not be applied immediately. Called after scene load or a network update.
-    virtual void ApplyAttributes();
+    virtual void ApplyAttributes() override;
     /// Handle enabled/disabled state change.
-    virtual void OnSetEnabled();
+    virtual void OnSetEnabled() override;
 
     /// Add a scripted event handler.
-    virtual void AddEventHandler(StringHash eventType, const String& handlerName);
+    virtual void AddEventHandler(StringHash eventType, const String& handlerName) override;
     /// Add a scripted event handler for a specific sender.
-    virtual void AddEventHandler(Object* sender, StringHash eventType, const String& handlerName);
+    virtual void AddEventHandler(Object* sender, StringHash eventType, const String& handlerName) override;
     /// Remove a scripted event handler.
-    virtual void RemoveEventHandler(StringHash eventType);
+    virtual void RemoveEventHandler(StringHash eventType) override;
     /// Remove a scripted event handler for a specific sender.
-    virtual void RemoveEventHandler(Object* sender, StringHash eventType);
+    virtual void RemoveEventHandler(Object* sender, StringHash eventType) override;
     /// Remove all scripted event handlers for a specific sender.
-    virtual void RemoveEventHandlers(Object* sender);
+    virtual void RemoveEventHandlers(Object* sender) override;
     /// Remove all scripted event handlers.
-    virtual void RemoveEventHandlers();
+    virtual void RemoveEventHandlers() override;
     /// Remove all scripted event handlers, except those listed.
-    virtual void RemoveEventHandlersExcept(const PODVector<StringHash>& exceptions);
+    virtual void RemoveEventHandlersExcept(const PODVector<StringHash>& exceptions) override;
     /// Return whether has subscribed to an event.
-    virtual bool HasEventHandler(StringHash eventType) const;
+    virtual bool HasEventHandler(StringHash eventType) const override;
     /// Return whether has subscribed to a specific sender's event.
-    virtual bool HasEventHandler(Object* sender, StringHash eventType) const;
+    virtual bool HasEventHandler(Object* sender, StringHash eventType) const override;
 
     /// Create object of certain class from the script file. Return true if successful.
     bool CreateObject(ScriptFile* scriptFile, const String& className);
@@ -148,9 +148,9 @@ public:
 
 protected:
     /// Handle scene being assigned.
-    virtual void OnSceneSet(Scene* scene);
+    virtual void OnSceneSet(Scene* scene) override;
     /// Handle node transform being dirtied.
-    virtual void OnMarkedDirty(Node* node);
+    virtual void OnMarkedDirty(Node* node) override;
 
 private:
     /// (Re)create the script object and check for supported methods if successfully created.

+ 2 - 2
Source/Urho3D/AngelScript/UIAPI.cpp

@@ -664,7 +664,7 @@ static UIElement* UILoadLayoutFromFile(File* file, UI* ptr)
         return root.Get();
     }
     else
-        return 0;
+        return nullptr;
 }
 
 static UIElement* UILoadLayoutFromVectorBuffer(VectorBuffer& buffer, UI* ptr)
@@ -685,7 +685,7 @@ static UIElement* UILoadLayoutFromFileWithStyle(File* file, XMLFile* styleFile,
         return root.Get();
     }
     else
-        return 0;
+        return nullptr;
 }
 
 static UIElement* UILoadLayoutFromVectorBufferWithStyle(VectorBuffer& buffer, XMLFile* styleFile, UI* ptr)

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

@@ -406,7 +406,7 @@ static PhysicsWorld2D* SceneGetPhysicsWorld2D(Scene* ptr)
 static PhysicsWorld2D* GetPhysicsWorld2D()
 {
     Scene* scene = GetScriptContextScene();
-    return scene ? scene->GetComponent<PhysicsWorld2D>() : 0;
+    return scene ? scene->GetComponent<PhysicsWorld2D>() : nullptr;
 }
 
 static void RegisterPhysicsWorld2D(asIScriptEngine* engine)

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

@@ -103,7 +103,7 @@ bool Audio::SetMode(int bufferLengthMSec, int mixRate, bool stereo, bool interpo
     if (Abs((int)desired.samples / 2 - bufferSamples) < Abs((int)desired.samples - bufferSamples))
         desired.samples /= 2;
 
-    deviceID_ = SDL_OpenAudioDevice(0, SDL_FALSE, &desired, &obtained, SDL_AUDIO_ALLOW_ANY_CHANGE);
+    deviceID_ = SDL_OpenAudioDevice(nullptr, SDL_FALSE, &desired, &obtained, SDL_AUDIO_ALLOW_ANY_CHANGE);
     if (!deviceID_)
     {
         URHO3D_LOGERROR("Could not initialize audio output");

+ 1 - 1
Source/Urho3D/Audio/Audio.h

@@ -45,7 +45,7 @@ public:
     /// Construct.
     Audio(Context* context);
     /// Destruct. Terminate the audio thread and free the audio buffer.
-    virtual ~Audio();
+    virtual ~Audio() override;
 
     /// Initialize sound output with specified buffer length and output mode.
     bool SetMode(int bufferLengthMSec, int mixRate, bool stereo, bool interpolation = true);

+ 2 - 2
Source/Urho3D/Audio/BufferedSoundStream.h

@@ -38,10 +38,10 @@ public:
     /// Construct.
     BufferedSoundStream();
     /// Destruct.
-    ~BufferedSoundStream();
+    virtual ~BufferedSoundStream() override;
 
     /// Produce sound data into destination. Return number of bytes produced. Called by SoundSource from the mixing thread.
-    virtual unsigned GetData(signed char* dest, unsigned numBytes);
+    virtual unsigned GetData(signed char* dest, unsigned numBytes) override;
 
     /// Buffer sound data. Makes a copy of it.
     void AddData(void* data, unsigned numBytes);

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

@@ -44,7 +44,7 @@ OggVorbisSoundStream::OggVorbisSoundStream(const Sound* sound)
     data_ = sound->GetData();
     dataSize_ = sound->GetDataSize();
     int error;
-    decoder_ = stb_vorbis_open_memory((unsigned char*)data_.Get(), dataSize_, &error, 0);
+    decoder_ = stb_vorbis_open_memory((unsigned char*)data_.Get(), dataSize_, &error, nullptr);
 }
 
 OggVorbisSoundStream::~OggVorbisSoundStream()
@@ -55,7 +55,7 @@ OggVorbisSoundStream::~OggVorbisSoundStream()
         stb_vorbis* vorbis = static_cast<stb_vorbis*>(decoder_);
 
         stb_vorbis_close(vorbis);
-        decoder_ = 0;
+        decoder_ = nullptr;
     }
 }
 

+ 3 - 3
Source/Urho3D/Audio/OggVorbisSoundStream.h

@@ -37,13 +37,13 @@ public:
     /// Construct from an Ogg Vorbis compressed sound.
     OggVorbisSoundStream(const Sound* sound);
     /// Destruct.
-    ~OggVorbisSoundStream();
+    virtual ~OggVorbisSoundStream() override;
 
     /// Seek to sample number. Return true on success.
-    virtual bool Seek(unsigned sample_number);
+    virtual bool Seek(unsigned sample_number) override;
 
     /// Produce sound data into destination. Return number of bytes produced. Called by SoundSource from the mixing thread.
-    virtual unsigned GetData(signed char* dest, unsigned numBytes);
+    virtual unsigned GetData(signed char* dest, unsigned numBytes) override;
 
 protected:
     /// Decoder state.

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

@@ -60,8 +60,8 @@ static const unsigned IP_SAFETY = 4;
 
 Sound::Sound(Context* context) :
     ResourceWithMetadata(context),
-    repeat_(0),
-    end_(0),
+    repeat_(nullptr),
+    end_(nullptr),
     dataSize_(0),
     frequency_(44100),
     looped_(false),
@@ -108,7 +108,7 @@ bool Sound::LoadOggVorbis(Deserializer& source)
 
     // Check for validity of data
     int error;
-    stb_vorbis* vorbis = stb_vorbis_open_memory((unsigned char*)data.Get(), dataSize, &error, 0);
+    stb_vorbis* vorbis = stb_vorbis_open_memory((unsigned char*)data.Get(), dataSize, &error, nullptr);
     if (!vorbis)
     {
         URHO3D_LOGERROR("Could not read Ogg Vorbis data from " + source.GetName());

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

@@ -39,12 +39,12 @@ public:
     /// Construct.
     Sound(Context* context);
     /// Destruct and free sound data.
-    virtual ~Sound();
+    virtual ~Sound() override;
     /// Register object factory.
     static void RegisterObject(Context* context);
 
     /// Load resource from stream. May be called from a worker thread. Return true if successful.
-    virtual bool BeginLoad(Deserializer& source);
+    virtual bool BeginLoad(Deserializer& source) override;
 
     /// Load raw sound data.
     bool LoadRaw(Deserializer& source);

+ 1 - 1
Source/Urho3D/Audio/SoundListener.h

@@ -36,7 +36,7 @@ public:
     /// Construct.
     SoundListener(Context* context);
     /// Destruct.
-    virtual ~SoundListener();
+    virtual ~SoundListener() override;
     /// Register object factory.
     static void RegisterObject(Context* context);
 };

+ 6 - 6
Source/Urho3D/Audio/SoundSource.cpp

@@ -109,7 +109,7 @@ SoundSource::SoundSource(Context* context) :
     panning_(0.0f),
     sendFinishedEvent_(false),
     autoRemove_(REMOVE_DISABLED),
-    position_(0),
+    position_(nullptr),
     fractPosition_(0),
     timePosition_(0.0f),
     unusedStreamSize_(0)
@@ -313,7 +313,7 @@ void SoundSource::SetAutoRemoveMode(AutoRemoveMode mode)
 
 bool SoundSource::IsPlaying() const
 {
-    return (sound_ || soundStream_) && position_ != 0;
+    return (sound_ || soundStream_) && position_ != nullptr;
 }
 
 void SoundSource::SetPlayPosition(signed char* pos)
@@ -449,7 +449,7 @@ void SoundSource::Mix(int* dest, unsigned samples, int mixRate, bool stereo, boo
         // If stream did not produce any data, stop if applicable
         if (!outBytes && soundStream_->GetStopAtEnd())
         {
-            position_ = 0;
+            position_ = nullptr;
             return;
         }
     }
@@ -575,7 +575,7 @@ void SoundSource::PlayLockless(SharedPtr<SoundStream> stream)
 
 void SoundSource::StopLockless()
 {
-    position_ = 0;
+    position_ = nullptr;
     timePosition_ = 0.0f;
 
     // Free the sound stream and decode buffer if a stream was playing
@@ -1256,7 +1256,7 @@ void SoundSource::MixZeroVolume(Sound* sound, unsigned samples, int mixRate)
             }
         }
         else
-            position_ = 0;
+            position_ = nullptr;
     }
 }
 
@@ -1278,7 +1278,7 @@ void SoundSource::MixNull(float timeStep)
     {
         if (timePosition_ >= sound_->GetLength())
         {
-            position_ = 0;
+            position_ = nullptr;
             timePosition_ = 0.0f;
         }
     }

+ 1 - 1
Source/Urho3D/Audio/SoundSource.h

@@ -44,7 +44,7 @@ public:
     /// Construct.
     SoundSource(Context* context);
     /// Destruct. Remove self from the audio subsystem
-    virtual ~SoundSource();
+    virtual ~SoundSource() override;
     /// Register object factory.
     static void RegisterObject(Context* context);
 

+ 2 - 2
Source/Urho3D/Audio/SoundSource3D.h

@@ -41,9 +41,9 @@ public:
     static void RegisterObject(Context* context);
 
     /// Visualize the component as debug geometry.
-    virtual void DrawDebugGeometry(DebugRenderer* debug, bool depthTest);
+    virtual void DrawDebugGeometry(DebugRenderer* debug, bool depthTest) override;
     /// Update sound source.
-    virtual void Update(float timeStep);
+    virtual void Update(float timeStep) override;
 
     /// Set attenuation parameters.
     void SetDistanceAttenuation(float nearDistance, float farDistance, float rolloffFactor);

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません