Browse Source

Use the nullptr keywork instead of the NULL macro.

Bryce Groff 11 năm trước cách đây
mục cha
commit
612df38435
70 tập tin đã thay đổi với 288 bổ sung296 xóa
  1. 1 1
      QGearsMain/src/Main.cpp
  2. 8 8
      QGearsMain/src/common/File.cpp
  3. 3 3
      QGearsMain/src/common/FileSystem.cpp
  4. 20 20
      QGearsMain/src/common/QGearsManualObject.cpp
  5. 12 12
      QGearsMain/src/core/AudioManager.cpp
  6. 3 3
      QGearsMain/src/core/Background2D.cpp
  7. 1 1
      QGearsMain/src/core/CameraManager.cpp
  8. 1 1
      QGearsMain/src/core/ConfigCmdManager.cpp
  9. 2 2
      QGearsMain/src/core/ConfigFile.cpp
  10. 1 1
      QGearsMain/src/core/ConfigVar.cpp
  11. 3 3
      QGearsMain/src/core/ConfigVarManager.cpp
  12. 6 6
      QGearsMain/src/core/Console.cpp
  13. 1 1
      QGearsMain/src/core/DebugDraw.cpp
  14. 11 14
      QGearsMain/src/core/Entity.cpp
  15. 13 13
      QGearsMain/src/core/EntityManager.cpp
  16. 4 4
      QGearsMain/src/core/EntityModel.cpp
  17. 2 2
      QGearsMain/src/core/InputManager.cpp
  18. 11 11
      QGearsMain/src/core/ScriptManager.cpp
  19. 1 1
      QGearsMain/src/core/Timer.cpp
  20. 6 6
      QGearsMain/src/core/UiManager.cpp
  21. 8 8
      QGearsMain/src/core/UiTextArea.cpp
  22. 20 20
      QGearsMain/src/core/UiWidget.cpp
  23. 10 15
      QGearsMain/src/core/Walkmesh.cpp
  24. 3 3
      QGearsMain/src/core/XmlBackground2DFile.cpp
  25. 11 11
      QGearsMain/src/core/XmlFile.cpp
  26. 2 2
      QGearsMain/src/core/XmlFontFile.cpp
  27. 2 2
      QGearsMain/src/core/XmlFontsFile.cpp
  28. 4 4
      QGearsMain/src/core/XmlMapFile.cpp
  29. 4 4
      QGearsMain/src/core/XmlMapsFile.cpp
  30. 2 2
      QGearsMain/src/core/XmlMusicsFile.cpp
  31. 2 2
      QGearsMain/src/core/XmlPrototypesFile.cpp
  32. 6 6
      QGearsMain/src/core/XmlScreenFile.cpp
  33. 2 2
      QGearsMain/src/core/XmlScreensFile.cpp
  34. 3 3
      QGearsMain/src/core/XmlScriptsFile.cpp
  35. 2 2
      QGearsMain/src/core/XmlTextFile.cpp
  36. 3 3
      QGearsMain/src/core/XmlTextsFile.cpp
  37. 2 2
      QGearsMain/src/core/XmlWalkmeshFile.cpp
  38. 2 2
      QGearsMain/src/core/particles/Particle.cpp
  39. 1 1
      QGearsMain/src/core/particles/ParticleEmitter.cpp
  40. 1 1
      QGearsMain/src/core/particles/ParticleEmitterTranslator.cpp
  41. 1 1
      QGearsMain/src/core/particles/ParticleRenderer.cpp
  42. 1 1
      QGearsMain/src/core/particles/ParticleRendererTranslator.cpp
  43. 1 1
      QGearsMain/src/core/particles/ParticleSystem.cpp
  44. 6 6
      QGearsMain/src/core/particles/ParticleSystemManager.cpp
  45. 1 1
      QGearsMain/src/core/particles/ParticleSystemTranslatorManager.cpp
  46. 9 9
      QGearsMain/src/core/particles/ParticleTechnique.cpp
  47. 1 1
      QGearsMain/src/core/particles/ParticleVisual.cpp
  48. 2 2
      QGearsMain/src/core/particles/renderer/ParticleEntityRenderer.cpp
  49. 1 1
      QGearsMain/src/data/QGearsAFileManager.cpp
  50. 1 1
      QGearsMain/src/data/QGearsBackgroundFileManager.cpp
  51. 1 1
      QGearsMain/src/data/QGearsCameraMatrixFileManager.cpp
  52. 6 6
      QGearsMain/src/data/QGearsFLevelFile.cpp
  53. 1 1
      QGearsMain/src/data/QGearsFLevelFileManager.cpp
  54. 6 6
      QGearsMain/src/data/QGearsHRCFile.cpp
  55. 1 1
      QGearsMain/src/data/QGearsHRCFileManager.cpp
  56. 1 1
      QGearsMain/src/data/QGearsLGPArchive.cpp
  57. 1 1
      QGearsMain/src/data/QGearsLZSFLevelFileManager.cpp
  58. 1 1
      QGearsMain/src/data/QGearsPFileManager.cpp
  59. 1 1
      QGearsMain/src/data/QGearsPaletteFileManager.cpp
  60. 1 1
      QGearsMain/src/data/QGearsRSDFileManager.cpp
  61. 4 4
      QGearsMain/src/data/QGearsTexCodec.cpp
  62. 9 9
      QGearsMain/src/data/QGearsXMLSerializer.cpp
  63. 1 1
      QGearsMain/src/map/QGearsBackground2DFileManager.cpp
  64. 2 2
      QGearsMain/src/map/QGearsBackground2DFileXMLSerializer.cpp
  65. 1 1
      QGearsMain/src/map/QGearsMapFileManager.cpp
  66. 6 6
      QGearsMain/src/map/QGearsMapFileXMLSerializer.cpp
  67. 1 1
      QGearsMain/src/map/QGearsWalkmeshFileManager.cpp
  68. 1 1
      QGearsMain/src/map/QGearsWalkmeshFileXMLSerializer.cpp
  69. 3 3
      QGearsMain/src/modules/worldmap/WorldMapModule.cpp
  70. 16 16
      QGearsMain/src/viewer/ViewerModule.cpp

+ 1 - 1
QGearsMain/src/Main.cpp

@@ -43,7 +43,7 @@ main(int argc, char *argv[])
 
         Ogre::Root         *root(app.getRoot());
         Ogre::RenderWindow *window(app.getRenderWindow());
-        Ogre::SceneManager *scene_manager(NULL);
+        Ogre::SceneManager *scene_manager(nullptr);
 
         auto timer = std::make_unique<Timer>();
         auto particle_system_manager = std::make_unique<ParticleSystemManager>();

+ 8 - 8
QGearsMain/src/common/File.cpp

@@ -10,7 +10,7 @@
 //-------------------------------------------------------------------------
 File::File(const Ogre::String& file):
   m_FileName(file),
-  m_Buffer(NULL),
+  m_Buffer(nullptr),
   m_BufferSize(0)
 {
     LOG_TRIVIAL("Loading file: " + m_FileName + "\n");
@@ -25,11 +25,11 @@ File::File(const Ogre::String& file):
 }
 
 //-------------------------------------------------------------------------
-File::File( const File* pFile, u32 offset, u32 length):
-  m_Buffer(NULL),
+File::File(const File* pFile, u32 offset, u32 length):
+  m_Buffer(nullptr),
   m_BufferSize(length)
 {
-    assert(pFile != NULL);
+    assert(pFile != nullptr);
 
     m_FileName = pFile->GetFileName();
 
@@ -40,19 +40,19 @@ File::File( const File* pFile, u32 offset, u32 length):
 //-------------------------------------------------------------------------
 File::File(const u8* pBuffer, u32 offset, u32 length):
   m_FileName("BUFFER"),
-  m_Buffer(NULL),
+  m_Buffer(nullptr),
   m_BufferSize(length)
 {
-    assert(pBuffer != NULL);
+    assert(pBuffer != nullptr);
 
     m_Buffer = (u8*)malloc(sizeof(u8) * m_BufferSize);
     memcpy(m_Buffer, pBuffer + offset, m_BufferSize);
 }
 
 //-------------------------------------------------------------------------
-File::File( const File* pFile )
+File::File(const File* pFile)
 {
-    assert(pFile != NULL);
+    assert(pFile != nullptr);
 
     m_BufferSize = pFile->GetFileSize();
     m_FileName   = pFile->GetFileName();

+ 3 - 3
QGearsMain/src/common/FileSystem.cpp

@@ -10,7 +10,7 @@ FileSystem::GetFileSize(const Ogre::String &path)
 {
     FILE* file = fopen(path.c_str(), "rb");
 
-    if (file == NULL)
+    if (file == nullptr)
     {
         LOG_ERROR("Can't open file " + path + ".\n");
         return 0;
@@ -30,7 +30,7 @@ FileSystem::ReadFile(const Ogre::String &path, void* buffer, const unsigned int
 {
     FILE* file = fopen(path.c_str(), "rb");
 
-    if (file == NULL)
+    if (file == nullptr)
     {
         LOG_ERROR("Can't open file " + path + ".\n");
         return false;
@@ -55,7 +55,7 @@ FileSystem::WriteFile(const Ogre::String &path, const void* buffer, const unsign
 {
     FILE* file = fopen(path.c_str(), "ab");
 
-    if (file == NULL)
+    if (file == nullptr)
     {
         return false;
     }

+ 20 - 20
QGearsMain/src/common/QGearsManualObject.cpp

@@ -36,14 +36,14 @@ namespace QGears
     //-------------------------------------------------------------------------
     ManualObject::ManualObject( Ogre::Mesh *mesh ) :
         m_mesh( mesh )
-       ,m_section( NULL )
+       ,m_section( nullptr )
        ,m_bbox( mesh->getBounds() )
        ,m_radius( mesh->getBoundingSphereRadius() )
-       ,m_position( NULL )
-       ,m_normal( NULL )
-       ,m_colour( NULL )
-       ,m_texture_coordinate( NULL )
-       ,m_index( NULL )
+       ,m_position( nullptr )
+       ,m_normal( nullptr )
+       ,m_colour( nullptr )
+       ,m_texture_coordinate( nullptr )
+       ,m_index( nullptr )
        ,colour_type( Ogre::VertexElement::getBestColourVertexElementType() )
     {
     }
@@ -142,11 +142,11 @@ namespace QGears
         }
 
         resetBuffer( m_index_buffer );
-        m_position = NULL;
-        m_normal = NULL;
-        m_colour = NULL;
-        m_texture_coordinate = NULL;
-        m_index = NULL;
+        m_position = nullptr;
+        m_normal = nullptr;
+        m_colour = nullptr;
+        m_texture_coordinate = nullptr;
+        m_index = nullptr;
     }
 
     //-------------------------------------------------------------------------
@@ -154,14 +154,14 @@ namespace QGears
     ManualObject::begin( const String &name, const String &material_name
                         ,size_t vertex_count, size_t index_count )
     {
-        if( m_mesh == NULL )
+        if( m_mesh == nullptr )
         {
 			OGRE_EXCEPT( Ogre::Exception::ERR_INVALIDPARAMS,
 				"You cannot begin a section without a Mesh",
 				"ManualObject::begin");
         }
 
-        if( m_section != NULL )
+        if( m_section != nullptr )
         {
 			OGRE_EXCEPT( Ogre::Exception::ERR_INVALIDPARAMS,
 				"You cannot begin a section without ending the old one first",
@@ -191,7 +191,7 @@ namespace QGears
     void
     ManualObject::position( const Ogre::Vector3 &position )
     {
-        if( m_position == NULL )
+        if( m_position == nullptr )
         {
             createPositionBuffer();
         }
@@ -205,7 +205,7 @@ namespace QGears
     void
     ManualObject::normal( const Ogre::Vector3 &normal )
     {
-        if( m_normal == NULL )
+        if( m_normal == nullptr )
         {
             createNormalBuffer();
         }
@@ -216,7 +216,7 @@ namespace QGears
     void
     ManualObject::colour( const Ogre::ColourValue &colour )
     {
-        if( m_colour == NULL )
+        if( m_colour == nullptr )
         {
             createColourBuffer();
         }
@@ -227,7 +227,7 @@ namespace QGears
     void
     ManualObject::textureCoord( const Ogre::Vector2 &texture_coordinate )
     {
-        if( m_texture_coordinate == NULL )
+        if( m_texture_coordinate == nullptr )
         {
             createTextureCoordinateBuffer();
         }
@@ -238,7 +238,7 @@ namespace QGears
     void
     ManualObject::index( const uint32 idx )
     {
-        if( m_index == NULL )
+        if( m_index == nullptr )
         {
             createIndexBuffer();
         }
@@ -261,7 +261,7 @@ namespace QGears
     void
     ManualObject::end()
     {
-        if( m_section == NULL )
+        if( m_section == nullptr )
         {
 			OGRE_EXCEPT( Ogre::Exception::ERR_INVALIDPARAMS,
 				"You cannot end a section without beginning one first",
@@ -270,7 +270,7 @@ namespace QGears
 
         m_mesh->_setBounds( m_bbox );
         m_mesh->_setBoundingSphereRadius( m_radius );
-        m_section = NULL;
+        m_section = nullptr;
         resetBuffers();
     }
 

+ 12 - 12
QGearsMain/src/core/AudioManager.cpp

@@ -6,7 +6,7 @@
 #include "core/Logger.h"
 
 
-template<>AudioManager *Ogre::Singleton<AudioManager>::msSingleton = NULL;
+template<>AudioManager *Ogre::Singleton<AudioManager>::msSingleton = nullptr;
 
 ALsizei AudioManager::m_ChannelBufferNumber = 2;
 int AudioManager::m_ChannelBufferSize = 96 * 1024;
@@ -18,11 +18,11 @@ AudioManager::AudioManager():
     m_UpdateMutex(),
     m_Music(&m_UpdateMutex)
 {
-    m_ALDevice = alcOpenDevice(NULL);
-    if(m_ALDevice != NULL)
+    m_ALDevice = alcOpenDevice(nullptr);
+    if(m_ALDevice != nullptr)
     {
-        m_ALContext = alcCreateContext(m_ALDevice, NULL);
-        if(m_ALContext != NULL)
+        m_ALContext = alcCreateContext(m_ALDevice, nullptr);
+        if(m_ALContext != nullptr)
         {
             alcMakeContextCurrent(m_ALContext);
 
@@ -67,7 +67,7 @@ AudioManager::~AudioManager()
         delete m_UpdateThread;
         delete[] m_Buffer;
 
-        alcMakeContextCurrent(NULL);
+        alcMakeContextCurrent(nullptr);
         alcDestroyContext(m_ALContext);
         alcCloseDevice(m_ALDevice);
         LOG_TRIVIAL("AudioManager destroyed.");
@@ -118,7 +118,7 @@ AudioManager::MusicPlay(const Ogre::String& name)
         boost::recursive_mutex::scoped_lock lock(m_UpdateMutex);
 
         AudioManager::Music* music = GetMusic(name);
-        if(music == NULL)
+        if(music == nullptr)
         {
             LOG_ERROR("No music found with name \"" + name + "\".");
             return;
@@ -170,7 +170,7 @@ AudioManager::GetMusic(const Ogre::String& name)
         }
     }
 
-    return NULL;
+    return nullptr;
 }
 
 
@@ -180,7 +180,7 @@ AudioManager::ALError()
     //ALenum error_code = alGetError();
     //if( error_code == AL_NO_ERROR )
     {
-        return NULL;
+        return nullptr;
     }
     //else
     //{
@@ -192,12 +192,12 @@ AudioManager::ALError()
 const char*
 AudioManager::ALCError(const ALCdevice* device)
 {
-    //const ALCdevice *alc_device = ( ( device == NULL ) ? const_cast< ALCdevice* >( m_ALDevice ) : const_cast< ALCdevice* >( device ) );
+    //const ALCdevice *alc_device = ( ( device == nullptr ) ? const_cast< ALCdevice* >( m_ALDevice ) : const_cast< ALCdevice* >( device ) );
 
     //ALCenum error_code = alcGetError( const_cast< ALCdevice* >( alc_device ) );
     //if( error_code == ALC_NO_ERROR )
     {
-        return NULL;
+        return nullptr;
     }
     //else
     //{
@@ -208,7 +208,7 @@ AudioManager::ALCError(const ALCdevice* device)
 
 AudioManager::Player::Player(boost::recursive_mutex* mutex):
     m_Loop(-1.0),
-    m_VorbisInfo(NULL),
+    m_VorbisInfo(nullptr),
     m_VorbisSection(0),
     m_StreamFinished(false),
     m_UpdateMutex(mutex)

+ 3 - 3
QGearsMain/src/core/Background2D.cpp

@@ -20,7 +20,7 @@ Background2D::Background2D():
     m_AlphaMaxVertexCount(0),
     m_AddMaxVertexCount(0),
 
-    m_ScrollEntity(NULL),
+    m_ScrollEntity(nullptr),
     m_ScrollPositionStart(Ogre::Vector2::ZERO),
     m_ScrollPositionEnd(Ogre::Vector2::ZERO),
     m_ScrollType(Background2D::NONE),
@@ -291,7 +291,7 @@ Background2D::OnResize()
 void
 Background2D::Clear()
 {
-    m_ScrollEntity = NULL;
+    m_ScrollEntity = nullptr;
     m_ScrollPositionStart = Ogre::Vector2::ZERO;
     m_ScrollPositionEnd = Ogre::Vector2::ZERO;
     m_ScrollSeconds = 0;
@@ -343,7 +343,7 @@ Background2D::ScriptScrollToPosition(const float x, const float y, const ScrollT
 
     Ogre::Vector2 position = Ogre::Vector2(x, y);
 
-    m_ScrollEntity = NULL;
+    m_ScrollEntity = nullptr;
 
     if(type == Background2D::NONE)
     {

+ 1 - 1
QGearsMain/src/core/CameraManager.cpp

@@ -11,7 +11,7 @@
 
 
 ConfigVar cv_cam_speed("camera_speed", "Camera speed", "0.02");
-template<>CameraManager* Ogre::Singleton<CameraManager>::msSingleton = NULL;
+template<>CameraManager* Ogre::Singleton<CameraManager>::msSingleton = nullptr;
 
 
 CameraManager::CameraManager():

+ 1 - 1
QGearsMain/src/core/ConfigCmdManager.cpp

@@ -4,7 +4,7 @@
 #include "core/ConfigCmdManagerCommands.h"
 
 
-template<>ConfigCmdManager *Ogre::Singleton<ConfigCmdManager>::msSingleton = NULL;
+template<>ConfigCmdManager *Ogre::Singleton<ConfigCmdManager>::msSingleton = nullptr;
 
 
 ConfigCmdManager::ConfigCmdManager()

+ 2 - 2
QGearsMain/src/core/ConfigFile.cpp

@@ -38,7 +38,7 @@ ConfigFile::Execute(const Ogre::String& name)
                 {
                     // handle command
                     ConfigCmd* cmd = ConfigCmdManager::getSingleton().Find(params[0]);
-                    if(cmd != NULL)
+                    if(cmd != nullptr)
                     {
                         cmd->GetHandler()(params);
                     }
@@ -64,7 +64,7 @@ ConfigFile::Execute(const Ogre::String& name)
             {
                 ConfigCmd* cmd = ConfigCmdManager::getSingleton().Find(params[0]);
 
-                if(cmd != NULL)
+                if(cmd != nullptr)
                 {
                     cmd->GetHandler()(params);
                 }

+ 1 - 1
QGearsMain/src/core/ConfigVar.cpp

@@ -4,7 +4,7 @@
 #include "core/ConfigVar.h"
 
 
-ConfigVar* ConfigVar::m_StaticConfigVarList = NULL;
+ConfigVar* ConfigVar::m_StaticConfigVarList = nullptr;
 
 
 ConfigVar::ConfigVar(const Ogre::String& name, const Ogre::String& description, const Ogre::String& default_value):

+ 3 - 3
QGearsMain/src/core/ConfigVarManager.cpp

@@ -1,7 +1,7 @@
 #include "core/ConfigVarManager.h"
 
 
-template<>ConfigVarManager *Ogre::Singleton<ConfigVarManager>::msSingleton = NULL;
+template<>ConfigVarManager *Ogre::Singleton<ConfigVarManager>::msSingleton = nullptr;
 
 
 ConfigVarManager::ConfigVarManager()
@@ -29,7 +29,7 @@ ConfigVarManager::Find(const Ogre::String& name) const
         }
     }
 
-    return NULL;
+    return nullptr;
 }
 
 
@@ -48,5 +48,5 @@ ConfigVarManager::GetConfigVar(const unsigned int i) const
         return m_ConfigVars[i];
     }
 
-    return NULL;
+    return nullptr;
 }

+ 6 - 6
QGearsMain/src/core/Console.cpp

@@ -12,7 +12,7 @@
 #include <OgreFontManager.h>
 
 
-template<>Console *Ogre::Singleton<Console>::msSingleton = NULL;
+template<>Console *Ogre::Singleton<Console>::msSingleton = nullptr;
 ConfigVar cv_console_notification("console_notification", "Draw console strings even when console is hided", "false");
 
 
@@ -529,7 +529,7 @@ Console::ExecuteCommand(const Ogre::String& command)
     // is it cvar
     ConfigVar* cvar = ConfigVarManager::getSingleton().Find(params[0]);
 
-    if(cvar != NULL)
+    if(cvar != nullptr)
     {
         handled = true;
 
@@ -551,7 +551,7 @@ Console::ExecuteCommand(const Ogre::String& command)
     {
         // handle command
         ConfigCmd* cmd = ConfigCmdManager::getSingleton().Find(params[0]);
-        if(cmd != NULL)
+        if(cmd != nullptr)
         {
             cmd->GetHandler()(params);
             return;
@@ -644,7 +644,7 @@ Console::CompleteInput()
                         Ogre::String part = name.substr(input_size, name.size() - input_size);
                         m_AutoCompletition.push_back(part);
                     }
-                    else if(ConfigCmdManager::getSingleton().GetConfigCmd(i)->GetCompletion() != NULL)
+                    else if(ConfigCmdManager::getSingleton().GetConfigCmd(i)->GetCompletion() != nullptr)
                     {
                         m_InputLine += " ";
                         ConfigCmdManager::getSingleton().GetConfigCmd(i)->GetCompletion()(m_AutoCompletition);
@@ -663,11 +663,11 @@ Console::CompleteInput()
 
             // add commands arguments
             ConfigCmd* cmd = ConfigCmdManager::getSingleton().Find(params[0]);
-            if(cmd != NULL)
+            if(cmd != nullptr)
             {
                 add_slash = true;
 
-                if(cmd->GetCompletion() != NULL)
+                if(cmd->GetCompletion() != nullptr)
                 {
                     Ogre::StringVector full_complete;
                     cmd->GetCompletion()(full_complete);

+ 1 - 1
QGearsMain/src/core/DebugDraw.cpp

@@ -9,7 +9,7 @@
 #include "core/UiTextArea.h"
 
 
-template<>DebugDraw *Ogre::Singleton<DebugDraw>::msSingleton = NULL;
+template<>DebugDraw *Ogre::Singleton<DebugDraw>::msSingleton = nullptr;
 
 
 DebugDraw::DebugDraw():

+ 11 - 14
QGearsMain/src/core/Entity.cpp

@@ -27,7 +27,7 @@ Entity::Entity(const Ogre::String& name, Ogre::SceneNode* node):
     m_MoveWalkSpeed(0.7f),
     m_MoveRunSpeed(0.8f),
     m_MovePosition(Ogre::Vector3(0, 0, 0)),
-    m_MoveEntity(NULL),
+    m_MoveEntity(nullptr),
     m_MoveStopDistance(0.0f),
     m_MoveTriangleId(-1),
     m_MoveAutoRotation(true),
@@ -53,7 +53,7 @@ Entity::Entity(const Ogre::String& name, Ogre::SceneNode* node):
     m_TurnDirection(TD_CLOSEST),
     m_TurnDirectionStart(0),
     m_TurnDirectionEnd(0),
-    m_TurnEntity(NULL),
+    m_TurnEntity(nullptr),
     m_TurnType(AT_NONE),
     m_TurnSeconds(0.0f),
     m_TurnCurrentSeconds(0.0f),
@@ -105,18 +105,16 @@ Entity::~Entity()
 void
 Entity::Update()
 {
-    if(m_MoveEntity != NULL)
+    if(m_MoveEntity != nullptr)
     {
         m_MovePosition = m_MoveEntity->GetPosition();
         m_MoveStopDistance = GetSolidRadius() + m_MoveEntity->GetSolidRadius();
     }
 
-    if(m_TurnEntity != NULL)
+    if(m_TurnEntity != nullptr)
     {
         Ogre::Degree angle = GetDirectionToEntity(m_TurnEntity);
-
         angle = CalculateTurnAngle(m_TurnDirectionStart, angle);
-
         m_TurnDirectionEnd = angle;
     }
 }
@@ -517,7 +515,7 @@ Entity::ScriptMoveToPosition(const float x, const float y)
     m_State = Entity::WALKMESH;
 
     m_MovePosition = Ogre::Vector3(x, y, 0);
-    m_MoveEntity = NULL;
+    m_MoveEntity = nullptr;
     m_MoveStopDistance = 0;
     LOG_TRIVIAL("[SCRIPT] Entity \"" + m_Name + "\" set move to walkmesh position \"" + Ogre::StringConverter::toString(m_MovePosition) + "\".");
 }
@@ -539,10 +537,10 @@ int
 Entity::ScriptMoveSync()
 {
     ScriptId script = ScriptManager::getSingleton().GetCurrentScriptId();
+    m_Sync.push_back(script);
 
     LOG_TRIVIAL("[SCRIPT] Wait entity \"" + m_Name + "\" move for function \"" + script.function + "\" in script entity \"" + script.entity + "\".");
 
-    m_Sync.push_back(script);
     return -1;
 }
 
@@ -551,13 +549,12 @@ void
 Entity::UnsetMove()
 {
     m_State = Entity::NONE;
-
-    m_MoveEntity = NULL;
+    m_MoveEntity = nullptr;
     m_MoveStopDistance = 0;
 
-    for(size_t i = 0; i < m_Sync.size(); ++i)
+    for(const auto &script : m_Sync)
     {
-        ScriptManager::getSingleton().ContinueScriptExecution(m_Sync[i]);
+        ScriptManager::getSingleton().ContinueScriptExecution(script);
     }
     m_Sync.clear();
 }
@@ -814,7 +811,7 @@ Entity::GetOffsetCurrentSeconds() const
 void
 Entity::ScriptTurnToDirection(const float direction, const TurnDirection turn_direction, const ActionType turn_type, const float seconds)
 {
-    SetTurn(Ogre::Degree(direction), NULL, turn_direction, turn_type, seconds);
+    SetTurn(Ogre::Degree(direction), nullptr, turn_direction, turn_type, seconds);
     LOG_TRIVIAL("[SCRIPT] Entity \"" + m_Name + "\" turn to angle \"" + Ogre::StringConverter::toString(direction) + "\".");
 }
 
@@ -822,7 +819,7 @@ Entity::ScriptTurnToDirection(const float direction, const TurnDirection turn_di
 void
 Entity::ScriptTurnToEntity(Entity* entity, const TurnDirection turn_direction, const float seconds)
 {
-    if(entity == NULL || entity == this)
+    if(entity == nullptr || entity == this)
     {
         LOG_ERROR("[SCRIPT] Turn to entity: Invalid entity pointer (NUUL or this).");
         return;

+ 13 - 13
QGearsMain/src/core/EntityManager.cpp

@@ -12,7 +12,7 @@
 #include "core/Timer.h"
 
 
-template<>EntityManager *Ogre::Singleton<EntityManager>::msSingleton = NULL;
+template<>EntityManager *Ogre::Singleton<EntityManager>::msSingleton = nullptr;
 ConfigVar cv_debug_grid("debug_grid", "Draw debug grid", "false");
 ConfigVar cv_debug_axis("debug_axis", "Draw debug axis", "false");
 
@@ -73,7 +73,7 @@ GetDirectionToPoint(const Ogre::Vector3& current_point, const Ogre::Vector3& dir
 
 EntityManager::EntityManager():
     m_Paused(false),
-    m_PlayerEntity(NULL),
+    m_PlayerEntity(nullptr),
     m_PlayerMove(Ogre::Vector3::ZERO),
     m_PlayerMoveRotation(0),
     m_PlayerLock(false)
@@ -91,11 +91,11 @@ EntityManager::EntityManager():
 
 EntityManager::~EntityManager()
 {
-    if(m_Grid != NULL)
+    if(m_Grid != nullptr)
     {
         Ogre::Root::getSingleton().getSceneManager("Scene")->destroyEntity(m_Grid);
     }
-    if(m_Axis != NULL)
+    if(m_Axis != nullptr)
     {
         Ogre::Root::getSingleton().getSceneManager("Scene")->destroyEntity(m_Axis);
     }
@@ -118,7 +118,7 @@ EntityManager::Input(const QGears::Event& event)
         return;
     }
 
-    if(m_PlayerEntity != NULL && m_PlayerLock == false)
+    if(m_PlayerEntity != nullptr && m_PlayerLock == false)
     {
         if ((event.type == QGears::ET_KEY_IMPULSE) && (event.param1 == OIS::KC_LEFT))
         {
@@ -161,7 +161,7 @@ EntityManager::Update()
     ScriptManager::getSingleton().Update(ScriptManager::ENTITY);
 
     // set move point for player entity
-    if(m_PlayerEntity != NULL && m_PlayerMove != Ogre::Vector3::ZERO)
+    if(m_PlayerEntity != nullptr && m_PlayerMove != Ogre::Vector3::ZERO)
     {
         Entity::State state = m_PlayerEntity->GetState();
         if(state == Entity::WALKMESH || state == Entity::NONE)
@@ -347,7 +347,7 @@ EntityManager::Clear()
         delete m_Entity[i];
     }
     m_Entity.clear();
-    m_PlayerEntity = NULL;
+    m_PlayerEntity = nullptr;
     m_PlayerMove = Ogre::Vector3::ZERO;
     m_PlayerMoveRotation = 0;
 
@@ -434,7 +434,7 @@ EntityManager::AddEntityTrigger(const Ogre::String& name, const Ogre::Vector3& p
     trigger->SetEnabled(enabled);
     m_EntityTriggers.push_back(trigger);
 
-    ScriptManager::getSingleton().AddEntity(ScriptManager::ENTITY, trigger->GetName(), NULL);
+    ScriptManager::getSingleton().AddEntity(ScriptManager::ENTITY, trigger->GetName(), nullptr);
 }
 
 
@@ -452,7 +452,7 @@ void
 EntityManager::AddEntityScript(const Ogre::String& name)
 {
     m_EntityScripts.push_back(name);
-    ScriptManager::getSingleton().AddEntity(ScriptManager::ENTITY, name, NULL);
+    ScriptManager::getSingleton().AddEntity(ScriptManager::ENTITY, name, nullptr);
 }
 
 
@@ -474,7 +474,7 @@ EntityManager::GetEntity(const Ogre::String& name) const
         }
     }
 
-    return NULL;
+    return nullptr;
 }
 
 
@@ -496,7 +496,7 @@ EntityManager::ScriptGetEntityPoint(const char* name) const
         }
     }
 
-    return NULL;
+    return nullptr;
 }
 
 
@@ -516,7 +516,7 @@ EntityManager::ScriptSetPlayerEntity(const char* name)
 void
 EntityManager::ScriptUnsetPlayerEntity()
 {
-    m_PlayerEntity = NULL;
+    m_PlayerEntity = nullptr;
 }
 
 
@@ -1022,7 +1022,7 @@ EntityManager::CheckTriggers(Entity* entity, Ogre::Vector3& position)
     {
         ScriptEntity* scr_entity = ScriptManager::getSingleton().GetScriptEntityByName(ScriptManager::ENTITY, m_EntityTriggers[i]->GetName());
 
-        if(scr_entity != NULL && m_EntityTriggers[i]->IsEnabled() == true)
+        if(scr_entity != nullptr && m_EntityTriggers[i]->IsEnabled() == true)
         {
             Ogre::Vector3 lp1 = m_EntityTriggers[i]->GetPoint1();
             Ogre::Vector3 lp2 = m_EntityTriggers[i]->GetPoint2();

+ 4 - 4
QGearsMain/src/core/EntityModel.cpp

@@ -8,7 +8,7 @@
 
 EntityModel::EntityModel(const Ogre::String& name, const Ogre::String file_name, Ogre::SceneNode* node):
     Entity(name, node),
-    m_AnimationCurrent(NULL)
+    m_AnimationCurrent(nullptr)
 {
     Ogre::SceneManager* scene_manager;
     scene_manager = Ogre::Root::getSingleton().getSceneManager("Scene");
@@ -56,7 +56,7 @@ EntityModel::IsVisible() const
 void
 EntityModel::PlayAnimation(const Ogre::String& animation, Entity::AnimationState state, Entity::AnimationPlayType play_type, const float start, const float end)
 {
-    if(m_AnimationCurrent != NULL)
+    if(m_AnimationCurrent != nullptr)
     {
         m_AnimationCurrent->setEnabled(false);
     }
@@ -83,7 +83,7 @@ EntityModel::PlayAnimation(const Ogre::String& animation, Entity::AnimationState
 void
 EntityModel::PlayAnimationContinue(const Ogre::String& animation)
 {
-    if(m_AnimationCurrent == NULL ||                                                 // if animation isn't played
+    if(m_AnimationCurrent == nullptr ||                                                 // if animation isn't played
         (m_Model->getAllAnimationStates()->hasAnimationState(animation) == true && // and we want to play animation that exist (use this to avoid exception)
           (m_AnimationCurrent != m_Model->getAnimationState(animation) ||          // and animation we want is not animation that currently playing
             m_AnimationPlayType != Entity::PLAY_LOOPED)))                                       // or now playing animation we want but it doesn't looped
@@ -96,7 +96,7 @@ EntityModel::PlayAnimationContinue(const Ogre::String& animation)
 void
 EntityModel::UpdateAnimation(const float delta)
 {
-    if(m_AnimationCurrent != NULL)
+    if(m_AnimationCurrent != nullptr)
     {
         float delta_mod = delta * m_AnimationSpeed;
 

+ 2 - 2
QGearsMain/src/core/InputManager.cpp

@@ -6,7 +6,7 @@
 #include "core/Timer.h"
 
 
-template<>InputManager *Ogre::Singleton<InputManager>::msSingleton = NULL;
+template<>InputManager *Ogre::Singleton<InputManager>::msSingleton = nullptr;
 
 
 InputManager::InputManager():
@@ -178,7 +178,7 @@ InputManager::ActivateBinds(int button)
 
         // handle command
         ConfigCmd* cmd = ConfigCmdManager::getSingleton().Find(params[0]);
-        if(cmd != NULL)
+        if(cmd != nullptr)
         {
             cmd->GetHandler()(params);
         }

+ 11 - 11
QGearsMain/src/core/ScriptManager.cpp

@@ -11,7 +11,7 @@
 
 
 ConfigVar cv_debug_script("debug_script", "Debug script flags. 0x01 - System, 0x02 - Entity, 0x04 - Ui.", "0");
-template<>ScriptManager *Ogre::Singleton<ScriptManager>::msSingleton = NULL;
+template<>ScriptManager *Ogre::Singleton<ScriptManager>::msSingleton = nullptr;
 Ogre::String script_entity_type[] = {"SYSTEM", "ENTITY", "UI"};
 
 
@@ -322,7 +322,7 @@ ScriptManager::AddEntity(const ScriptManager::Type type, const Ogre::String& ent
         script_entity.type = type;
 
         // init entity field for model entity
-        if(entity != NULL)
+        if(entity != nullptr)
         {
             table["entity"] = boost::ref(*entity);
         }
@@ -448,11 +448,11 @@ ScriptManager::GetScriptByScriptId(const ScriptId& script) const
                 }
             }
 
-            return NULL;
+            return nullptr;
         }
     }
 
-    return NULL;
+    return nullptr;
 }
 
 
@@ -467,7 +467,7 @@ ScriptManager::GetScriptEntityByName(const Type type, const Ogre::String& entity
         }
     }
 
-    return NULL;
+    return nullptr;
 }
 
 
@@ -483,7 +483,7 @@ ScriptManager::ContinueScriptExecution(const ScriptId& script)
 {
     QueueScript* script_pointer = GetScriptByScriptId(script);
 
-    if(script_pointer == NULL)
+    if(script_pointer == nullptr)
     {
         LOG_ERROR("There is no script \"" + script.function + "\" for entity \"" + script.entity + "\". Can't continue script execution.");
         return;
@@ -500,7 +500,7 @@ ScriptManager::ScriptWait(const float seconds)
 
     QueueScript* script = GetScriptByScriptId(m_CurrentScriptId);
 
-    if(script == NULL)
+    if(script == nullptr)
     {
         LOG_ERROR("script:wait: Currently no any script running.");
         return 1;
@@ -524,7 +524,7 @@ ScriptManager::ScriptRequest(const Type type, const char* entity, const char* fu
 
     ScriptEntity* script_entity = GetScriptEntityByName(type, Ogre::String(entity));
 
-    if(script_entity == NULL)
+    if(script_entity == nullptr)
     {
         LOG_WARNING("[SCRIPT] script:request: Entity \"" + Ogre::String(entity) + "\" doesn't exist.");
         return;
@@ -546,7 +546,7 @@ ScriptManager::ScriptRequestStartSync(const Type type, const char* entity, const
 
     ScriptEntity* script_entity = GetScriptEntityByName(type, Ogre::String(entity));
 
-    if(script_entity == NULL)
+    if(script_entity == nullptr)
     {
         LOG_ERROR("[SCRIPT] script:request_start_sync: Entity \"" + Ogre::String(entity) + "\" doesn't exist.");
         return 1;
@@ -571,7 +571,7 @@ ScriptManager::ScriptRequestEndSync(const Type type, const char* entity, const c
 
     ScriptEntity* script_entity = GetScriptEntityByName(type, Ogre::String(entity));
 
-    if(script_entity == NULL)
+    if(script_entity == nullptr)
     {
         LOG_ERROR("[SCRIPT] script:request_end_sync: Entity \"" + Ogre::String(entity) + "\" doesn't exist.");
         return 1;
@@ -628,7 +628,7 @@ void
 ScriptManager::AddValueToStack(const float value)
 {
     QueueScript* script = GetScriptByScriptId(m_CurrentScriptId);
-    if(script != NULL)
+    if(script != nullptr)
     {
         lua_pushnumber(script->state, value);
     }

+ 1 - 1
QGearsMain/src/core/Timer.cpp

@@ -3,7 +3,7 @@
 
 
 ConfigVar cv_timer_scale_game("timer_scale_game", "Timer speed for game related things", "1");
-template<>Timer *Ogre::Singleton<Timer>::msSingleton = NULL;
+template<>Timer *Ogre::Singleton<Timer>::msSingleton = nullptr;
 
 
 Timer::Timer():

+ 6 - 6
QGearsMain/src/core/UiManager.cpp

@@ -11,7 +11,7 @@
 #include "core/XmlTextsFile.h"
 
 
-template<>UiManager *Ogre::Singleton<UiManager>::msSingleton = NULL;
+template<>UiManager *Ogre::Singleton<UiManager>::msSingleton = nullptr;
 
 
 UiManager::UiManager()
@@ -116,7 +116,7 @@ UiManager::GetText(const Ogre::String& name) const
         }
     }
 
-    return NULL;
+    return nullptr;
 }
 
 
@@ -138,7 +138,7 @@ UiManager::GetFont(const Ogre::String& name)
         }
     }
 
-    return NULL;
+    return nullptr;
 }
 
 
@@ -163,7 +163,7 @@ UiManager::GetPrototype(const Ogre::String& name) const
         }
     }
 
-    return NULL;
+    return nullptr;
 }
 
 
@@ -179,7 +179,7 @@ UiManager::GetWidget(const Ogre::String& name)
 {
     // get real table by name
     Ogre::StringVector table_path = StringTokenise(name, ".");
-    UiWidget* widget = NULL;
+    UiWidget* widget = nullptr;
 
     if(table_path.size() > 0)
     {
@@ -189,7 +189,7 @@ UiManager::GetWidget(const Ogre::String& name)
             {
                 widget = m_Widgets[i];
 
-                for(unsigned int j = 1; (j < table_path.size()) && (widget != NULL); ++j)
+                for(unsigned int j = 1; (j < table_path.size()) && (widget != nullptr); ++j)
                 {
                     widget = widget->GetChild(table_path[j]);
                 }

+ 8 - 8
QGearsMain/src/core/UiTextArea.cpp

@@ -30,11 +30,11 @@ UiTextArea::~UiTextArea()
 void
 UiTextArea::Initialise()
 {
-    m_Font = NULL;
+    m_Font = nullptr;
     m_MaxLetters = 0;
     m_TextAlign = UiTextArea::LEFT;
     m_Text = "";
-    m_TextNode = NULL;
+    m_TextNode = nullptr;
 
     m_SceneManager = Ogre::Root::getSingleton().getSceneManager("Scene");
     m_RenderSystem = Ogre::Root::getSingletonPtr()->getRenderSystem();
@@ -107,7 +107,7 @@ UiTextArea::SetFont(const Ogre::String& font)
 {
     m_Font = UiManager::getSingleton().GetFont(font);
 
-    if(m_Font == NULL)
+    if(m_Font == nullptr)
     {
         LOG_ERROR("Could not find font \"" + font + "\" for \"" + m_PathName + "\".");
         return;
@@ -134,7 +134,7 @@ UiTextArea::SetFont(const Ogre::String& font)
 void
 UiTextArea::UpdateGeometry()
 {
-    if(m_Font == NULL)
+    if(m_Font == nullptr)
     {
         LOG_ERROR("Font for \"" + m_PathName + "\" if not set.");
         return;
@@ -149,7 +149,7 @@ UiTextArea::UpdateGeometry()
     float length = 0;
     if(m_TextAlign != LEFT)
     {
-        if(m_TextNode != NULL)
+        if(m_TextNode != nullptr)
         {
             length = GetTextLengthFromNode(m_TextNode);
         }
@@ -172,7 +172,7 @@ UiTextArea::UpdateGeometry()
     TextStyle style;
     style.colour = m_Colour1;
 
-    if(m_TextNode != NULL)
+    if(m_TextNode != nullptr)
     {
         SetTextGeometryFromNode(m_TextNode, data, style);
     }
@@ -188,7 +188,7 @@ UiTextArea::GetTextLengthFromNode(TiXmlNode* node) const
 {
     float length = 0;
 
-    while(node != NULL)
+    while(node != nullptr)
     {
         switch(node->Type())
         {
@@ -233,7 +233,7 @@ UiTextArea::GetTextLength(const Ogre::UTFString& text) const
 void
 UiTextArea::SetTextGeometryFromNode(TiXmlNode* node, TextBlockData& data, const TextStyle& style)
 {
-    while(node != NULL)
+    while(node != nullptr)
     {
         switch(node->Type())
         {

+ 20 - 20
QGearsMain/src/core/UiWidget.cpp

@@ -16,7 +16,7 @@ ConfigVar cv_debug_ui("debug_ui", "Draw ui debug info", "0");
 UiWidget::UiWidget(const Ogre::String& name):
     m_Name(name),
     m_PathName(name),
-    m_Parent(NULL)
+    m_Parent(nullptr)
 {
     Initialise();
 }
@@ -87,7 +87,7 @@ UiWidget::Initialise()
     m_ScissorLeft = 0;
     m_ScissorRight = static_cast<int>(m_ScreenWidth);
 
-    m_AnimationCurrent = NULL;
+    m_AnimationCurrent = nullptr;
     m_AnimationDefault = "";
     m_AnimationState = UiAnimation::DEFAULT;
     m_Colour1 = Ogre::ColourValue(1, 1, 1, 1);
@@ -95,7 +95,7 @@ UiWidget::Initialise()
     m_Colour3 = Ogre::ColourValue(1, 1, 1, 1);
     m_Colour4 = Ogre::ColourValue(1, 1, 1, 1);
 
-    ScriptManager::getSingleton().AddEntity(ScriptManager::UI, m_PathName, NULL);
+    ScriptManager::getSingleton().AddEntity(ScriptManager::UI, m_PathName, nullptr);
 }
 
 
@@ -107,7 +107,7 @@ UiWidget::Update()
         return;
     }
 
-    if(m_AnimationCurrent != NULL)
+    if(m_AnimationCurrent != nullptr)
     {
         float delta_time = Timer::getSingleton().GetGameTimeDelta();
         float time = m_AnimationCurrent->GetTime();
@@ -138,7 +138,7 @@ UiWidget::Update()
             m_AnimationCurrent->AddTime(delta_time);
         }
     }
-    else if(m_AnimationCurrent == NULL && m_AnimationState == UiAnimation::DEFAULT && m_AnimationDefault != "")
+    else if(m_AnimationCurrent == nullptr && m_AnimationState == UiAnimation::DEFAULT && m_AnimationDefault != "")
     {
         PlayAnimation(m_AnimationDefault, UiAnimation::DEFAULT, 0, -1);
     }
@@ -203,8 +203,8 @@ UiWidget::Update()
 
         // draw translation
         DEBUG_DRAW.SetColour(Ogre::ColourValue(0, 1, 0, 1));
-        Ogre::Vector2 area_origin = (m_Parent != NULL) ? m_Parent->GetFinalOrigin() : Ogre::Vector2::ZERO;
-        Ogre::Vector2 area_translate = (m_Parent != NULL) ? m_Parent->GetFinalTranslate() : Ogre::Vector2::ZERO;
+        Ogre::Vector2 area_origin = (m_Parent != nullptr) ? m_Parent->GetFinalOrigin() : Ogre::Vector2::ZERO;
+        Ogre::Vector2 area_translate = (m_Parent != nullptr) ? m_Parent->GetFinalTranslate() : Ogre::Vector2::ZERO;
         Ogre::Vector2 pos = area_translate - area_origin;
         DEBUG_DRAW.Line(pos.x, pos.y, x, y);
         DEBUG_DRAW.Quad(x - 2, y - 2, x + 2, y - 2, x + 2, y + 2, x - 2, y + 2);
@@ -292,7 +292,7 @@ UiWidget::GetChild(const Ogre::String& name)
         }
     }
 
-    return NULL;
+    return nullptr;
 }
 
 
@@ -317,7 +317,7 @@ UiWidget::AddAnimation(UiAnimation* animation)
 const Ogre::String&
 UiWidget::GetCurrentAnimationName() const
 {
-    if(m_AnimationCurrent != NULL)
+    if(m_AnimationCurrent != nullptr)
     {
         return m_AnimationCurrent->GetName();
     }
@@ -343,7 +343,7 @@ UiWidget::PlayAnimation(const Ogre::String& animation, UiAnimation::State state,
     }
 
     // stop current state and animation
-    m_AnimationCurrent = NULL;
+    m_AnimationCurrent = nullptr;
     m_AnimationState = UiAnimation::ONCE;
     LOG_ERROR("Widget '" + m_Name + "' doesn't has animation '" + animation + "'.");
 }
@@ -397,11 +397,11 @@ UiWidget::ScriptAnimationSync()
 void
 UiWidget::UpdateTransformation()
 {
-    Ogre::Vector2 area_scale = (m_Parent != NULL) ? m_Parent->GetFinalScale() : Ogre::Vector2(1, 1);
-    Ogre::Vector2 area_origin = (m_Parent != NULL) ? m_Parent->GetFinalOrigin() : Ogre::Vector2::ZERO;
-    Ogre::Vector2 area_translate = (m_Parent != NULL) ? m_Parent->GetFinalTranslate() : Ogre::Vector2::ZERO;
-    Ogre::Vector2 area_size = (m_Parent != NULL) ? m_Parent->GetFinalSize() : Ogre::Vector2(m_ScreenWidth, m_ScreenHeight);
-    float area_rotation = (m_Parent != NULL) ? m_Parent->GetFinalRotation() : 0;
+    Ogre::Vector2 area_scale = (m_Parent != nullptr) ? m_Parent->GetFinalScale() : Ogre::Vector2(1, 1);
+    Ogre::Vector2 area_origin = (m_Parent != nullptr) ? m_Parent->GetFinalOrigin() : Ogre::Vector2::ZERO;
+    Ogre::Vector2 area_translate = (m_Parent != nullptr) ? m_Parent->GetFinalTranslate() : Ogre::Vector2::ZERO;
+    Ogre::Vector2 area_size = (m_Parent != nullptr) ? m_Parent->GetFinalSize() : Ogre::Vector2(m_ScreenWidth, m_ScreenHeight);
+    float area_rotation = (m_Parent != nullptr) ? m_Parent->GetFinalRotation() : 0;
 
     float local_x = ((area_size.x * m_XPercent) / 100.0f + (m_X * m_ScreenHeight / 720.0f) * area_scale.x) - area_origin.x;
     float local_y = ((area_size.y * m_YPercent) / 100.0f + (m_Y * m_ScreenHeight / 720.0f) * area_scale.y) - area_origin.y;
@@ -439,7 +439,7 @@ UiWidget::UpdateTransformation()
     }
     m_FinalTranslate.y += y;
 
-    m_FinalZ = (m_Parent != NULL) ? m_Parent->GetFinalZ() + m_Z : m_Z;
+    m_FinalZ = (m_Parent != nullptr) ? m_Parent->GetFinalZ() + m_Z : m_Z;
     m_FinalScale = area_scale * m_Scale;
     m_FinalSize.x = (area_size.x * m_WidthPercent * m_Scale.x) / 100.0f + (m_Width * m_ScreenHeight / 720.0f) * m_FinalScale.x;
     m_FinalSize.y = (area_size.y * m_HeightPercent * m_Scale.y) / 100.0f + (m_Height * m_ScreenHeight / 720.0f) * m_FinalScale.y;
@@ -448,10 +448,10 @@ UiWidget::UpdateTransformation()
     m_FinalRotation = area_rotation + m_Rotation;
 
     // scissor update
-    m_ScissorTop = (m_Parent != NULL) ? m_Parent->GetScissorTop() : 0;
-    m_ScissorBottom = (m_Parent != NULL) ? m_Parent->GetScissorBottom() : static_cast<int>(m_ScreenHeight);
-    m_ScissorLeft = (m_Parent != NULL) ? m_Parent->GetScissorLeft() : 0;
-    m_ScissorRight = (m_Parent != NULL) ? m_Parent->GetScissorRight() : static_cast<int>(m_ScreenWidth);
+    m_ScissorTop = (m_Parent != nullptr) ? m_Parent->GetScissorTop() : 0;
+    m_ScissorBottom = (m_Parent != nullptr) ? m_Parent->GetScissorBottom() : static_cast<int>(m_ScreenHeight);
+    m_ScissorLeft = (m_Parent != nullptr) ? m_Parent->GetScissorLeft() : 0;
+    m_ScissorRight = (m_Parent != nullptr) ? m_Parent->GetScissorRight() : static_cast<int>(m_ScreenWidth);
 
     if(m_Scissor == true)
     {

+ 10 - 15
QGearsMain/src/core/Walkmesh.cpp

@@ -27,9 +27,9 @@ Walkmesh::UpdateDebug()
         DEBUG_DRAW.SetScreenSpace(true);
         DEBUG_DRAW.SetTextAlignment(DEBUG_DRAW.CENTER);
 
-        for(unsigned int i = 0; i < m_Triangles.size(); ++i)
+        for(const auto &triangle : m_Triangles)
         {
-            if(m_Triangles[i].access_side[0] == -1)
+            if(triangle.access_side[0] == -1)
             {
                 DEBUG_DRAW.SetColour(Ogre::ColourValue(1, 0, 0, 1));
             }
@@ -37,9 +37,9 @@ Walkmesh::UpdateDebug()
             {
                 DEBUG_DRAW.SetColour(Ogre::ColourValue(1, 1, 1, 1));
             }
-            DEBUG_DRAW.Line3d(m_Triangles[i].a, m_Triangles[i].b);
+            DEBUG_DRAW.Line3d(triangle.a, triangle.b);
 
-            if(m_Triangles[i].access_side[1] == -1)
+            if(triangle.access_side[1] == -1)
             {
                 DEBUG_DRAW.SetColour(Ogre::ColourValue(1, 0, 0, 1));
             }
@@ -47,9 +47,9 @@ Walkmesh::UpdateDebug()
             {
                 DEBUG_DRAW.SetColour(Ogre::ColourValue(1, 1, 1, 1));
             }
-            DEBUG_DRAW.Line3d(m_Triangles[i].b, m_Triangles[i].c);
+            DEBUG_DRAW.Line3d(triangle.b, triangle.c);
 
-            if(m_Triangles[i].access_side[2] == -1)
+            if(triangle.access_side[2] == -1)
             {
                 DEBUG_DRAW.SetColour(Ogre::ColourValue(1, 0, 0, 1));
             }
@@ -57,7 +57,7 @@ Walkmesh::UpdateDebug()
             {
                 DEBUG_DRAW.SetColour(Ogre::ColourValue(1, 1, 1, 1));
             }
-            DEBUG_DRAW.Line3d(m_Triangles[i].c, m_Triangles[i].a);
+            DEBUG_DRAW.Line3d(triangle.c, triangle.a);
 
             /*
             if(m_Triangles[i].locked == false)
@@ -73,8 +73,7 @@ Walkmesh::UpdateDebug()
 
             DEBUG_DRAW.SetColour(Ogre::ColourValue(1, 1, 1, 1));
             DEBUG_DRAW.SetFadeDistance(40, 50);
-            Ogre::Vector3 triangle_pos = (m_Triangles[i].a + m_Triangles[i].b + m_Triangles[i].c) / 3;
-            DEBUG_DRAW.Text(triangle_pos, 0, 0, Ogre::StringConverter::toString(i));
+            Ogre::Vector3 triangle_pos = (triangle.a + triangle.b + triangle.c) / 3;
         }
     }
 }
@@ -187,12 +186,8 @@ Walkmesh::IsLocked(unsigned int triangle_id) const
 
 void Walkmesh::load(const QGears::WalkmeshFilePtr &walkmesh)
 {
-    QGears::WalkmeshFile::TriangleList &triangles(walkmesh->getTriangles());
-    QGears::WalkmeshFile::TriangleList::const_iterator it(triangles.begin());
-    QGears::WalkmeshFile::TriangleList::const_iterator it_end(triangles.end());
-    while(it != it_end)
+    for(const auto &triangle : walkmesh->getTriangles())
     {
-        AddTriangle(*it);
-        ++it;
+        AddTriangle(triangle);
     }
 }

+ 3 - 3
QGearsMain/src/core/XmlBackground2DFile.cpp

@@ -23,7 +23,7 @@ XmlBackground2DFile::Load()
     TiXmlNode* node = m_File.RootElement();
     Background2D* background = EntityManager::getSingleton().GetBackground2D();
 
-    if(node == NULL || node->ValueStr() != "background2d")
+    if(node == nullptr || node->ValueStr() != "background2d")
     {
         LOG_ERROR("XML 2D Background loader: " + m_File.ValueStr() + " is not a valid background2d file! No <background2d> in root.");
         return;
@@ -46,7 +46,7 @@ XmlBackground2DFile::Load()
         int tile_id = 0;
 
         node = node->FirstChild();
-        while(node != NULL)
+        while(node != nullptr)
         {
             if(node->Type() == TiXmlNode::TINYXML_ELEMENT && node->ValueStr() == "tile")
             {
@@ -66,7 +66,7 @@ XmlBackground2DFile::Load()
                 background->AddTile(static_cast<int>(destination.x), static_cast<int>(destination.y), width, height, res.z, uv.x, uv.y, uv.z, uv.w, blending);
 
                 TiXmlNode* node2 = node->FirstChild();
-                while(node2 != NULL)
+                while(node2 != nullptr)
                 {
                     if(node2->Type() == TiXmlNode::TINYXML_ELEMENT && node2->ValueStr() == "animation")
                     {

+ 11 - 11
QGearsMain/src/core/XmlFile.cpp

@@ -30,7 +30,7 @@ XmlFile::GetBool(TiXmlNode* node, const Ogre::String& tag, bool def) const
     if(node->Type() == TiXmlNode::TINYXML_ELEMENT)
     {
         const std::string* string = node->ToElement()->Attribute(tag);
-        if(string != NULL)
+        if(string != nullptr)
         {
             ret = Ogre::StringConverter::parseBool(*string);
         }
@@ -48,7 +48,7 @@ XmlFile::GetInt(TiXmlNode* node, const Ogre::String& tag, int def) const
     if(node->Type() == TiXmlNode::TINYXML_ELEMENT)
     {
         const std::string* string = node->ToElement()->Attribute(tag);
-        if(string != NULL)
+        if(string != nullptr)
         {
             ret = Ogre::StringConverter::parseInt(*string);
         }
@@ -66,7 +66,7 @@ XmlFile::GetFloat(TiXmlNode* node, const Ogre::String& tag, float def) const
     if(node->Type() == TiXmlNode::TINYXML_ELEMENT)
     {
         const std::string* string = node->ToElement()->Attribute(tag);
-        if(string != NULL)
+        if(string != nullptr)
         {
             ret = Ogre::StringConverter::parseReal(*string);
         }
@@ -84,7 +84,7 @@ XmlFile::GetString(TiXmlNode* node, const Ogre::String& tag, const Ogre::String&
     if(node->Type() == TiXmlNode::TINYXML_ELEMENT)
     {
         const std::string* string = node->ToElement()->Attribute(tag);
-        if(string != NULL)
+        if(string != nullptr)
         {
             ret = *string;
         }
@@ -102,7 +102,7 @@ XmlFile::GetUTFString(TiXmlNode* node, const Ogre::String& tag, const Ogre::UTFS
     if(node->Type() == TiXmlNode::TINYXML_ELEMENT)
     {
         const std::string* string = node->ToElement()->Attribute(tag);
-        if(string != NULL)
+        if(string != nullptr)
         {
             ret = (*string).c_str();
         }
@@ -120,7 +120,7 @@ XmlFile::GetVector2(TiXmlNode* node, const Ogre::String& tag, const Ogre::Vector
     if(node->Type() == TiXmlNode::TINYXML_ELEMENT)
     {
         const std::string* string = node->ToElement()->Attribute(tag);
-        if(string != NULL)
+        if(string != nullptr)
         {
             ret = Ogre::StringConverter::parseVector2(*string);
         }
@@ -138,7 +138,7 @@ XmlFile::GetVector3(TiXmlNode* node, const Ogre::String& tag, const Ogre::Vector
     if(node->Type() == TiXmlNode::TINYXML_ELEMENT)
     {
         const std::string* string = node->ToElement()->Attribute(tag);
-        if(string != NULL)
+        if(string != nullptr)
         {
             ret = Ogre::StringConverter::parseVector3(*string);
         }
@@ -156,7 +156,7 @@ XmlFile::GetVector4(TiXmlNode* node, const Ogre::String& tag, const Ogre::Vector
     if(node->Type() == TiXmlNode::TINYXML_ELEMENT)
     {
         const std::string* string = node->ToElement()->Attribute(tag);
-        if(string != NULL)
+        if(string != nullptr)
         {
             ret = Ogre::StringConverter::parseVector4(*string);
         }
@@ -174,7 +174,7 @@ XmlFile::GetMatrix4(TiXmlNode* node, const Ogre::String& tag, const Ogre::Matrix
     if(node->Type() == TiXmlNode::TINYXML_ELEMENT)
     {
         const std::string* string = node->ToElement()->Attribute(tag);
-        if(string != NULL)
+        if(string != nullptr)
         {
             ret = Ogre::StringConverter::parseMatrix4(*string);
         }
@@ -192,7 +192,7 @@ XmlFile::GetQuaternion(TiXmlNode* node, const Ogre::String& tag, const Ogre::Qua
     if(node->Type() == TiXmlNode::TINYXML_ELEMENT)
     {
         const std::string* string = node->ToElement()->Attribute(tag);
-        if(string != NULL)
+        if(string != nullptr)
         {
             ret = Ogre::StringConverter::parseQuaternion(*string);
         }
@@ -210,7 +210,7 @@ XmlFile::GetColourValue(TiXmlNode* node, const Ogre::String& tag, const Ogre::Co
     if(node->Type() == TiXmlNode::TINYXML_ELEMENT)
     {
         const std::string* string = node->ToElement()->Attribute(tag);
-        if(string != NULL)
+        if(string != nullptr)
         {
             ret = Ogre::StringConverter::parseColourValue(*string);
         }

+ 2 - 2
QGearsMain/src/core/XmlFontFile.cpp

@@ -20,7 +20,7 @@ XmlFontFile::LoadFont()
 {
     TiXmlNode* node = m_File.RootElement();
 
-    if(node == NULL || node->ValueStr() != "font")
+    if(node == nullptr || node->ValueStr() != "font")
     {
         LOG_ERROR(m_File.ValueStr() + " is not a valid font file! No <font> in root.");
         return;
@@ -39,7 +39,7 @@ XmlFontFile::LoadFont()
 
         node = node->FirstChild();
 
-        while(node != NULL)
+        while(node != nullptr)
         {
             if(node->Type() == TiXmlNode::TINYXML_ELEMENT && node->ValueStr() == "char")
             {

+ 2 - 2
QGearsMain/src/core/XmlFontsFile.cpp

@@ -19,14 +19,14 @@ XmlFontsFile::LoadFonts()
 {
     TiXmlNode* node = m_File.RootElement();
 
-    if(node == NULL || node->ValueStr() != "fonts")
+    if(node == nullptr || node->ValueStr() != "fonts")
     {
         LOG_ERROR("UI XML Manager: " + m_File.ValueStr() + " is not a valid fonts file! No <fonts> in root.");
         return;
     }
 
     node = node->FirstChild();
-    while(node != NULL)
+    while(node != nullptr)
     {
         if(node->Type() == TiXmlNode::TINYXML_ELEMENT && node->ValueStr() == "font")
         {

+ 4 - 4
QGearsMain/src/core/XmlMapFile.cpp

@@ -24,14 +24,14 @@ XmlMapFile::LoadMap()
 {
     TiXmlNode* node = m_File.RootElement();
 
-    if(node == NULL || node->ValueStr() != "map")
+    if(node == nullptr || node->ValueStr() != "map")
     {
         LOG_ERROR(m_File.ValueStr() + " is not a valid fields map file! No <map> in root.");
         return;
     }
 
     node = node->FirstChild();
-    while(node != NULL)
+    while(node != nullptr)
     {
         if(node->Type() == TiXmlNode::TINYXML_ELEMENT && node->ValueStr() == "walkmesh")
         {
@@ -139,14 +139,14 @@ XmlMapFile::GetWalkmeshFileName()
 {
     TiXmlNode* node = m_File.RootElement();
 
-    if(node == NULL || node->ValueStr() != "map")
+    if(node == nullptr || node->ValueStr() != "map")
     {
         LOG_ERROR("Field Map XML Manager: " + m_File.ValueStr() + " is not a valid fields map file! No <map> in root.");
         return "";
     }
 
     node = node->FirstChild();
-    while(node != NULL)
+    while(node != nullptr)
     {
         if(node->Type() == TiXmlNode::TINYXML_ELEMENT && node->ValueStr() == "walkmesh")
         {

+ 4 - 4
QGearsMain/src/core/XmlMapsFile.cpp

@@ -18,14 +18,14 @@ XmlMapsFile::GetMapFileNameByName(const Ogre::String& name)
 {
     TiXmlNode* node = m_File.RootElement();
 
-    if(node == NULL || node->ValueStr() != "maps")
+    if(node == nullptr || node->ValueStr() != "maps")
     {
         LOG_ERROR("Field XML Manager: " + m_File.ValueStr() + " is not a valid maps file! No <maps> in root.");
         return "";
     }
 
     node = node->FirstChild();
-    while(node != NULL)
+    while(node != nullptr)
     {
         if(node->Type() == TiXmlNode::TINYXML_ELEMENT && node->ValueStr() == "map")
         {
@@ -47,14 +47,14 @@ XmlMapsFile::GetMapNames(Ogre::StringVector& complete_params)
 {
     TiXmlNode* node = m_File.RootElement();
 
-    if(node == NULL || node->ValueStr() != "maps")
+    if(node == nullptr || node->ValueStr() != "maps")
     {
         LOG_ERROR("Field XML Manager: " + m_File.ValueStr() + " is not a valid maps file! No <maps> in root.");
         return;
     }
 
     node = node->FirstChild();
-    while(node != NULL)
+    while(node != nullptr)
     {
         if(node->Type() == TiXmlNode::TINYXML_ELEMENT && node->ValueStr() == "map")
         {

+ 2 - 2
QGearsMain/src/core/XmlMusicsFile.cpp

@@ -19,14 +19,14 @@ XmlMusicsFile::LoadMusics()
 {
     TiXmlNode* node = m_File.RootElement();
 
-    if(node == NULL || node->ValueStr() != "musics")
+    if(node == nullptr || node->ValueStr() != "musics")
     {
         LOG_ERROR(m_File.ValueStr() + " is not a valid musics file! No <musics> in root.");
         return;
     }
 
     node = node->FirstChild();
-    while(node != NULL)
+    while(node != nullptr)
     {
         if(node->Type() == TiXmlNode::TINYXML_ELEMENT && node->ValueStr() == "music")
         {

+ 2 - 2
QGearsMain/src/core/XmlPrototypesFile.cpp

@@ -19,14 +19,14 @@ XmlPrototypesFile::LoadPrototypes()
 {
     TiXmlNode* node = m_File.RootElement();
 
-    if(node == NULL || node->ValueStr() != "prototypes")
+    if(node == nullptr || node->ValueStr() != "prototypes")
     {
         LOG_ERROR("UI Manager: " + m_File.ValueStr() + " is not a valid prototypes file! No <prototypes> in root.");
         return;
     }
 
     node = node->FirstChild();
-    while(node != NULL)
+    while(node != nullptr)
     {
         if(node->Type() == TiXmlNode::TINYXML_ELEMENT && node->ValueStr() == "prototype")
         {

+ 6 - 6
QGearsMain/src/core/XmlScreenFile.cpp

@@ -23,7 +23,7 @@ XmlScreenFile::LoadScreen()
 {
     TiXmlNode* node = m_File.RootElement();
 
-    if(node == NULL || node->ValueStr() != "screen")
+    if(node == nullptr || node->ValueStr() != "screen")
     {
         LOG_ERROR(m_File.ValueStr() + " is not a valid screen file! No <screen> in root.");
         return;
@@ -40,7 +40,7 @@ XmlScreenFile::LoadScreen()
     widget->SetVisible(GetBool(node, "visible", false));
 
     node = node->FirstChild();
-    if(node != NULL)
+    if(node != nullptr)
     {
         LoadScreenRecursive(node, base_name, widget);
     }
@@ -52,7 +52,7 @@ XmlScreenFile::LoadScreen()
 void
 XmlScreenFile::LoadScreenRecursive(TiXmlNode* node, const Ogre::String& base_name, UiWidget* widget)
 {
-    while(node != NULL)
+    while(node != nullptr)
     {
         // parse widgets
         if(node->Type() == TiXmlNode::TINYXML_ELEMENT && (node->ValueStr() == "widget" || node->ValueStr() == "sprite" || node->ValueStr() == "text_area" || node->ValueStr() == "prototype"))
@@ -63,10 +63,10 @@ XmlScreenFile::LoadScreenRecursive(TiXmlNode* node, const Ogre::String& base_nam
                 if(name != "")
                 {
                     TiXmlNode* node2 = UiManager::getSingleton().GetPrototype(name);
-                    if(node != NULL)
+                    if(node != nullptr)
                     {
                         node2 = node2->FirstChild();
-                        if(node2 != NULL)
+                        if(node2 != nullptr)
                         {
                             LoadScreenRecursive(node2, base_name, widget);
                         }
@@ -241,7 +241,7 @@ XmlScreenFile::LoadScreenRecursive(TiXmlNode* node, const Ogre::String& base_nam
                     widget->AddChild(widget2);
 
                     TiXmlNode* node2 = node->FirstChild();
-                    if(node2 != NULL)
+                    if(node2 != nullptr)
                     {
                         LoadScreenRecursive(node2, base_name + "." + name, widget2);
                     }

+ 2 - 2
QGearsMain/src/core/XmlScreensFile.cpp

@@ -19,14 +19,14 @@ XmlScreensFile::LoadScreens()
 {
     TiXmlNode* node = m_File.RootElement();
 
-    if(node == NULL || node->ValueStr() != "screens")
+    if(node == nullptr || node->ValueStr() != "screens")
     {
         LOG_ERROR("UI XML Manager: " + m_File.ValueStr() + " is not a valid screens file! No <screens> in root.");
         return;
     }
 
     node = node->FirstChild();
-    while(node != NULL)
+    while(node != nullptr)
     {
         if(node->Type() == TiXmlNode::TINYXML_ELEMENT && node->ValueStr() == "screen")
         {

+ 3 - 3
QGearsMain/src/core/XmlScriptsFile.cpp

@@ -19,7 +19,7 @@ XmlScriptsFile::LoadScripts()
 {
     TiXmlNode* node = m_File.RootElement();
 
-    if(node == NULL || node->ValueStr() != "scripts")
+    if(node == nullptr || node->ValueStr() != "scripts")
     {
         LOG_ERROR(m_File.ValueStr() + " is not a valid scripts file! No <scripts> in root.");
         return;
@@ -27,7 +27,7 @@ XmlScriptsFile::LoadScripts()
 
     node = node->FirstChild();
     ScriptManager &script_manager(ScriptManager::getSingleton());
-    while(node != NULL)
+    while(node != nullptr)
     {
         if(node->Type() == TiXmlNode::TINYXML_ELEMENT && node->ValueStr() == "script")
         {
@@ -42,7 +42,7 @@ XmlScriptsFile::LoadScripts()
                 continue;
             }
 
-            script_manager.AddEntity(ScriptManager::SYSTEM, name, NULL);
+            script_manager.AddEntity(ScriptManager::SYSTEM, name, nullptr);
         }
 
         node = node->NextSibling();

+ 2 - 2
QGearsMain/src/core/XmlTextFile.cpp

@@ -19,14 +19,14 @@ XmlTextFile::LoadText()
 {
     TiXmlNode* node = m_File.RootElement();
 
-    if(node == NULL || node->ValueStr() != "texts")
+    if(node == nullptr || node->ValueStr() != "texts")
     {
         LOG_ERROR("UI Manager: " + m_File.ValueStr() + " is not a valid text file! No <texts> in root.");
         return;
     }
 
     node = node->FirstChild();
-    while(node != NULL)
+    while(node != nullptr)
     {
         if(node->Type() == TiXmlNode::TINYXML_ELEMENT && node->ValueStr() == "text")
         {

+ 3 - 3
QGearsMain/src/core/XmlTextsFile.cpp

@@ -19,21 +19,21 @@ XmlTextsFile::LoadTexts( const Ogre::String& language)
 {
     TiXmlNode* node = m_File.RootElement();
 
-    if( node == NULL || node->ValueStr() != "texts")
+    if( node == nullptr || node->ValueStr() != "texts")
     {
         LOG_ERROR( "UI Text Manager: " + m_File.ValueStr() + " is not a valid texts file! No <texts> in root.");
         return;
     }
 
     node = node->FirstChild();
-    while( node != NULL)
+    while( node != nullptr)
     {
         if( node->Type() == TiXmlNode::TINYXML_ELEMENT && node->ValueStr() == "language")
         {
             if( GetString( node, "name") == language)
             {
                 TiXmlNode* node2 = node->FirstChild();
-                while( node2 != NULL)
+                while( node2 != nullptr)
                 {
                     if( node2->Type() == TiXmlNode::TINYXML_ELEMENT && node2->ValueStr() == "text")
                     {

+ 2 - 2
QGearsMain/src/core/XmlWalkmeshFile.cpp

@@ -25,14 +25,14 @@ XmlWalkmeshFile::Load()
     TiXmlNode* node = m_File.RootElement();
     Walkmesh* walkmesh = EntityManager::getSingleton().GetWalkmesh();
 
-    if( node == NULL || node->ValueStr() != "walkmesh" )
+    if( node == nullptr || node->ValueStr() != "walkmesh" )
     {
         LOG_ERROR( "Field XML Manager: " + m_File.ValueStr() + " is not a valid walkmesh file! No <walkmesh> in root." );
         return;
     }
 
     node = node->FirstChild();
-    while( node != NULL )
+    while( node != nullptr )
     {
         if( node->Type() == TiXmlNode::TINYXML_ELEMENT && node->ValueStr() == "triangle" )
         {

+ 2 - 2
QGearsMain/src/core/particles/Particle.cpp

@@ -3,12 +3,12 @@
 
 //------------------------------------------------------------------------------
 Particle::Particle():
-    m_ParentEmitter(NULL),
+    m_ParentEmitter(nullptr),
     m_ParticleType(PT_VISUAL),
     m_Enabled(true),
     m_Emittable(false),
 
-    additional_data(NULL),
+    additional_data(nullptr),
     position(Ogre::Vector3::ZERO),
     direction(Ogre::Vector3::ZERO),
     time_to_live(10),

+ 1 - 1
QGearsMain/src/core/particles/ParticleEmitter.cpp

@@ -14,7 +14,7 @@ ParticleEmitterDictionary::Direction        ParticleEmitter::m_DirectionDictiona
 //------------------------------------------------------------------------------
 ParticleEmitter::ParticleEmitter(void) :
     Particle(),
-    m_ParentTechnique(NULL),
+    m_ParentTechnique(nullptr),
     m_Name(Ogre::StringUtil::BLANK),
     m_EmitsName(Ogre::StringUtil::BLANK),
     m_EmitsType(PT_VISUAL),

+ 1 - 1
QGearsMain/src/core/particles/ParticleEmitterTranslator.cpp

@@ -20,7 +20,7 @@ ParticleEmitterTranslator::translate(Ogre::ScriptCompiler *compiler, const Ogre:
     ParticleTechnique* tech = Ogre::any_cast<ParticleTechnique*>(obj->parent->context);
 
     ParticleEmitter* emitter = tech->CreateEmitter(obj->name);
-    if (emitter == NULL)
+    if (emitter == nullptr)
     {
         compiler->addError(Ogre::ScriptCompiler::CE_OBJECTALLOCATIONERROR, obj->file, obj->line);
         return;

+ 1 - 1
QGearsMain/src/core/particles/ParticleRenderer.cpp

@@ -2,7 +2,7 @@
 
 //------------------------------------------------------------------------------
 ParticleRenderer::ParticleRenderer():
-    m_ParentTechnique(NULL),
+    m_ParentTechnique(nullptr),
     m_RendererInitialised(false)
 {
 }

+ 1 - 1
QGearsMain/src/core/particles/ParticleRendererTranslator.cpp

@@ -20,7 +20,7 @@ ParticleRendererTranslator::translate(Ogre::ScriptCompiler *compiler, const Ogre
     ParticleTechnique* tech = Ogre::any_cast<ParticleTechnique*>(obj->parent->context);
 
     ParticleRenderer* rend = tech->CreateRenderer(obj->name);
-    if (rend == NULL)
+    if (rend == nullptr)
     {
         compiler->addError(Ogre::ScriptCompiler::CE_OBJECTALLOCATIONERROR, obj->file, obj->line);
         return;

+ 1 - 1
QGearsMain/src/core/particles/ParticleSystem.cpp

@@ -31,7 +31,7 @@ ParticleSystem::CopyAttributesTo( ParticleSystem* ps )
     ps->DestroyAllTechniques();
 
     // Copy techniques
-    ParticleTechnique* cloned_technique = NULL;
+    ParticleTechnique* cloned_technique = nullptr;
     for( unsigned int i = 0; i < m_Techniques.size(); ++i )
     {
         cloned_technique = ParticleSystemManager::getSingletonPtr()->CloneTechnique( m_Techniques[ i ] );

+ 6 - 6
QGearsMain/src/core/particles/ParticleSystemManager.cpp

@@ -8,7 +8,7 @@
 #include "core/particles/renderer/ParticleEntityRendererFactory.h"
 
 //------------------------------------------------------------------------------
-template<> ParticleSystemManager* Ogre::Singleton<ParticleSystemManager>::msSingleton = NULL;
+template<> ParticleSystemManager* Ogre::Singleton<ParticleSystemManager>::msSingleton = nullptr;
 
 //------------------------------------------------------------------------------
 ParticleSystemManager::ParticleSystemManager()
@@ -135,9 +135,9 @@ ParticleSystemManager::CreateTechnique()
 ParticleTechnique*
 ParticleSystemManager::CloneTechnique(ParticleTechnique* technique)
 {
-    if (technique == NULL)
+    if (technique == nullptr)
     {
-        return NULL;
+        return nullptr;
     }
 
     ParticleTechnique* cloned_technique = CreateTechnique();
@@ -172,7 +172,7 @@ ParticleSystemManager::CloneEmitter(ParticleEmitter* emitter)
 {
     if (!emitter)
     {
-        return NULL;
+        return nullptr;
     }
 
     ParticleEmitter* cloned_emitter = CreateEmitter(emitter->GetEmitterType());
@@ -212,9 +212,9 @@ ParticleSystemManager::CreateRenderer(const Ogre::String& renderer_type)
 ParticleRenderer*
 ParticleSystemManager::CloneRenderer(ParticleRenderer* renderer)
 {
-    if (renderer == NULL)
+    if (renderer == nullptr)
     {
-        return NULL;
+        return nullptr;
     }
 
     ParticleRenderer* cloned_renderer = CreateRenderer(renderer->GetRendererType());

+ 1 - 1
QGearsMain/src/core/particles/ParticleSystemTranslatorManager.cpp

@@ -13,7 +13,7 @@ ParticleSystemTranslatorManager::getNumTranslators() const
 Ogre::ScriptTranslator*
 ParticleSystemTranslatorManager::getTranslator(const Ogre::AbstractNodePtr &node)
 {
-    Ogre::ScriptTranslator* translator = NULL;
+    Ogre::ScriptTranslator* translator = nullptr;
     if (node->type == Ogre::ANT_OBJECT)
     {
         Ogre::ObjectAbstractNode* obj = reinterpret_cast<Ogre::ObjectAbstractNode*>(node.get());

+ 9 - 9
QGearsMain/src/core/particles/ParticleTechnique.cpp

@@ -8,7 +8,7 @@
 
 //------------------------------------------------------------------------------
 ParticleTechnique::ParticleTechnique():
-    m_Renderer(NULL),
+    m_Renderer(nullptr),
 
     m_VisualParticleQuota(10),
     m_VisualParticlePoolIncreased(false),
@@ -87,7 +87,7 @@ ParticleTechnique::Initialize()
         if (m_VisualParticleQuota > old_size)
         {
             // Create new visual particles
-            VisualParticle* particle = NULL;
+            VisualParticle* particle = nullptr;
             for (int i = old_size; i < m_VisualParticleQuota; ++i)
             {
                 particle = new VisualParticle();
@@ -173,7 +173,7 @@ ParticleTechnique::Update(Ogre::Real time_elapsed)
         VisualParticle* particle = m_VisualParticlesPool.GetFirst();
         while (!m_VisualParticlesPool.End())
         {
-            if (particle != NULL)
+            if (particle != nullptr)
             {
                 Ogre::LogManager::getSingletonPtr()->logMessage("ParticleTechnique::Update found particle with ttl " + Ogre::StringConverter::toString(particle->time_to_live));
                 if (particle->time_to_live > time_elapsed)
@@ -276,7 +276,7 @@ ParticleTechnique::DestroyRenderer()
     if (m_Renderer)
     {
         ParticleSystemManager::getSingletonPtr()->DestroyRenderer(m_Renderer);
-        m_Renderer = NULL;
+        m_Renderer = nullptr;
     }
 }
 
@@ -284,7 +284,7 @@ ParticleTechnique::DestroyRenderer()
 ParticleEmitter*
 ParticleTechnique::CreateEmitter(const Ogre::String& emitter_type)
 {
-    ParticleEmitter* emitter = NULL;
+    ParticleEmitter* emitter = nullptr;
 
     if (emitter_type != Ogre::StringUtil::BLANK)
     {
@@ -301,7 +301,7 @@ ParticleTechnique::CreateEmitter(const Ogre::String& emitter_type)
 void
 ParticleTechnique::AddEmitter(ParticleEmitter* emitter)
 {
-    if (emitter != NULL)
+    if (emitter != nullptr)
     {
         m_Emitters.push_back(emitter);
         emitter->SetParentTechnique(this);
@@ -379,7 +379,7 @@ ParticleTechnique::ExecuteEmitParticles(ParticleEmitter* emitter, int requested,
     for (int j = 0; j < requested; ++j)
     {
         // Create a new particle & init using emitter
-        Particle* particle = NULL;
+        Particle* particle = nullptr;
         switch (emitter->GetEmitsType())
         {
             case Particle::PT_VISUAL: particle = m_VisualParticlesPool.ReleaseElement(); break;
@@ -387,7 +387,7 @@ ParticleTechnique::ExecuteEmitParticles(ParticleEmitter* emitter, int requested,
         }
 
         // Return if there is no particle left anymore, or the name cannot be found
-        if (particle == NULL)
+        if (particle == nullptr)
         {
             Ogre::LogManager::getSingletonPtr()->logMessage("ParticleTechnique::ExecuteEmitParticles request there is no particles left.");
             return;
@@ -406,7 +406,7 @@ ParticleTechnique::ResetVisualParticles()
 {
     for( unsigned int i = 0; i < m_VisualParticles.size(); ++i )
     {
-        m_VisualParticles[i]->additional_data = NULL;
+        m_VisualParticles[i]->additional_data = nullptr;
     }
     m_VisualParticlesPool.LockAllElements();
 }

+ 1 - 1
QGearsMain/src/core/particles/ParticleVisual.cpp

@@ -14,7 +14,7 @@ VisualParticle::InitForExpiration()
 {
     Particle::InitForExpiration();
 
-    if (additional_data != NULL)
+    if (additional_data != nullptr)
     {
         additional_data->SetVisible(false);
     }

+ 2 - 2
QGearsMain/src/core/particles/renderer/ParticleEntityRenderer.cpp

@@ -28,7 +28,7 @@ ParticleEntityRenderer::ParticleEntityRenderer():
 //------------------------------------------------------------------------------
 ParticleEntityRenderer::~ParticleEntityRenderer()
 {
-    if (m_ParentTechnique == NULL)
+    if (m_ParentTechnique == nullptr)
     {
         return;
     }
@@ -70,7 +70,7 @@ ParticleEntityRenderer::SetMeshName(const Ogre::String& mesh_name)
 void
 ParticleEntityRenderer::Clear()
 {
-    if (m_ParentTechnique == NULL)
+    if (m_ParentTechnique == nullptr)
     {
         return;
     }

+ 1 - 1
QGearsMain/src/data/QGearsAFileManager.cpp

@@ -16,7 +16,7 @@ GNU General Public License for more details.
 */
 #include "data/QGearsAFileManager.h"
 
-template<> QGears::AFileManager *Ogre::Singleton<QGears::AFileManager>::msSingleton = NULL;
+template<> QGears::AFileManager *Ogre::Singleton<QGears::AFileManager>::msSingleton = nullptr;
 
 namespace QGears
 {

+ 1 - 1
QGearsMain/src/data/QGearsBackgroundFileManager.cpp

@@ -26,7 +26,7 @@ THE SOFTWARE.
 #include "data/QGearsBackgroundFileManager.h"
 
 //-------------------------------------------------------------------------
-template<> QGears::BackgroundFileManager *Ogre::Singleton<QGears::BackgroundFileManager>::msSingleton = NULL;
+template<> QGears::BackgroundFileManager *Ogre::Singleton<QGears::BackgroundFileManager>::msSingleton = nullptr;
 
 namespace QGears
 {

+ 1 - 1
QGearsMain/src/data/QGearsCameraMatrixFileManager.cpp

@@ -25,7 +25,7 @@ THE SOFTWARE.
 */
 #include "data/QGearsCameraMatrixFileManager.h"
 
-template<> QGears::CameraMatrixFileManager *Ogre::Singleton<QGears::CameraMatrixFileManager>::msSingleton = NULL;
+template<> QGears::CameraMatrixFileManager *Ogre::Singleton<QGears::CameraMatrixFileManager>::msSingleton = nullptr;
 
 namespace QGears
 {

+ 6 - 6
QGearsMain/src/data/QGearsFLevelFile.cpp

@@ -52,8 +52,8 @@ namespace QGears
                  ,const String &group, bool isManual
                  ,Ogre::ManualResourceLoader *loader ) :
         Resource( creator, name, handle, group, isManual, loader )
-       ,m_background_texture_loader( NULL )
-       ,m_background_2d_loader( NULL )
+       ,m_background_texture_loader( nullptr )
+       ,m_background_2d_loader( nullptr )
     {
         createParamDictionary( getResourceType() );
     }
@@ -66,7 +66,7 @@ namespace QGears
             assert( !m_background_texture.isNull() );
             Ogre::TextureManager::getSingleton().remove( m_background_texture->getHandle() );
             delete m_background_texture_loader;
-            m_background_texture_loader = NULL;
+            m_background_texture_loader = nullptr;
         }
         m_background_texture.setNull();
 
@@ -75,7 +75,7 @@ namespace QGears
             assert( !m_background_2d.isNull() );
             Background2DFileManager::getSingleton().remove( m_background_2d->getHandle() );
             delete m_background_2d_loader;
-            m_background_2d_loader = NULL;
+            m_background_2d_loader = nullptr;
         }
         m_background_2d.setNull();
 
@@ -96,14 +96,14 @@ namespace QGears
         serializer.importFLevelFile( stream, this );
 
         String background_texture_name( getBackgroundTextureName() );
-        if( m_background_texture_loader == NULL )
+        if( m_background_texture_loader == nullptr )
         {
             m_background_texture_loader = new FLevelTextureLoader( *this );
             m_background_texture = Ogre::TextureManager::getSingleton().create( background_texture_name, mGroup, true, m_background_texture_loader );
         }
 
         String background_2d_name( getBackground2DName() );
-        if( m_background_2d_loader == NULL )
+        if( m_background_2d_loader == nullptr )
         {
             m_background_2d_loader = new FLevelBackground2DLoader( *this );
             m_background_2d = Background2DFileManager::getSingleton().createResource( background_2d_name, mGroup, true, m_background_2d_loader ).staticCast<Background2DFile>();

+ 1 - 1
QGearsMain/src/data/QGearsFLevelFileManager.cpp

@@ -25,7 +25,7 @@ THE SOFTWARE.
 */
 #include "data/QGearsFLevelFileManager.h"
 
-template<> QGears::FLevelFileManager *Ogre::Singleton<QGears::FLevelFileManager>::msSingleton = NULL;
+template<> QGears::FLevelFileManager *Ogre::Singleton<QGears::FLevelFileManager>::msSingleton = nullptr;
 
 namespace QGears
 {

+ 6 - 6
QGearsMain/src/data/QGearsHRCFile.cpp

@@ -48,8 +48,8 @@ namespace QGears
                      ,const String &group, bool isManual
                      ,Ogre::ManualResourceLoader *loader ) :
         Ogre::Resource( creator, name, handle, group, isManual, loader )
-       ,m_mesh_loader( NULL )
-       ,m_skeleton_loader( NULL )
+       ,m_mesh_loader( nullptr )
+       ,m_skeleton_loader( nullptr )
     {
         createParamDictionary( RESOURCE_TYPE );
     }
@@ -61,13 +61,13 @@ namespace QGears
         {
             Ogre::SkeletonManager::getSingleton().remove( m_skeleton->getHandle() );
             delete m_skeleton_loader;
-            m_skeleton_loader = NULL;
+            m_skeleton_loader = nullptr;
         }
         if( m_mesh_loader )
         {
             Ogre::MeshManager::getSingleton().remove( m_mesh->getHandle() );
             delete m_mesh_loader;
-            m_mesh_loader = NULL;
+            m_mesh_loader = nullptr;
         }
 
         m_skeleton.setNull();
@@ -88,7 +88,7 @@ namespace QGears
         m_skeleton = skeleton_manager.getByName( skeleton_file_name, mGroup );
         if( m_skeleton.isNull() )
         {
-            assert( m_skeleton_loader == NULL );
+            assert( m_skeleton_loader == nullptr );
             m_skeleton_loader = new HRCSkeletonLoader( *this );
             m_skeleton = skeleton_manager.create( skeleton_file_name, mGroup, true, m_skeleton_loader );
         }
@@ -100,7 +100,7 @@ namespace QGears
         m_mesh = mesh_manager.getByName( mesh_file_name, mGroup );
         if( m_mesh.isNull() )
         {
-            assert( m_mesh_loader == NULL );
+            assert( m_mesh_loader == nullptr );
             m_mesh_loader = new HRCMeshLoader( *this );
             m_mesh = mesh_manager.create( mesh_file_name, mGroup, true, m_mesh_loader );
         }

+ 1 - 1
QGearsMain/src/data/QGearsHRCFileManager.cpp

@@ -27,7 +27,7 @@ THE SOFTWARE.
 
 #include <OgreLogManager.h>
 
-template<> QGears::HRCFileManager *Ogre::Singleton<QGears::HRCFileManager>::msSingleton = NULL;
+template<> QGears::HRCFileManager *Ogre::Singleton<QGears::HRCFileManager>::msSingleton = nullptr;
 
 namespace QGears
 {

+ 1 - 1
QGearsMain/src/data/QGearsLGPArchive.cpp

@@ -98,7 +98,7 @@ namespace QGears
     LGPArchive::open( const String& filename, bool readOnly ) const
     {
         LOG_DEBUG( "file:" + filename + " readOnly: " + Ogre::StringConverter::toString(readOnly) );
-        Ogre::MemoryDataStream* buffer( NULL );
+        Ogre::MemoryDataStream* buffer( nullptr );
         if( !m_lgp_file.isNull() )
         {
             FileList::const_iterator it( m_files.begin() );

+ 1 - 1
QGearsMain/src/data/QGearsLZSFLevelFileManager.cpp

@@ -25,7 +25,7 @@ THE SOFTWARE.
 */
 #include "data/QGearsLZSFLevelFileManager.h"
 
-template<> QGears::LZSFLevelFileManager *Ogre::Singleton<QGears::LZSFLevelFileManager>::msSingleton = NULL;
+template<> QGears::LZSFLevelFileManager *Ogre::Singleton<QGears::LZSFLevelFileManager>::msSingleton = nullptr;
 
 namespace QGears
 {

+ 1 - 1
QGearsMain/src/data/QGearsPFileManager.cpp

@@ -25,7 +25,7 @@ THE SOFTWARE.
 */
 #include "data/QGearsPFileManager.h"
 
-template<> QGears::PFileManager *Ogre::Singleton<QGears::PFileManager>::msSingleton = NULL;
+template<> QGears::PFileManager *Ogre::Singleton<QGears::PFileManager>::msSingleton = nullptr;
 
 namespace QGears
 {

+ 1 - 1
QGearsMain/src/data/QGearsPaletteFileManager.cpp

@@ -25,7 +25,7 @@ THE SOFTWARE.
 */
 #include "data/QGearsPaletteFileManager.h"
 
-template<> QGears::PaletteFileManager *Ogre::Singleton<QGears::PaletteFileManager>::msSingleton = NULL;
+template<> QGears::PaletteFileManager *Ogre::Singleton<QGears::PaletteFileManager>::msSingleton = nullptr;
 
 namespace QGears
 {

+ 1 - 1
QGearsMain/src/data/QGearsRSDFileManager.cpp

@@ -25,7 +25,7 @@ THE SOFTWARE.
 */
 #include "data/QGearsRSDFileManager.h"
 
-template<> QGears::RSDFileManager *Ogre::Singleton<QGears::RSDFileManager>::msSingleton = NULL;
+template<> QGears::RSDFileManager *Ogre::Singleton<QGears::RSDFileManager>::msSingleton = nullptr;
 
 namespace QGears
 {

+ 4 - 4
QGearsMain/src/data/QGearsTexCodec.cpp

@@ -90,13 +90,13 @@ namespace QGears
     }
 
     //---------------------------------------------------------------------
-    TexCodec *TexCodec::ms_tex_codex( NULL );
+    TexCodec *TexCodec::ms_tex_codex( nullptr );
 
     //---------------------------------------------------------------------
     void TexCodec::install()
     {
         //install called - create stuff here
-        if( ms_tex_codex == NULL )
+        if( ms_tex_codex == nullptr )
         {
             ms_tex_codex = OGRE_NEW TexCodec();
         }
@@ -124,10 +124,10 @@ namespace QGears
     void TexCodec::uninstall()
     {
         //uninstall called - delete stuff here
-        if( ms_tex_codex != NULL )
+        if( ms_tex_codex != nullptr )
         {
             OGRE_DELETE ms_tex_codex;
-            ms_tex_codex = NULL;
+            ms_tex_codex = nullptr;
         }
     }
 }

+ 9 - 9
QGearsMain/src/data/QGearsXMLSerializer.cpp

@@ -61,7 +61,7 @@ namespace QGears
     XMLSerializer::readAttribute( TiXmlNode &node, const String &attribute, bool &pDest, const bool &pDefault)
     {
         const String *value( readAttribute( node, attribute ) );
-        if( value == NULL )
+        if( value == nullptr )
         {
             pDest = pDefault;
             return false;
@@ -75,7 +75,7 @@ namespace QGears
     XMLSerializer::readAttribute( TiXmlNode &node, const String &attribute, int &pDest, const int &pDefault)
     {
         const String *value( readAttribute( node, attribute ) );
-        if( value == NULL )
+        if( value == nullptr )
         {
             pDest = pDefault;
             return false;
@@ -90,7 +90,7 @@ namespace QGears
                                 , String &pDest, const String &pDefault )
     {
         const String *value( readAttribute( node, attribute ) );
-        if( value == NULL )
+        if( value == nullptr )
         {
             pDest = pDefault;
             return false;
@@ -104,7 +104,7 @@ namespace QGears
     XMLSerializer::readAttribute(TiXmlNode &node, const String &attribute, Ogre::Real &pDest, const Ogre::Real &pDefault)
     {
         const String *value( readAttribute( node, attribute ) );
-        if( value == NULL )
+        if( value == nullptr )
         {
             pDest = pDefault;
             return false;
@@ -118,7 +118,7 @@ namespace QGears
     XMLSerializer::readAttribute(TiXmlNode &node, const String &attribute, Ogre::Vector2 &pDest, const Ogre::Vector2 &pDefault)
     {
         const String *value( readAttribute( node, attribute ) );
-        if( value == NULL )
+        if( value == nullptr )
         {
             pDest = pDefault;
             return false;
@@ -132,7 +132,7 @@ namespace QGears
     XMLSerializer::readAttribute(TiXmlNode &node, const String &attribute, Ogre::Vector3 &pDest, const Ogre::Vector3 &pDefault)
     {
         const String *value( readAttribute( node, attribute ) );
-        if( value == NULL )
+        if( value == nullptr )
         {
             pDest = pDefault;
             return false;
@@ -146,7 +146,7 @@ namespace QGears
     XMLSerializer::readAttribute(TiXmlNode &node, const String &attribute, Ogre::Vector4 &pDest, const Ogre::Vector4 &pDefault)
     {
         const String *value( readAttribute( node, attribute ) );
-        if( value == NULL )
+        if( value == nullptr )
         {
             pDest = pDefault;
             return false;
@@ -160,7 +160,7 @@ namespace QGears
     XMLSerializer::readAttribute(TiXmlNode &node, const String &attribute, Ogre::Quaternion &pDest, const Ogre::Quaternion &pDefault)
     {
         const String *value( readAttribute( node, attribute ) );
-        if( value == NULL )
+        if( value == nullptr )
         {
             pDest = pDefault;
             return false;
@@ -174,7 +174,7 @@ namespace QGears
     XMLSerializer::findChildNode( TiXmlNode &node, const String &tag )
     {
         TiXmlNode* child( node.FirstChild() );
-        while( child != NULL && child->ValueStr() != tag )
+        while( child != nullptr && child->ValueStr() != tag )
         {
             child = child->NextSibling();
         }

+ 1 - 1
QGearsMain/src/map/QGearsBackground2DFileManager.cpp

@@ -25,7 +25,7 @@ THE SOFTWARE.
 */
 #include "map/QGearsBackground2DFileManager.h"
 
-template<> QGears::Background2DFileManager *Ogre::Singleton<QGears::Background2DFileManager>::msSingleton = NULL;
+template<> QGears::Background2DFileManager *Ogre::Singleton<QGears::Background2DFileManager>::msSingleton = nullptr;
 
 namespace QGears
 {

+ 2 - 2
QGearsMain/src/map/QGearsBackground2DFileXMLSerializer.cpp

@@ -49,7 +49,7 @@ namespace QGears
     void
     Background2DFileXMLSerializer::readHeader( TiXmlNode *node )
     {
-        if( node == NULL || node->ValueStr() != "background2d" )
+        if( node == nullptr || node->ValueStr() != "background2d" )
         {
             OGRE_EXCEPT(Ogre::Exception::ERR_INVALIDPARAMS
                 ,"not a valid background2d file, no <background2d> in root"
@@ -62,7 +62,7 @@ namespace QGears
     Background2DFileXMLSerializer::readAttribute( TiXmlNode &node, const String &attribute, Blending &pDest, const Blending &pDefault )
     {
         const String *value( readAttribute( node, attribute ) );
-        if( value == NULL )
+        if( value == nullptr )
         {
             pDest = pDefault;
             return false;

+ 1 - 1
QGearsMain/src/map/QGearsMapFileManager.cpp

@@ -16,7 +16,7 @@ GNU General Public License for more details.
 */
 #include "map/QGearsMapFileManager.h"
 
-template<> QGears::MapFileManager *Ogre::Singleton<QGears::MapFileManager>::msSingleton = NULL;
+template<> QGears::MapFileManager *Ogre::Singleton<QGears::MapFileManager>::msSingleton = nullptr;
 
 namespace QGears
 {

+ 6 - 6
QGearsMain/src/map/QGearsMapFileXMLSerializer.cpp

@@ -35,7 +35,7 @@ namespace QGears
     //--------------------------------------------------------------------------
     void MapFileXMLSerializer::readHeader( TiXmlNode *node )
     {
-        if( node == NULL || node->ValueStr() != "map" )
+        if( node == nullptr || node->ValueStr() != "map" )
         {
             OGRE_EXCEPT(Ogre::Exception::ERR_INVALIDPARAMS
                 ,"not a valid map file, no <map> in root"
@@ -66,7 +66,7 @@ namespace QGears
     MapFileXMLSerializer::readScript( TiXmlNode &node, MapFile *pDest )
     {
         TiXmlNode *child( findChildNode( node, "script" ) );
-        if( child != NULL )
+        if( child != nullptr )
         {
             String file_name;
             readAttribute( *child, "file_name", file_name );
@@ -79,7 +79,7 @@ namespace QGears
     MapFileXMLSerializer::readBackground2D( TiXmlNode &node, MapFile *pDest )
     {
         TiXmlNode *child( findChildNode( node, "background2d" ) );
-        if( child != NULL )
+        if( child != nullptr )
         {
             String file_name;
             readAttribute( *child, "file_name", file_name );
@@ -92,7 +92,7 @@ namespace QGears
     MapFileXMLSerializer::readWalkmesh( TiXmlNode &node, MapFile *pDest )
     {
         TiXmlNode *child( findChildNode( node, "walkmesh" ) );
-        if( child != NULL )
+        if( child != nullptr )
         {
             String file_name;
             readAttribute( *child, "file_name", file_name );
@@ -105,7 +105,7 @@ namespace QGears
     MapFileXMLSerializer::readForwardDirection( TiXmlNode &node, MapFile *pDest )
     {
         TiXmlNode *child( findChildNode( node, "movement_rotation" ) );
-        if( child != NULL )
+        if( child != nullptr )
         {
             Ogre::Real degree;
             readAttribute( *child, "degree", degree );
@@ -155,7 +155,7 @@ namespace QGears
     {
         pDest.clear();
         TiXmlNode* child( node.FirstChild() );
-        while( child != NULL )
+        while( child != nullptr )
         {
             if( child->Type() == TiXmlNode::TINYXML_ELEMENT && child->ValueStr() == tag )
             {

+ 1 - 1
QGearsMain/src/map/QGearsWalkmeshFileManager.cpp

@@ -16,7 +16,7 @@ GNU General Public License for more details.
 */
 #include "map/QGearsWalkmeshFileManager.h"
 
-template<> QGears::WalkmeshFileManager *Ogre::Singleton<QGears::WalkmeshFileManager>::msSingleton = NULL;
+template<> QGears::WalkmeshFileManager *Ogre::Singleton<QGears::WalkmeshFileManager>::msSingleton = nullptr;
 
 namespace QGears
 {

+ 1 - 1
QGearsMain/src/map/QGearsWalkmeshFileXMLSerializer.cpp

@@ -19,7 +19,7 @@ namespace QGears
     //--------------------------------------------------------------------------
     void WalkmeshFileXMLSerializer::readHeader( TiXmlNode *node )
     {
-        if( node == NULL || node->ValueStr() != "walkmesh" )
+        if( node == nullptr || node->ValueStr() != "walkmesh" )
         {
             OGRE_EXCEPT(Ogre::Exception::ERR_INVALIDPARAMS
                 ,"not a valid walkmesh file, no <walkmesh> in root"

+ 3 - 3
QGearsMain/src/modules/worldmap/WorldMapModule.cpp

@@ -12,7 +12,7 @@
 #include "data/worldmap/TxzFileSerializer.h"
 #include "data/worldmap/MapFileManager.h"
 
-template<> QGears::WorldMapModule *Ogre::Singleton< QGears::WorldMapModule >::msSingleton = NULL;
+template<> QGears::WorldMapModule *Ogre::Singleton< QGears::WorldMapModule >::msSingleton = nullptr;
 
 BEGIN_QGEARS
 
@@ -321,7 +321,7 @@ static void createReferenceTextureFileInstance(QGears::TxzFileSerializer& s)
     class TestFile : public QGears::TxzFile
     {
     public:
-        TestFile() : QGears::TxzFile( NULL, "", 0, "" ) {}
+        TestFile() : QGears::TxzFile( nullptr, "", 0, "" ) {}
     };
 
     const char* file_name = "/home/paul/qgears/data/cd1/world/wm0.txz";
@@ -342,7 +342,7 @@ static void createReferenceFileInstance(std::function<void(Ogre::DataStreamPtr&
     class TestFile : public QGears::WorldMapFile
     {
     public:
-        TestFile() : QGears::WorldMapFile( NULL, "", 0, "" ) {}
+        TestFile() : QGears::WorldMapFile( nullptr, "", 0, "" ) {}
     };
 
     const char* file_name = "./data/wm/WM0.MAP";

+ 16 - 16
QGearsMain/src/viewer/ViewerModule.cpp

@@ -19,11 +19,11 @@
 
 
 ViewerModule::ViewerModule():
-    m_Entity( NULL ),
-    m_Walkmesh( NULL ),
+    m_Entity( nullptr ),
+    m_Walkmesh( nullptr ),
 
-    m_Grid( NULL ),
-    m_Axis( NULL )
+    m_Grid( nullptr ),
+    m_Axis( nullptr )
 {
     m_SceneNode = Ogre::Root::getSingleton().getSceneManager( "Scene" )->getRootSceneNode()->createChildSceneNode( "ViewerModule" );
 
@@ -130,11 +130,11 @@ ViewerModule::ViewerModule():
 
 ViewerModule::~ViewerModule()
 {
-    if( m_Grid != NULL )
+    if( m_Grid != nullptr )
     {
         Ogre::Root::getSingleton().getSceneManager( "Scene" )->destroyEntity( m_Grid );
     }
-    if( m_Axis != NULL )
+    if( m_Axis != nullptr )
     {
         Ogre::Root::getSingleton().getSceneManager( "Scene" )->destroyEntity( m_Axis );
     }
@@ -154,9 +154,9 @@ ViewerModule::Input( const Event& event )
     if (event.type == ET_KEY_PRESS && event.param1 == OIS::KC_DOWN)
     {
         bool change = false;
-        if (m_Entity != NULL)
+        if (m_Entity != nullptr)
         {
-            if (m_Entity->getAllAnimationStates() != NULL)
+            if (m_Entity->getAllAnimationStates() != nullptr)
             {
                 Ogre::AnimationStateIterator animations = m_Entity->getAllAnimationStates()->getAnimationStateIterator();
 
@@ -184,7 +184,7 @@ ViewerModule::Input( const Event& event )
     else if (event.type == ET_KEY_PRESS && event.param1 == OIS::KC_UP)
     {
         bool change = false;
-        if (m_Entity != NULL && m_Entity->getAllAnimationStates() != NULL)
+        if (m_Entity != nullptr && m_Entity->getAllAnimationStates() != nullptr)
         {
             Ogre::AnimationStateIterator animations = m_Entity->getAllAnimationStates()->getAnimationStateIterator();
 
@@ -217,7 +217,7 @@ ViewerModule::Update()
 {
     float delta_time = Timer::getSingleton().GetGameTimeDelta();
 
-    if (m_Entity != NULL && m_Entity->getAllAnimationStates() != NULL)
+    if (m_Entity != nullptr && m_Entity->getAllAnimationStates() != nullptr)
     {
         Ogre::AnimationStateIterator animations = m_Entity->getAllAnimationStates()->getAnimationStateIterator();
 
@@ -240,11 +240,11 @@ ViewerModule::Update()
 void
 ViewerModule::PlayAnimation(const Ogre::String& name)
 {
-    if (m_Entity != NULL)
+    if (m_Entity != nullptr)
     {
         Ogre::String info_text = "Model: " + m_Entity->getName();
 
-        if (m_Entity->getAllAnimationStates() != NULL && m_Entity->getAllAnimationStates()->hasAnimationState(name))
+        if (m_Entity->getAllAnimationStates() != nullptr && m_Entity->getAllAnimationStates()->hasAnimationState(name))
         {
             Ogre::AnimationStateIterator animations = m_Entity->getAllAnimationStates()->getAnimationStateIterator();
             while (animations.hasMoreElements() == true)
@@ -277,15 +277,15 @@ ViewerModule::PlayAnimation(const Ogre::String& name)
 void
 ViewerModule::Clear()
 {
-    if (m_Entity != NULL)
+    if (m_Entity != nullptr)
     {
         Ogre::Root::getSingleton().getSceneManager("Scene")->destroyEntity(m_Entity);
-        m_Entity = NULL;
+        m_Entity = nullptr;
     }
-    if (m_Walkmesh != NULL)
+    if (m_Walkmesh != nullptr)
     {
         delete m_Walkmesh;
-        m_Walkmesh = NULL;
+        m_Walkmesh = nullptr;
     }
 
     m_SceneNode->removeAndDestroyAllChildren();