From 1fe5bececbccfe7f0cd40916fa23cd51427e3b54 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Tue, 19 Jun 2018 22:15:52 +0200 Subject: [PATCH] [DEV] update nullptr in null (specific etk) --- ege/Entity.cpp | 32 +++++----- ege/Environement.cpp | 84 +++++++++++++------------- ege/Environement.hpp | 4 +- ege/Light.cpp | 2 +- ege/Material.cpp | 20 +++--- ege/camera/ControlBase.cpp | 6 +- ege/elements/ElementPhysic.cpp | 76 +++++++++++------------ ege/particule/Component.hpp | 4 +- ege/particule/Engine.cpp | 34 +++++------ ege/particule/Engine.hpp | 4 +- ege/physics/Component.cpp | 74 +++++++++++------------ ege/physics/Engine.cpp | 70 ++++++++++----------- ege/physics/shape/ConvexHull.cpp | 2 +- ege/physics/shape/Shape.cpp | 6 +- ege/physics/shape/Shape.hpp | 28 ++++----- ege/render/Component.cpp | 10 +-- ege/render/Component.hpp | 4 +- ege/render/Engine.cpp | 14 ++--- ege/resource/Mesh.cpp | 28 ++++----- ege/resource/Mesh.hpp | 2 +- ege/resource/MeshCapsule.cpp | 2 +- ege/resource/MeshCone.cpp | 2 +- ege/resource/MeshCube.cpp | 2 +- ege/resource/MeshCylinder.cpp | 2 +- ege/resource/MeshEmf.cpp | 44 +++++++------- ege/resource/MeshGird.cpp | 2 +- ege/resource/MeshObj.cpp | 2 +- ege/resource/MeshSphere.cpp | 2 +- ege/resource/ParticuleMesh.cpp | 4 +- ege/widget/Mesh.cpp | 6 +- ege/widget/Scene.cpp | 10 +-- sample/CameraPosition/appl/Windows.cpp | 10 +-- sample/Collision/appl/Windows.cpp | 26 ++++---- sample/DoubleView/appl/Windows.cpp | 22 +++---- sample/LowPoly/appl/Windows.cpp | 12 ++-- sample/MeshCreator/appl/Windows.cpp | 18 +++--- sample/RayTest/appl/Windows.cpp | 18 +++--- sample/TorqueApply/appl/Windows.cpp | 28 ++++----- 38 files changed, 358 insertions(+), 358 deletions(-) diff --git a/ege/Entity.cpp b/ege/Entity.cpp index 9f934e0..53d4093 100644 --- a/ege/Entity.cpp +++ b/ege/Entity.cpp @@ -35,7 +35,7 @@ ege::Entity::~Entity() { } void ege::Entity::addComponent(const ememory::SharedPtr& _ref) { - if (_ref == nullptr) { + if (_ref == null) { EGE_ERROR("try to add an empty component"); return; } @@ -43,7 +43,7 @@ void ege::Entity::addComponent(const ememory::SharedPtr& _ref) { int32_t findId = -1; // check if not exist for (size_t iii=0; iiigetType() == _ref->getType()) { @@ -56,7 +56,7 @@ void ege::Entity::addComponent(const ememory::SharedPtr& _ref) { // try to add in an empty slot if (findId == -1) { for (size_t iii=0; iii& _ref) { m_component.pushBack(_ref); } for (size_t iii=0; iiiengineComponentRemove(componentRemoved); m_component[iii]->removeFriendComponent(componentRemoved); } @@ -83,7 +83,7 @@ void ege::Entity::addComponent(const ememory::SharedPtr& _ref) { // notify new component of all previously added component: componentRemoved = _ref; for (size_t iii=0; iii& _ref) { } void ege::Entity::rmComponent(const ememory::SharedPtr& _ref) { - if (_ref == nullptr) { + if (_ref == null) { EGE_ERROR("try to remove an empty component"); return; } int32_t findId = -1; // check if not exist for (size_t iii=0; iii& _ref) { return; } for (size_t iii=0; iiiengineComponentRemove(_ref); @@ -128,12 +128,12 @@ void ege::Entity::rmComponent(const etk::String& _type) { ememory::SharedPtr componentRemoved; // check if not exist for (size_t iii=0; iiigetType() == _type) { componentRemoved = m_component[iii]; - m_component[iii] = nullptr; + m_component[iii] = null; findId = iii; break; } @@ -143,7 +143,7 @@ void ege::Entity::rmComponent(const etk::String& _type) { return; } for (size_t iii=0; iiiengineComponentRemove(componentRemoved); @@ -154,14 +154,14 @@ void ege::Entity::rmComponent(const etk::String& _type) { ememory::SharedPtr ege::Entity::getComponent(const etk::String& _type) { // check if not exist for (size_t iii=0; iiigetType() == _type) { return m_component[iii]; } } - return nullptr; + return null; } @@ -219,7 +219,7 @@ const float lifeYPos = 1.7f; #if 0 void ege::Entity::drawLife(ememory::SharedPtr _draw, ememory::SharedPtr _camera) { - if (_draw == nullptr) { + if (_draw == null) { return; } float ratio = getLifeRatio(); diff --git a/ege/Environement.cpp b/ege/Environement.cpp index 1b5ed50..bd113e4 100644 --- a/ege/Environement.cpp +++ b/ege/Environement.cpp @@ -21,13 +21,13 @@ ETK_DECLARE_TYPE(ege::gameStatus); void ege::Environement::addEngine(const ememory::SharedPtr& _ref) { - if (_ref == nullptr) { + if (_ref == null) { EGE_ERROR("try to add an empty Engine"); return; } // check if not exist for (auto &it: m_engine) { - if (it == nullptr) { + if (it == null) { continue; } if (it->getType() == _ref->getType()) { @@ -37,7 +37,7 @@ void ege::Environement::addEngine(const ememory::SharedPtr& _ref) { } // try to add in an empty slot for (auto &it: m_engine) { - if (it != nullptr) { + if (it != null) { continue; } it = _ref; @@ -48,17 +48,17 @@ void ege::Environement::addEngine(const ememory::SharedPtr& _ref) { } void ege::Environement::rmEngine(const ememory::SharedPtr& _ref) { - if (_ref == nullptr) { + if (_ref == null) { EGE_ERROR("try to remove an empty engine"); return; } // check if not exist for (auto &it: m_engine) { - if (it == nullptr) { + if (it == null) { continue; } if (it == _ref) { - it = nullptr; + it = null; return; } } @@ -68,11 +68,11 @@ void ege::Environement::rmEngine(const ememory::SharedPtr& _ref) { void ege::Environement::rmEngine(const etk::String& _type) { // check if not exist for (auto &it: m_engine) { - if (it == nullptr) { + if (it == null) { continue; } if (it->getType() == _type) { - it = nullptr; + it = null; return; } } @@ -83,7 +83,7 @@ void ege::Environement::rmEngine(const etk::String& _type) { ememory::SharedPtr ege::Environement::getEngine(const etk::String& _type) { // check if not exist for (auto &it: m_engine) { - if (it == nullptr) { + if (it == null) { continue; } if (it->getType() == _type) { @@ -91,12 +91,12 @@ ememory::SharedPtr ege::Environement::getEngine(const etk::String& } } EGE_ERROR("try to get an unexisting engine type : '" << _type << "'"); - return nullptr; + return null; } void ege::Environement::engineComponentRemove(const ememory::SharedPtr& _ref) { for (auto &it: m_engine) { - if (it == nullptr) { + if (it == null) { continue; } if (it->getType() == _ref->getType()) { @@ -107,7 +107,7 @@ void ege::Environement::engineComponentRemove(const ememory::SharedPtr& _ref) { for (auto &it: m_engine) { - if (it == nullptr) { + if (it == null) { continue; } if (it->getType() == _ref->getType()) { @@ -119,14 +119,14 @@ void ege::Environement::engineComponentAdd(const ememory::SharedPtr ege::Environement::getEntityNearest(ememory::SharedPtr _sourceRequest, float& _distance) { - if (_sourceRequest == nullptr) { - return nullptr; + if (_sourceRequest == null) { + return null; } vec3 sourcePosition = _sourceRequest->getPosition(); - ememory::SharedPtr result = nullptr; + ememory::SharedPtr result = null; for (size_t iii=0; iiigetGroup() <= 0) { @@ -155,11 +155,11 @@ void ege::Environement::getEntityNearest(const vec3& _sourcePosition, _resultList.clear(); ege::Environement::ResultNearestEntity result; result.dist = 99999999999.0f; - result.entity = nullptr; + result.entity = null; for (size_t iii=0; iiiisFixed() == false) { @@ -220,7 +220,7 @@ static etk::Map& getHachTableCreating() { } void ege::Environement::addCreator(const etk::String& _type, ege::createEntity_tf _creator) { - if (_creator == nullptr) { + if (_creator == null) { EGE_ERROR("Try to add an empty CREATOR ..."); return; } @@ -233,17 +233,17 @@ void ege::Environement::addCreator(const etk::String& _type, ege::createEntity_t ememory::SharedPtr ege::Environement::createEntity(const etk::String& _type, const ejson::Value& _value, bool _autoAddEntity) { if (getHachTableCreating().exist(_type) == false) { EGE_ERROR("Request creating of an type that is not known '" << _type << "'"); - return nullptr; + return null; } ege::createEntity_tf creatorPointer = getHachTableCreating()[_type]; - if (creatorPointer == nullptr) { - EGE_ERROR("nullptr pointer creator == > internal error... '" << _type << "'"); - return nullptr; + if (creatorPointer == null) { + EGE_ERROR("null pointer creator == > internal error... '" << _type << "'"); + return null; } ememory::SharedPtr tmpEntity = creatorPointer(ememory::dynamicPointerCast(sharedFromThis()), _value); - if (tmpEntity == nullptr) { + if (tmpEntity == null) { EGE_ERROR("allocation error '" << _type << "'"); - return nullptr; + return null; } if (_autoAddEntity == true) { addEntity(tmpEntity); @@ -258,11 +258,11 @@ ememory::SharedPtr ege::Environement::createEntity(const etk::Strin void ege::Environement::addEntity(ememory::SharedPtr _newEntity) { // prevent memory allocation and un allocation ... - if (_newEntity == nullptr) { + if (_newEntity == null) { return; } for (size_t iii=0; iiidynamicEnable(); return; @@ -273,12 +273,12 @@ void ege::Environement::addEntity(ememory::SharedPtr _newEntity) { } void ege::Environement::rmEntity(ememory::SharedPtr _removeEntity) { - if (_removeEntity == nullptr) { + if (_removeEntity == null) { return; } // inform the entity that an entity has been removed == > this permit to keep pointer on entitys ... for (size_t iii=0; iiientityIsRemoved(_removeEntity); } } @@ -296,7 +296,7 @@ void ege::Environement::rmEntity(ememory::SharedPtr _removeEntity) void ege::Environement::generateInteraction(ege::EntityInteraction& _event) { // inform the entity that an entity has been removed == > this permit to keep pointer on entitys ... for (size_t iii=0; iii camera = getCamera(_camera); - if (camera == nullptr) { + if (camera == null) { EGE_ERROR("Render: Can not get camera named: '" << _camera << "'"); return; } for (auto &it: m_engine) { - if(it == nullptr) { + if(it == null) { continue; } EGE_VERBOSE(" render: " << it->getType()); it->render(_delta, camera); } for (auto &it: m_engine) { - if(it == nullptr) { + if(it == null) { continue; } EGE_VERBOSE(" render: " << it->getType()); @@ -382,14 +382,14 @@ void ege::Environement::onCallbackPeriodicCall(const ewol::event::Time& _event) // update camera positions: for (auto &it : m_listCamera) { - if (it.second != nullptr) { + if (it.second != null) { EGE_VERBOSE(" update camera : '" << it.first << "'"); it.second->periodicCall(curentDelta); } } EGE_VERBOSE(" step simulation : " << curentDelta); for (auto &it: m_engine) { - if(it == nullptr) { + if(it == null) { continue; } EGE_VERBOSE(" update: " << it->getType()); @@ -410,7 +410,7 @@ void ege::Environement::onCallbackPeriodicCall(const ewol::event::Time& _event) int32_t victoryPoint=0; auto it(m_listEntity.begin()); while (it != m_listEntity.end()) { - if(*it != nullptr) { + if(*it != null) { if ((*it)->needToRemove() == true) { if ((*it)->getGroup() > 1) { numberEnnemyKilled++; @@ -443,7 +443,7 @@ ememory::SharedPtr ege::Environement::getCamera(const etk::String& if (cameraIt != m_listCamera.end()) { return cameraIt->second; } - return nullptr; + return null; } diff --git a/ege/Environement.hpp b/ege/Environement.hpp index 562250f..3aa89ba 100644 --- a/ege/Environement.hpp +++ b/ege/Environement.hpp @@ -138,7 +138,7 @@ namespace ege { * @param[in] _type Type of the entity that might be created. * @param[in] _description String that describe the content of the entity properties. * @param[in] _autoAddEntity this permit to add the entity if it is created == > no more action ... - * @return nullptr if an error occured OR the pointer on the entity and it is already added on the system. + * @return null if an error occured OR the pointer on the entity and it is already added on the system. * @note Pointer is return in case of setting properties on it... */ ememory::SharedPtr createEntity(const etk::String& _type, const ejson::Value& _value, bool _autoAddEntity=true); @@ -176,7 +176,7 @@ namespace ege { * @brief get the nearest Entity * @param[in] _sourceRequest Pointer on the entity that request this. * @param[in] _distance Maximum distance search == > return the entity distance - * @return Pointer on the neares entity OR nullptr + * @return Pointer on the neares entity OR null */ /* ememory::SharedPtr getEntityNearest(ememory::SharedPtr _sourceRequest, float& _distance); diff --git a/ege/Light.cpp b/ege/Light.cpp index dd0d744..819ce95 100644 --- a/ege/Light.cpp +++ b/ege/Light.cpp @@ -26,7 +26,7 @@ ege::Light::~Light() { } void ege::Light::link(ememory::SharedPtr _prog, const etk::String& _baseName) { - if (_prog == nullptr) { + if (_prog == null) { return; } m_GL_direction = _prog->getUniform(_baseName+".direction"); diff --git a/ege/Material.cpp b/ege/Material.cpp index 7d0545a..0b15d0b 100644 --- a/ege/Material.cpp +++ b/ege/Material.cpp @@ -18,7 +18,7 @@ ege::MaterialGlId::MaterialGlId() : } void ege::MaterialGlId::link(ememory::SharedPtr _prog, const etk::String& _baseName) { - if (_prog == nullptr) { + if (_prog == null) { return; } m_GL_ambientFactor = _prog->getUniform(_baseName+".ambientFactor"); @@ -34,7 +34,7 @@ ege::Material::Material() : m_specularFactor(0,0,0,1), m_shininess(1), m_renderMode(gale::openGL::renderMode::triangle), - m_texture0(nullptr) { + m_texture0(null) { // nothing to do else ... } @@ -48,7 +48,7 @@ void ege::Material::draw(ememory::SharedPtr _prog, cons _prog->uniform4(_glID.m_GL_diffuseFactor, m_diffuseFactor); _prog->uniform4(_glID.m_GL_specularFactor, m_specularFactor); _prog->uniform1f(_glID.m_GL_shininess, m_shininess); - if (m_texture0 != nullptr) { + if (m_texture0 != null) { EGE_VERBOSE(" set texture: " << _glID.m_GL_texture0 << " " << m_texture0->getId()); _prog->setTexture0(_glID.m_GL_texture0, m_texture0->getRendererId()); #if DEBUG @@ -89,11 +89,11 @@ void ege::Material::setTexture0(const etk::String& _filename) { // prevent overloard error : ememory::SharedPtr tmpCopy = m_texture0; m_texture0 = ewol::resource::TextureFile::create(_filename, tmpSize); - if (m_texture0 == nullptr) { + if (m_texture0 == null) { EGE_ERROR("Can not load specific texture : " << _filename); // retreave previous texture: m_texture0 = tmpCopy; - if (m_texture0 != nullptr) { + if (m_texture0 != null) { return; } } @@ -105,7 +105,7 @@ void ege::Material::setTexture0(const etk::String& _filename) { void ege::Material::setTexture0Magic(const ivec2& _size) { // create a simple custum texture : m_texture0 = ewol::resource::Texture::create(); - if (m_texture0 != nullptr) { + if (m_texture0 != null) { setImageSize(_size); egami::Image& img = m_texture0->get(); for (int32_t xxx=0; xxx<_size.x(); ++xxx) { @@ -166,21 +166,21 @@ void ege::Material::setRenderMode(enum gale::openGL::renderMode _val) { } void ege::Material::setImageSize(const ivec2& _newSize) { - if (m_texture0 == nullptr){ + if (m_texture0 == null){ return; } m_texture0->setImageSize(_newSize); } egami::Image* ege::Material::get() { - if (m_texture0 == nullptr){ - return nullptr; + if (m_texture0 == null){ + return null; } return &m_texture0->get(); } void ege::Material::flush() { - if (m_texture0 == nullptr){ + if (m_texture0 == null){ return; } m_texture0->flush(); diff --git a/ege/camera/ControlBase.cpp b/ege/camera/ControlBase.cpp index 765fe35..773fa50 100644 --- a/ege/camera/ControlBase.cpp +++ b/ege/camera/ControlBase.cpp @@ -22,7 +22,7 @@ ege::camera::ControlBase::ControlBase() : void ege::camera::ControlBase::setCamera(const ememory::SharedPtr& _camera) { m_camera.reset(); m_PCH.disconnect(); - if (_camera == nullptr) { + if (_camera == null) { return; } m_camera = _camera; @@ -111,7 +111,7 @@ bool ege::camera::ControlBase::onEventEntry(const ewol::event::Entry& _event) { } bool ege::camera::ControlBase::onEventInput(const ewol::event::Input& _event, const vec2& _relativePosition) { - if (m_camera == nullptr) { + if (m_camera == null) { return false; } if (_event.getId() == 4) { @@ -163,7 +163,7 @@ bool ege::camera::ControlBase::onEventInput(const ewol::event::Input& _event, co } void ege::camera::ControlBase::periodicCall(const ewol::event::Time& _event) { - if (m_camera == nullptr) { + if (m_camera == null) { return; } if ( m_destinationCameraOffset.x() < 0.7f diff --git a/ege/elements/ElementPhysic.cpp b/ege/elements/ElementPhysic.cpp index 64e78a7..6560b2e 100644 --- a/ege/elements/ElementPhysic.cpp +++ b/ege/elements/ElementPhysic.cpp @@ -26,10 +26,10 @@ const etk::String& ege::ElementPhysic::getType() const { ege::ElementPhysic::ElementPhysic(const ememory::SharedPtr& _env, bool _autoRigidBody) ://, float _mass) : ege::Element(_env), - m_body(nullptr), - //m_shape(nullptr), + m_body(null), + //m_shape(null), m_elementInPhysicsSystem(false), - m_IA(nullptr), + m_IA(null), m_detectCollisionEnable(false) { if (_autoRigidBody == true) { createRigidBody(); @@ -46,7 +46,7 @@ ege::ElementPhysic::~ElementPhysic() { //removeShape(); // Destroy the rigid body //m_dynamicsWorld->destroyRigidBody(m_body); - m_body = nullptr; + m_body = null; } @@ -57,7 +57,7 @@ void ege::ElementPhysic::createRigidBody(float _mass, bool _static) { rp3d::Transform transform(initPosition, initOrientation); // Create a rigid body in the world - m_body = nullptr;//m_dynamicsWorld->createRigidBody(transform); + m_body = null;//m_dynamicsWorld->createRigidBody(transform); /* if (_static = true) { m_body->setType(STATIC); @@ -72,16 +72,16 @@ void ege::ElementPhysic::createRigidBody(float _mass, bool _static) { bool ege::ElementPhysic::setMesh(ememory::SharedPtr _mesh) { EGE_WARNING("Set Mesh"); - if (m_mesh != nullptr) { + if (m_mesh != null) { //removeShape(); } ege::Element::setMesh(_mesh); // auto load the shape: - if (m_mesh == nullptr) { + if (m_mesh == null) { return true; } /* - if (m_mesh->getShape() != nullptr) { + if (m_mesh->getShape() != null) { EGE_WARNING("create shape whith mesh internal shape ..."); m_shape = static_cast(m_mesh->getShape()); return true; @@ -102,7 +102,7 @@ bool ege::ElementPhysic::setShape(btCollisionShape* _shape) { EGE_DEBUG("Set Shape"); removeShape(); m_shape = _shape; - if (_shape == nullptr) { + if (_shape == null) { EGE_WARNING("Remove shape ..."); } else { EGE_INFO("set shape ..."); @@ -112,20 +112,20 @@ bool ege::ElementPhysic::setShape(btCollisionShape* _shape) { void ege::ElementPhysic::removeShape() { // no shape - if (m_shape == nullptr) { + if (m_shape == null) { return; } // need to chek if the shape is the same as the mesh shape ... - if (m_mesh == nullptr) { + if (m_mesh == null) { // no mesh == > standalone shape ETK_DELETE(btCollisionShape, m_shape); - m_shape=nullptr; + m_shape=null; EGE_WARNING("Remove shape .2."); return; } if (m_shape != m_mesh->getShape()) { ETK_DELETE(btCollisionShape, m_shape); - m_shape=nullptr; + m_shape=null; EGE_WARNING("Remove shape .3."); return; } @@ -133,14 +133,14 @@ void ege::ElementPhysic::removeShape() { } void ege::ElementPhysic::FunctionFreeShape(void* _pointer) { - if (_pointer == nullptr) { + if (_pointer == null) { return; } ETK_DELETE(btCollisionShape, _pointer); } */ void ege::ElementPhysic::setPosition(const vec3& _pos) { - if (m_body != nullptr) { + if (m_body != null) { /* btTransform transformation = m_body->getCenterOfMassTransform(); transformation.setOrigin(_pos); @@ -151,7 +151,7 @@ void ege::ElementPhysic::setPosition(const vec3& _pos) { const vec3& ege::ElementPhysic::getPosition() { /* - if (m_body != nullptr) { + if (m_body != null) { return m_body->getCenterOfMassPosition(); } */ @@ -161,7 +161,7 @@ const vec3& ege::ElementPhysic::getPosition() { const vec3& ege::ElementPhysic::getSpeed() { static vec3 emptySpeed(0,0,0); /* - if (m_body != nullptr) { + if (m_body != null) { return m_body->getLinearVelocity(); } */ @@ -170,7 +170,7 @@ const vec3& ege::ElementPhysic::getSpeed() { const float ege::ElementPhysic::getInvMass() { /* - if (m_body != nullptr) { + if (m_body != null) { return m_body->getInvMass(); } */ @@ -182,8 +182,8 @@ void ege::ElementPhysic::drawShape(/*const btCollisionShape* _shape,*/ mat4 _transformationMatrix, etk::Vector _tmpVertices) { #if 0 - if( _draw == nullptr - || _shape == nullptr) { + if( _draw == null + || _shape == null) { return; } etk::Color tmpColor(1.0, 0.0, 0.0, 0.3); @@ -227,7 +227,7 @@ void ege::ElementPhysic::drawShape(/*const btCollisionShape* _shape,*/ if (_shape->isConvex()) { EGE_DEBUG(" shape->isConvex()"); const btConvexPolyhedron* poly = _shape->isPolyhedral() ? ((btPolyhedralConvexShape*) _shape)->getConvexPolyhedron() : 0; - if (nullptr!=poly) { + if (null!=poly) { EGE_DEBUG(" have poly"); /* glBegin(GL_TRIANGLES); @@ -333,8 +333,8 @@ void ege::ElementPhysic::draw(int32_t _pass) { /* //EGE_INFO("draw : " << _pass ); if (_pass == 0) { - if( m_body != nullptr - && m_mesh != nullptr) { + if( m_body != null + && m_mesh != null) { //EGE_INFO("element pos = " << getPosition()); float mmm[16]; // Get the interpolated transform of the rigid body @@ -356,11 +356,11 @@ void ege::ElementPhysic::dynamicEnable() { if (m_elementInPhysicsSystem == true) { return; } - if(m_body != nullptr) { + if(m_body != null) { EGE_VERBOSE("dynamicEnable : RigidBody"); //m_env->getPhysicEngine().getDynamicWorld()->addRigidBody(m_body); } - if(m_IA != nullptr) { + if(m_IA != null) { EGE_VERBOSE("dynamicEnable : IA"); //m_env->getPhysicEngine().getDynamicWorld()->addAction(m_IA); } @@ -371,11 +371,11 @@ void ege::ElementPhysic::dynamicDisable() { if (m_elementInPhysicsSystem == false) { return; } - if(m_IA != nullptr) { + if(m_IA != null) { EGE_VERBOSE("dynamicDisable : IA"); //m_env->getPhysicEngine().getDynamicWorld()->removeAction(m_IA); } - if(m_body != nullptr) { + if(m_body != null) { EGE_VERBOSE("dynamicDisable : RigidBody"); // Unlink element from the engine //m_env->getPhysicEngine().getDynamicWorld()->removeRigidBody(m_body); @@ -385,12 +385,12 @@ void ege::ElementPhysic::dynamicDisable() { } void ege::ElementPhysic::iaEnable() { - if (m_IA != nullptr) { + if (m_IA != null) { // IA already started ... return; } m_IA = ETK_NEW(localIA, *this); - if (m_IA == nullptr) { + if (m_IA == null) { EGE_ERROR("Can not start the IA == > allocation error"); return; } @@ -400,7 +400,7 @@ void ege::ElementPhysic::iaEnable() { } void ege::ElementPhysic::iaDisable() { - if (m_IA == nullptr) { + if (m_IA == null) { // IA already stopped ... return; } @@ -409,16 +409,16 @@ void ege::ElementPhysic::iaDisable() { } // remove IA: ETK_DELETE(localIA, m_IA); - m_IA = nullptr; + m_IA = null; } void ege::ElementPhysic::setMass(float _value) { - if (m_body == nullptr) { + if (m_body == null) { return; } /* vec3 localInertia(0,0,0); - if (_value != 0.0f && getShape()!=nullptr) { + if (_value != 0.0f && getShape()!=null) { //getShape()->calculateLocalInertia(_value, localInertia); EWOL_ERROR("Update inertia calculated : " << localInertia); } @@ -427,7 +427,7 @@ void ege::ElementPhysic::setMass(float _value) { } void ege::ElementPhysic::setLinearVelocity(const vec3& _value) { - if (m_body == nullptr) { + if (m_body == null) { EGE_WARNING("no body"); return; } @@ -438,7 +438,7 @@ void ege::ElementPhysic::setLinearVelocity(const vec3& _value) { } void ege::ElementPhysic::setTorqueImpulse(const vec3& _value) { - if (m_body == nullptr) { + if (m_body == null) { EGE_WARNING("no body"); return; } @@ -449,7 +449,7 @@ void ege::ElementPhysic::setTorqueImpulse(const vec3& _value) { } void ege::ElementPhysic::setAngularVelocity(const vec3& _value) { - if (m_body == nullptr) { + if (m_body == null) { EGE_WARNING("no body"); return; } @@ -457,7 +457,7 @@ void ege::ElementPhysic::setAngularVelocity(const vec3& _value) { } /* btQuaternion ege::ElementPhysic::getOrientation() const { - if (m_body == nullptr) { + if (m_body == null) { EGE_WARNING("no body"); return btQuaternion(0,0,0,0); } @@ -467,7 +467,7 @@ btQuaternion ege::ElementPhysic::getOrientation() const { */ void ege::ElementPhysic::setCollisionDetectionStatus(bool _status) { - if (m_body == nullptr) { + if (m_body == null) { EGE_WARNING("no body"); return; } diff --git a/ege/particule/Component.hpp b/ege/particule/Component.hpp index 1bcad56..5e49244 100644 --- a/ege/particule/Component.hpp +++ b/ege/particule/Component.hpp @@ -24,9 +24,9 @@ namespace ege { /** * @brief Constructor. * @param[in] _particuleEngine reference on the particule engine ... - * @param[in] _particuleType Type of the particule (set nullptr if you did not want to use the respowner ...) + * @param[in] _particuleType Type of the particule (set null if you did not want to use the respowner ...) */ - Component(ege::particule::Engine* _particuleEngine, const char* _particuleType = nullptr); + Component(ege::particule::Engine* _particuleEngine, const char* _particuleType = null); /** * @brief Destructor. */ diff --git a/ege/particule/Engine.cpp b/ege/particule/Engine.cpp index fbded4c..3722631 100644 --- a/ege/particule/Engine.cpp +++ b/ege/particule/Engine.cpp @@ -34,12 +34,12 @@ void ege::particule::Engine::componentAdd(const ememory::SharedPtr& _particule) { - if (_particule == nullptr) { - EGE_ERROR("Try to add particule nullptr"); + if (_particule == null) { + EGE_ERROR("Try to add particule null"); return; } for (size_t iii=0; iii& _particule) { - if (_particule == nullptr) { + if (_particule == null) { return; } for (size_t iii=0; iii ege::particule::Engine::respown(const char* _particuleType) { - if (_particuleType == nullptr) { - return nullptr; + if (_particuleType == null) { + return null; } for (size_t iii=0; iiigetParticuleType() == _particuleType) { @@ -80,7 +80,7 @@ ememory::SharedPtr ege::particule::Engine::respown(co return tmpParticule; } } - return nullptr; + return null; } void ege::particule::Engine::update(const echrono::Duration& _delta) { @@ -90,31 +90,31 @@ void ege::particule::Engine::update(const echrono::Duration& _delta) { } EGE_DEBUG("Update the Particule engine ... " << deltaTime); for (size_t iii=0; iiiupdate(deltaTime); } // check removing elements for (size_t iii=0; iiineedRemove()) { m_particuleList[iii]->onEnd(); - if (m_particuleList[iii]->getParticuleType() == nullptr) { + if (m_particuleList[iii]->getParticuleType() == null) { // Real remove particule ... m_particuleList[iii].reset(); } else { addRemoved(m_particuleList[iii]); } - m_particuleList[iii] = nullptr; + m_particuleList[iii] = null; } } /* int32_t nbParticule = 0; for (int32_t iii=0; iii& _camera) { for (size_t iii=0; iiidraw(*_camera); @@ -135,7 +135,7 @@ void ege::particule::Engine::render(const echrono::Duration& _delta, const ememo void ege::particule::Engine::clear() { // clear element not removed for (size_t iii=0; iii respown(const char* _particuleType); diff --git a/ege/physics/Component.cpp b/ege/physics/Component.cpp index b6effd4..c34eb8b 100644 --- a/ege/physics/Component.cpp +++ b/ege/physics/Component.cpp @@ -65,7 +65,7 @@ ege::physics::Component::Component(ememory::SharedPtr _env, c } void ege::physics::Component::setType(enum ege::physics::Component::type _type) { - if (m_rigidBody == nullptr) { + if (m_rigidBody == null) { return; } switch(_type) { @@ -82,14 +82,14 @@ void ege::physics::Component::setType(enum ege::physics::Component::type _type) } ege::physics::Component::~Component() { - if (m_rigidBody == nullptr) { + if (m_rigidBody == null) { return; } // disable callback - m_rigidBody->setUserData(nullptr); - m_engine->getDynamicWorld()->testCollision(m_rigidBody, nullptr); + m_rigidBody->setUserData(null); + m_engine->getDynamicWorld()->testCollision(m_rigidBody, null); m_engine->getDynamicWorld()->destroyRigidBody(m_rigidBody); - m_rigidBody = nullptr; + m_rigidBody = null; } void ege::physics::Component::generate() { @@ -99,14 +99,14 @@ void ege::physics::Component::generate() { } for (auto &it: m_shape) { - if (it == nullptr) { + if (it == null) { continue; } switch (it->getType()) { case ege::physics::Shape::type::box: { EGE_DEBUG(" Box"); const ege::physics::shape::Box* tmpElement = it->toBox(); - if (tmpElement == nullptr) { + if (tmpElement == null) { EGE_ERROR(" Box ==> can not cast in BOX"); continue; } @@ -128,7 +128,7 @@ void ege::physics::Component::generate() { case ege::physics::Shape::type::cylinder: { EGE_DEBUG(" Cylinder"); const ege::physics::shape::Cylinder* tmpElement = it->toCylinder(); - if (tmpElement == nullptr) { + if (tmpElement == null) { EGE_ERROR(" Cylinder ==> can not cast in Cylinder"); continue; } @@ -145,7 +145,7 @@ void ege::physics::Component::generate() { case ege::physics::Shape::type::capsule: { EGE_DEBUG(" Capsule"); const ege::physics::shape::Capsule* tmpElement = it->toCapsule(); - if (tmpElement == nullptr) { + if (tmpElement == null) { EGE_ERROR(" Capsule ==> can not cast in Capsule"); continue; } @@ -162,7 +162,7 @@ void ege::physics::Component::generate() { case ege::physics::Shape::type::cone: { EGE_DEBUG(" Cone"); const ege::physics::shape::Cone* tmpElement = it->toCone(); - if (tmpElement == nullptr) { + if (tmpElement == null) { EGE_ERROR(" Cone ==> can not cast in Cone"); continue; } @@ -179,7 +179,7 @@ void ege::physics::Component::generate() { case ege::physics::Shape::type::sphere: { EGE_DEBUG(" Sphere"); const ege::physics::shape::Sphere* tmpElement = it->toSphere(); - if (tmpElement == nullptr) { + if (tmpElement == null) { EGE_ERROR(" Sphere ==> can not cast in Sphere"); continue; } @@ -196,7 +196,7 @@ void ege::physics::Component::generate() { case ege::physics::Shape::type::concave: { EGE_DEBUG(" Concave"); const ege::physics::shape::Concave* tmpElement = it->toConcave(); - if (tmpElement == nullptr) { + if (tmpElement == null) { EGE_ERROR(" etkConcave ==> can not cast in Concave"); continue; } @@ -243,7 +243,7 @@ void ege::physics::Component::emitAll() { } void ege::physics::Component::update(float _delta) { - if (m_rigidBody == nullptr) { + if (m_rigidBody == null) { return; } if (m_staticForceApplyCenterOfMass != vec3(0,0,0)) { @@ -260,35 +260,35 @@ void ege::physics::Component::update(float _delta) { void ege::physics::Component::setTransform(const etk::Transform3D& _transform) { - if (m_rigidBody == nullptr) { + if (m_rigidBody == null) { return; } m_rigidBody->setTransform(_transform); } etk::Transform3D ege::physics::Component::getTransform() const { - if (m_rigidBody == nullptr) { + if (m_rigidBody == null) { return etk::Transform3D::identity(); } return m_rigidBody->getTransform(); } vec3 ege::physics::Component::getLinearVelocity() const { - if (m_rigidBody == nullptr) { + if (m_rigidBody == null) { return vec3(0,0,0); } return m_rigidBody->getLinearVelocity(); } void ege::physics::Component::setLinearVelocity(const vec3& _linearVelocity) { - if (m_rigidBody == nullptr) { + if (m_rigidBody == null) { return; } m_rigidBody->setLinearVelocity(_linearVelocity); } vec3 ege::physics::Component::getRelativeLinearVelocity() const { - if (m_rigidBody == nullptr) { + if (m_rigidBody == null) { return vec3(0,0,0); } vec3 value = m_rigidBody->getLinearVelocity(); @@ -296,7 +296,7 @@ vec3 ege::physics::Component::getRelativeLinearVelocity() const { } void ege::physics::Component::setRelativeLinearVelocity(const vec3& _linearVelocity) { - if (m_rigidBody == nullptr) { + if (m_rigidBody == null) { return; } vec3 value = m_rigidBody->getTransform().getOrientation()*_linearVelocity; @@ -304,27 +304,27 @@ void ege::physics::Component::setRelativeLinearVelocity(const vec3& _linearVeloc } vec3 ege::physics::Component::getAngularVelocity() const { - if (m_rigidBody == nullptr) { + if (m_rigidBody == null) { return vec3(0,0,0); } return m_rigidBody->getAngularVelocity(); } void ege::physics::Component::setAngularVelocity(const vec3& _angularVelocity) { - if (m_rigidBody == nullptr) { + if (m_rigidBody == null) { return; } m_rigidBody->setAngularVelocity(_angularVelocity); } vec3 ege::physics::Component::getRelativeAngularVelocity() const { - if (m_rigidBody == nullptr) { + if (m_rigidBody == null) { return vec3(0,0,0); } vec3 value = m_rigidBody->getAngularVelocity(); return m_rigidBody->getTransform().getOrientation().getInverse()*value; } void ege::physics::Component::setRelativeAngularVelocity(const vec3& _angularVelocity) { - if (m_rigidBody == nullptr) { + if (m_rigidBody == null) { return; } vec3 value = m_rigidBody->getTransform().getOrientation()*_angularVelocity; @@ -333,14 +333,14 @@ void ege::physics::Component::setRelativeAngularVelocity(const vec3& _angularVel void ege::physics::Component::applyForce(const vec3& _force,const vec3& _point) { - if (m_rigidBody == nullptr) { + if (m_rigidBody == null) { return; } m_rigidBody->applyForce(_force, _point); } void ege::physics::Component::applyForceToCenterOfMass(const vec3& _force, bool _static) { - if (m_rigidBody == nullptr) { + if (m_rigidBody == null) { return; } if(_static == true) { @@ -351,7 +351,7 @@ void ege::physics::Component::applyForceToCenterOfMass(const vec3& _force, bool } void ege::physics::Component::applyRelativeForceToCenterOfMass(const vec3& _force, bool _static) { - if (m_rigidBody == nullptr) { + if (m_rigidBody == null) { return; } vec3 force = m_rigidBody->getTransform().getOrientation()*_force; @@ -363,7 +363,7 @@ void ege::physics::Component::applyRelativeForceToCenterOfMass(const vec3& _forc } void ege::physics::Component::applyTorque(const vec3& _torque, bool _static) { - if (m_rigidBody == nullptr) { + if (m_rigidBody == null) { return; } if(_static == true) { @@ -374,7 +374,7 @@ void ege::physics::Component::applyTorque(const vec3& _torque, bool _static) { } void ege::physics::Component::applyRelativeTorque(const vec3& _torque, bool _static) { - if (m_rigidBody == nullptr) { + if (m_rigidBody == null) { return; } vec3 torque = m_rigidBody->getTransform().getOrientation()*_torque; @@ -407,14 +407,14 @@ void ege::physics::Component::drawShape(ememory::SharedPtr tmpColor(1.0, 0.0, 0.0, 0.3); for (auto &it: m_shape) { - if (it == nullptr) { + if (it == null) { continue; } switch (it->getType()) { case ege::physics::Shape::type::box: { EGE_DEBUG(" Box"); const ege::physics::shape::Box* tmpElement = it->toBox(); - if (tmpElement == nullptr) { + if (tmpElement == null) { EGE_ERROR(" Box ==> can not cast in BOX"); continue; } @@ -429,7 +429,7 @@ void ege::physics::Component::drawShape(ememory::SharedPtrtoCylinder(); - if (tmpElement == nullptr) { + if (tmpElement == null) { EGE_ERROR(" Cylinder ==> can not cast in Cylinder"); continue; } @@ -444,7 +444,7 @@ void ege::physics::Component::drawShape(ememory::SharedPtrtoCapsule(); - if (tmpElement == nullptr) { + if (tmpElement == null) { EGE_ERROR(" Capsule ==> can not cast in Capsule"); continue; } @@ -459,7 +459,7 @@ void ege::physics::Component::drawShape(ememory::SharedPtrtoCone(); - if (tmpElement == nullptr) { + if (tmpElement == null) { EGE_ERROR(" Cone ==> can not cast in Cone"); continue; } @@ -474,7 +474,7 @@ void ege::physics::Component::drawShape(ememory::SharedPtrtoSphere(); - if (tmpElement == nullptr) { + if (tmpElement == null) { EGE_ERROR(" Sphere ==> can not cast in Sphere"); continue; } @@ -489,7 +489,7 @@ void ege::physics::Component::drawShape(ememory::SharedPtrtoConcave(); - if (tmpElement == nullptr) { + if (tmpElement == null) { EGE_ERROR(" concave ==> can not cast in convexHull"); continue; } @@ -505,7 +505,7 @@ void ege::physics::Component::drawShape(ememory::SharedPtrtoConvexHull(); - if (tmpElement == nullptr) { + if (tmpElement == null) { EGE_ERROR(" convexHull ==> can not cast in convexHull"); continue; } @@ -520,7 +520,7 @@ void ege::physics::Component::drawShape(ememory::SharedPtr _draw, ememory::SharedPtr _camera) { - if (m_rigidBody == nullptr) { + if (m_rigidBody == null) { return; } mat4 transformationMatrix; diff --git a/ege/physics/Engine.cpp b/ege/physics/Engine.cpp index a33a016..513f2e8 100644 --- a/ege/physics/Engine.cpp +++ b/ege/physics/Engine.cpp @@ -18,43 +18,43 @@ const etk::String& ege::physics::Engine::getType() const { } void ege::physics::Engine::beginContact(const ephysics::ContactPointInfo& _contact) { - ege::physics::Component* component1 = nullptr; - ege::physics::Component* component2 = nullptr; + ege::physics::Component* component1 = null; + ege::physics::Component* component2 = null; // Called when a new contact point is found between two bodies that were separated before. EGE_WARNING("collision detection [BEGIN] " << _contact.localPoint1 << " depth=" << _contact.penetrationDepth); - if ( _contact.shape1 != nullptr - && _contact.shape1->getUserData() != nullptr) { + if ( _contact.shape1 != null + && _contact.shape1->getUserData() != null) { component1 = static_cast(_contact.shape1->getUserData()); } - if ( _contact.shape2 != nullptr - && _contact.shape2->getUserData() != nullptr) { + if ( _contact.shape2 != null + && _contact.shape2->getUserData() != null) { component2 = static_cast(_contact.shape2->getUserData()); } - if (component1 != nullptr) { + if (component1 != null) { component1->beginContact(component2, _contact.normal, _contact.localPoint1, _contact.localPoint2, _contact.penetrationDepth); } - if (component2 != nullptr) { + if (component2 != null) { component2->beginContact(component1, -_contact.normal, _contact.localPoint2, _contact.localPoint1, _contact.penetrationDepth); } } void ege::physics::Engine::newContact(const ephysics::ContactPointInfo& _contact) { - ege::physics::Component* component1 = nullptr; - ege::physics::Component* component2 = nullptr; + ege::physics::Component* component1 = null; + ege::physics::Component* component2 = null; //Called when a new contact point is found between two bodies. EGE_WARNING("collision detection [ NEW ] " << _contact.localPoint1 << " depth=" << _contact.penetrationDepth); - if ( _contact.shape1 != nullptr - && _contact.shape1->getUserData() != nullptr) { + if ( _contact.shape1 != null + && _contact.shape1->getUserData() != null) { component1 = static_cast(_contact.shape1->getUserData()); } - if ( _contact.shape2 != nullptr - && _contact.shape2->getUserData() != nullptr) { + if ( _contact.shape2 != null + && _contact.shape2->getUserData() != null) { component2 = static_cast(_contact.shape2->getUserData()); } - if (component1 != nullptr) { + if (component1 != null) { component1->newContact(component2, _contact.normal, _contact.localPoint1, _contact.localPoint2, _contact.penetrationDepth); } - if (component2 != nullptr) { + if (component2 != null) { component2->newContact(component1, -_contact.normal, _contact.localPoint2, _contact.localPoint1, _contact.penetrationDepth); } } @@ -76,7 +76,7 @@ void ege::physics::Engine::componentAdd(const ememory::SharedPtr for (auto it=m_component.begin(); it != m_component.end(); ++it) { - if (*it == nullptr) { + if (*it == null) { *it = ref; return; } @@ -88,14 +88,14 @@ ege::physics::Engine::Engine(ege::Environement* _env) : ege::Engine(_env), propertyDebugAABB(this, "debug-AABB", false, "display the global AABB box of every shape"), propertyDebugShape(this, "debug-shape", false, "display the physic shape"), - m_dynamicsWorld(nullptr), + m_dynamicsWorld(null), m_accumulator(0.0f) { m_debugDrawProperty = ewol::resource::Colored3DObject::create(); // Start engine with no gravity vec3 gravity(0.0f, 0.0f, 0.0f); // Create the dynamics world m_dynamicsWorld = ETK_NEW(ephysics::DynamicsWorld, gravity); - if (m_dynamicsWorld != nullptr) { + if (m_dynamicsWorld != null) { // Set the number of iterations of the constraint solver m_dynamicsWorld->setNbIterationsVelocitySolver(15); m_dynamicsWorld->setEventListener(this); @@ -103,15 +103,15 @@ ege::physics::Engine::Engine(ege::Environement* _env) : } ege::physics::Engine::~Engine() { - if (m_dynamicsWorld != nullptr) { - m_dynamicsWorld->setEventListener(nullptr); + if (m_dynamicsWorld != null) { + m_dynamicsWorld->setEventListener(null); ETK_DELETE(ephysics::DynamicsWorld, m_dynamicsWorld); - m_dynamicsWorld = nullptr; + m_dynamicsWorld = null; } } void ege::physics::Engine::setGravity(const vec3& _axePower) { - if (m_dynamicsWorld != nullptr) { + if (m_dynamicsWorld != null) { vec3 gravity(_axePower); m_dynamicsWorld->setGravity(gravity); } @@ -126,11 +126,11 @@ void ege::physics::Engine::update(const echrono::Duration& _delta) { m_accumulator += deltaTime; // While there is enough accumulated time to take one or several physics steps while (m_accumulator >= timeStep) { - if (m_dynamicsWorld != nullptr) { + if (m_dynamicsWorld != null) { // call every object to usdate their constant forces applyed for (auto &it: m_component) { - // check nullptr pointer - if (it == nullptr) { + // check null pointer + if (it == null) { // no pointer null are set in the output list ... continue; } @@ -144,8 +144,8 @@ void ege::physics::Engine::update(const echrono::Duration& _delta) { m_accumulator -= timeStep; } for (auto &it: m_component) { - // check nullptr pointer - if (it == nullptr) { + // check null pointer + if (it == null) { // no pointer null are set in the output list ... continue; } @@ -156,7 +156,7 @@ void ege::physics::Engine::update(const echrono::Duration& _delta) { void ege::physics::Engine::renderDebug(const echrono::Duration& _delta, const ememory::SharedPtr& _camera) { if (propertyDebugShape.get() == true) { for (auto &it : m_component) { - if (it == nullptr) { + if (it == null) { continue; } it->drawShape(m_debugDrawProperty, _camera); @@ -164,7 +164,7 @@ void ege::physics::Engine::renderDebug(const echrono::Duration& _delta, const em } if (propertyDebugAABB.get() == true) { for (auto &it : m_component) { - if (it == nullptr) { + if (it == null) { continue; } it->drawAABB(m_debugDrawProperty, _camera); @@ -180,7 +180,7 @@ class MyCallbackClass : public ephysics::RaycastCallback { ephysics::CollisionBody* m_body; MyCallbackClass(): m_haveImpact(false), - m_body(nullptr) { + m_body(null) { } public: @@ -224,15 +224,15 @@ etk::Pair, etk::Pair> ege::physics // Raycast test m_dynamicsWorld->raycast(ray, &callbackObject); if (callbackObject.m_haveImpact == true) { - if ( callbackObject.m_body == nullptr - || callbackObject.m_body->getUserData() == nullptr) { - etk::Pair, etk::Pair>(nullptr, etk::Pair(callbackObject.m_position, callbackObject.m_normal)); + if ( callbackObject.m_body == null + || callbackObject.m_body->getUserData() == null) { + etk::Pair, etk::Pair>(null, etk::Pair(callbackObject.m_position, callbackObject.m_normal)); } // TODO: je n'ai pas une entity, main un component ... ege::physics::Component* elem = static_cast(callbackObject.m_body->getUserData()); return etk::Pair, etk::Pair>(elem->sharedFromThis(), etk::Pair(callbackObject.m_position, callbackObject.m_normal)); } EGE_VERBOSE(" No Hit"); - return etk::Pair, etk::Pair>(nullptr, etk::Pair(vec3(0,0,0),vec3(0,0,0))); + return etk::Pair, etk::Pair>(null, etk::Pair(vec3(0,0,0),vec3(0,0,0))); } \ No newline at end of file diff --git a/ege/physics/shape/ConvexHull.cpp b/ege/physics/shape/ConvexHull.cpp index 922fec4..a39cc19 100644 --- a/ege/physics/shape/ConvexHull.cpp +++ b/ege/physics/shape/ConvexHull.cpp @@ -17,7 +17,7 @@ bool ege::physics::shape::ConvexHull::parse(const char* _line) { char* base = (char*)(&_line[6]); char* tmp= strchr(base, '|'); vec3 pos(0,0,0); - while (tmp != nullptr) { + while (tmp != null) { *tmp = '\0'; sscanf(base, "%f %f %f", &pos.m_floats[0], &pos.m_floats[1], &pos.m_floats[2] ); m_points.pushBack(pos); diff --git a/ege/physics/shape/Shape.cpp b/ege/physics/shape/Shape.cpp index 56c7896..3503a1c 100644 --- a/ege/physics/shape/Shape.cpp +++ b/ege/physics/shape/Shape.cpp @@ -15,7 +15,7 @@ ememory::SharedPtr ege::physics::Shape::create(const etk::String& _name) { - ememory::SharedPtr tmpp = nullptr; + ememory::SharedPtr tmpp = null; etk::String name = etk::toLower(_name); if (name == "box") { tmpp = ememory::makeShared(); @@ -33,9 +33,9 @@ ememory::SharedPtr ege::physics::Shape::create(const etk::S tmpp = ememory::makeShared(); } else { EGE_ERROR("Create an unknow element : '" << _name << "' availlable : [BOX,SPHERE,CONE,CYLINDER,CAPSULE,CONVEXHULL,autoConcave]"); - return nullptr; + return null; } - if (tmpp == nullptr) { + if (tmpp == null) { EGE_ERROR("Allocation error for physical element : '" << _name << "'"); } return tmpp; diff --git a/ege/physics/shape/Shape.hpp b/ege/physics/shape/Shape.hpp index 47fed3f..144d079 100644 --- a/ege/physics/shape/Shape.hpp +++ b/ege/physics/shape/Shape.hpp @@ -101,51 +101,51 @@ namespace ege { }; virtual const ege::physics::shape::Box* toBox() const { - return nullptr; + return null; }; virtual ege::physics::shape::Box* toBox() { - return nullptr; + return null; }; virtual const ege::physics::shape::Cylinder* toCylinder() const { - return nullptr; + return null; }; virtual ege::physics::shape::Cylinder* toCylinder() { - return nullptr; + return null; }; virtual const ege::physics::shape::Capsule* toCapsule() const { - return nullptr; + return null; }; virtual ege::physics::shape::Capsule* toCapsule() { - return nullptr; + return null; }; virtual const ege::physics::shape::Cone* toCone() const { - return nullptr; + return null; }; virtual ege::physics::shape::Cone* toCone() { - return nullptr; + return null; }; virtual const ege::physics::shape::ConvexHull* toConvexHull() const { - return nullptr; + return null; }; virtual ege::physics::shape::ConvexHull* toConvexHull() { - return nullptr; + return null; }; virtual const ege::physics::shape::Sphere* toSphere() const { - return nullptr; + return null; }; virtual ege::physics::shape::Sphere* toSphere() { - return nullptr; + return null; }; virtual const ege::physics::shape::Concave* toConcave() const { - return nullptr; + return null; }; virtual ege::physics::shape::Concave* toConcave() { - return nullptr; + return null; }; }; } diff --git a/ege/render/Component.cpp b/ege/render/Component.cpp index fe1b5b2..d3e0be1 100644 --- a/ege/render/Component.cpp +++ b/ege/render/Component.cpp @@ -49,7 +49,7 @@ void ege::render::Component::onSignalPositionChange(const etk::Transform3D& _tra bool ege::render::Component::loadMesh(const etk::String& _meshFileName) { ememory::SharedPtr tmpMesh = ege::resource::Mesh::create(_meshFileName); - if(tmpMesh == nullptr) { + if(tmpMesh == null) { EGE_ERROR("can not load the resources : " << _meshFileName); return false; } @@ -57,12 +57,12 @@ bool ege::render::Component::loadMesh(const etk::String& _meshFileName) { } bool ege::render::Component::setMesh(ememory::SharedPtr _mesh) { - if (m_mesh != nullptr) { + if (m_mesh != null) { m_mesh.reset(); } m_mesh = _mesh; // auto load the shape : - if (m_mesh == nullptr) { + if (m_mesh == null) { return true; } return true; @@ -71,7 +71,7 @@ bool ege::render::Component::setMesh(ememory::SharedPtr _me void ege::render::Component::draw(int32_t _pass) { //EGE_INFO("draw : " << _pass ); if (_pass == 0) { - if(m_mesh != nullptr) { + if(m_mesh != null) { //EGE_INFO("element pos = " << getPosition()); float mmm[16]; // Get the OpenGL matrix array of the transform @@ -85,7 +85,7 @@ void ege::render::Component::draw(int32_t _pass) { } void ege::render::Component::drawNormalDebug(ememory::SharedPtr _draw) { - if(m_mesh != nullptr) { + if(m_mesh != null) { float mmm[16]; // Get the OpenGL matrix array of the transform m_transform.getOpenGLMatrix(mmm); diff --git a/ege/render/Component.hpp b/ege/render/Component.hpp index 1369080..7dcb79c 100644 --- a/ege/render/Component.hpp +++ b/ege/render/Component.hpp @@ -32,7 +32,7 @@ namespace ege { */ Component(ememory::SharedPtr _mesh); protected: - ememory::SharedPtr m_mesh; //!< Mesh of the Element (can be nullptr) + ememory::SharedPtr m_mesh; //!< Mesh of the Element (can be null) public: /** * @brief Select a mesh with a specific name. @@ -43,7 +43,7 @@ namespace ege { virtual bool loadMesh(const etk::String& _fileName); /** * @brief set the the Mesh properties. - * @param[in] _mesh The mesh pointer. (nullptr to force the mesh remove ...) + * @param[in] _mesh The mesh pointer. (null to force the mesh remove ...) * @note : this remove the shape and the mesh properties. * @return true if no error occured */ diff --git a/ege/render/Engine.cpp b/ege/render/Engine.cpp index d64785f..3135f02 100644 --- a/ege/render/Engine.cpp +++ b/ege/render/Engine.cpp @@ -33,7 +33,7 @@ void ege::render::Engine::componentAdd(const ememory::SharedPtr& for (auto it=m_component.begin(); it != m_component.end(); ++it) { - if (*it == nullptr) { + if (*it == null) { *it = ref; return; } @@ -51,11 +51,11 @@ void ege::render::Engine::getOrderedElementForDisplay(etk::Vector& _camera) { /* for (auto &it : m_component) { - if (it == nullptr) { + if (it == null) { continue; } @@ -137,7 +137,7 @@ void ege::render::Engine::renderDebug(const echrono::Duration& _delta, const eme /* etk::Map> listCamera = m_env->getCameraList(); for (auto &itCam : listCamera) { - if (itCam.second != nullptr) { + if (itCam.second != null) { itCam.second->drawDebug(m_debugDrawProperty, camera); } } @@ -156,7 +156,7 @@ void ege::render::Engine::renderDebug(const echrono::Duration& _delta, const eme signalDisplayDebug.emit(m_debugDrawProperty); } /* TODO: set it back ... - if (camera != nullptr) { + if (camera != null) { m_env->getParticuleEngine().draw(*camera); } */ diff --git a/ege/resource/Mesh.cpp b/ege/resource/Mesh.cpp index 724a9e7..9e58f6e 100644 --- a/ege/resource/Mesh.cpp +++ b/ege/resource/Mesh.cpp @@ -26,8 +26,8 @@ ege::resource::Mesh::Mesh() : m_numberOfElments(-1), m_listFaces(0,false), m_materials(0,false), - m_pointerShape(nullptr), - m_functionFreeShape(nullptr) { + m_pointerShape(null), + m_functionFreeShape(null) { addResourceType("ege::resource::Mesh"); } @@ -45,7 +45,7 @@ void ege::resource::Mesh::init(const etk::String& _fileName, const etk::String& EGE_VERBOSE(m_name << " " << m_light << " shader=" << _shaderName); m_GLprogram = gale::resource::Program::create(_shaderName); - if (m_GLprogram != nullptr) { + if (m_GLprogram != null) { m_GLPosition = m_GLprogram->getAttribute("EW_coord3d"); m_GLtexture = m_GLprogram->getAttribute("EW_texture2d"); m_GLNormal = m_GLprogram->getAttribute("EW_normal"); @@ -58,7 +58,7 @@ void ege::resource::Mesh::init(const etk::String& _fileName, const etk::String& } // this is the properties of the buffer requested : "r"/"w" + "-" + buffer type "f"=flaot "i"=integer m_verticesVBO = gale::resource::VirtualBufferObject::create(5); - if (m_verticesVBO == nullptr) { + if (m_verticesVBO == null) { EGE_ERROR("can not instanciate VBO ..."); return; } @@ -86,9 +86,9 @@ void ege::resource::Mesh::init(const etk::String& _fileName, const etk::String& ege::resource::Mesh::~Mesh() { // remove dynamics dependencies : - if (m_functionFreeShape != nullptr) { + if (m_functionFreeShape != null) { m_functionFreeShape(m_pointerShape); - m_pointerShape = nullptr; + m_pointerShape = null; } } @@ -112,7 +112,7 @@ void ege::resource::Mesh::draw(mat4& _positionMatrix, // TODO : Remove this, it is just for test the 23-04-2016 //m_checkNormal = false; EGE_VERBOSE("draw Mesh : " << m_name << " (start)"); - if (m_GLprogram == nullptr) { + if (m_GLprogram == null) { EGE_ERROR("No shader ..."); return; } @@ -407,7 +407,7 @@ void ege::resource::Mesh::generateVBO() { // clean faces indexes : m_listFaces.getValue(kkk).m_index.clear(); int32_t nbIndicInFace = 3; - if (m_materials[m_listFaces.getKey(kkk)] == nullptr) { + if (m_materials[m_listFaces.getKey(kkk)] == null) { EGE_ERROR("Can not get material : " << m_listFaces.getKey(kkk) << " pointer value: " << size_t(m_materials[m_listFaces.getKey(kkk)].get())); continue; } @@ -524,7 +524,7 @@ void ege::resource::Mesh::createIcoSphere(const etk::String& _materialName,float void ege::resource::Mesh::addMaterial(const etk::String& _name, ememory::SharedPtr _data) { - if (_data == nullptr) { + if (_data == null) { EGE_ERROR(" can not add material with null pointer"); return; } @@ -537,9 +537,9 @@ void ege::resource::Mesh::addMaterial(const etk::String& _name, ememory::SharedP } void ege::resource::Mesh::setShape(void* _shape) { - if (m_functionFreeShape!=nullptr) { + if (m_functionFreeShape!=null) { m_functionFreeShape(m_pointerShape); - m_pointerShape = nullptr; + m_pointerShape = null; } m_pointerShape=_shape; } @@ -717,14 +717,14 @@ void ege::resource::Mesh::addTriangle(const etk::String& _layerName, const vec3& #include const etk::Vector>& ege::resource::Mesh::getPhysicalProperties() { for (auto &it: m_physics) { - if (it == nullptr) { - EGE_WARNING("Get nullptr ... "); + if (it == null) { + EGE_WARNING("Get null ... "); continue; } if (it->getType() == ege::physics::Shape::type::concave) { // need to generate the internal list of point and triangle needed: ege::physics::shape::Concave* tmpElement = it->toConcave(); - if (tmpElement == nullptr) { + if (tmpElement == null) { EGE_ERROR(" Concave ==> can not cast in Concave"); return m_physics; } diff --git a/ege/resource/Mesh.hpp b/ege/resource/Mesh.hpp index 2bc2239..2b9901c 100644 --- a/ege/resource/Mesh.hpp +++ b/ege/resource/Mesh.hpp @@ -165,7 +165,7 @@ namespace ege { }; const etk::Vector>& getPhysicalProperties(); void addPhysicElement(const ememory::SharedPtr& _shape) { - if (_shape == nullptr) { + if (_shape == null) { return; } m_physics.pushBack(_shape); diff --git a/ege/resource/MeshCapsule.cpp b/ege/resource/MeshCapsule.cpp index bc1f25b..25c3df5 100644 --- a/ege/resource/MeshCapsule.cpp +++ b/ege/resource/MeshCapsule.cpp @@ -10,7 +10,7 @@ ememory::SharedPtr ege::resource::Mesh::createCapsule(float _radius, float _size, const etk::String& _materialName, const etk::Color& _color, int32_t _lats, int32_t _longs) { EGE_VERBOSE(" create a capsule _size=" << _size << " _materialName=" << _materialName << " _color=" << _color); ememory::SharedPtr out = ege::resource::Mesh::create("---", "DATA:color3.prog"); - if (out != nullptr) { + if (out != null) { ememory::SharedPtr material = ememory::makeShared(); // set the element material properties : material->setAmbientFactor(vec4(1,1,1,1)); diff --git a/ege/resource/MeshCone.cpp b/ege/resource/MeshCone.cpp index f8f4ec3..e662341 100644 --- a/ege/resource/MeshCone.cpp +++ b/ege/resource/MeshCone.cpp @@ -10,7 +10,7 @@ ememory::SharedPtr ege::resource::Mesh::createCone(float _radius, float _size, const etk::String& _materialName, const etk::Color& _color, int32_t _lats, int32_t _longs) { EGE_VERBOSE(" create a cylinder _size=" << _size << " _materialName=" << _materialName << " _color=" << _color); ememory::SharedPtr out = ege::resource::Mesh::create("---", "DATA:color3.prog"); - if (out != nullptr) { + if (out != null) { ememory::SharedPtr material = ememory::makeShared(); // set the element material properties : material->setAmbientFactor(vec4(1,1,1,1)); diff --git a/ege/resource/MeshCube.cpp b/ege/resource/MeshCube.cpp index 9e5c7a3..dff53fe 100644 --- a/ege/resource/MeshCube.cpp +++ b/ege/resource/MeshCube.cpp @@ -14,7 +14,7 @@ ememory::SharedPtr ege::resource::Mesh::createCube(float _s ememory::SharedPtr ege::resource::Mesh::createCube(const vec3& _size, const etk::String& _materialName, const etk::Color& _color) { EGE_VERBOSE(" create a cube _size=" << _size << " _materialName=" << _materialName << " _color=" << _color); ememory::SharedPtr out = ege::resource::Mesh::create("---", "DATA:color3.prog"); - if (out != nullptr) { + if (out != null) { ememory::SharedPtr material = ememory::makeShared(); // set the element material properties : material->setAmbientFactor(vec4(1,1,1,1)); diff --git a/ege/resource/MeshCylinder.cpp b/ege/resource/MeshCylinder.cpp index 8a26819..4142e8a 100644 --- a/ege/resource/MeshCylinder.cpp +++ b/ege/resource/MeshCylinder.cpp @@ -10,7 +10,7 @@ ememory::SharedPtr ege::resource::Mesh::createCylinder(float _radius, float _size, const etk::String& _materialName, const etk::Color& _color, int32_t _lats, int32_t _longs) { EGE_VERBOSE(" create a cylinder _size=" << _size << " _materialName=" << _materialName << " _color=" << _color); ememory::SharedPtr out = ege::resource::Mesh::create("---", "DATA:color3.prog"); - if (out != nullptr) { + if (out != null) { ememory::SharedPtr material = ememory::makeShared(); // set the element material properties : material->setAmbientFactor(vec4(1,1,1,1)); diff --git a/ege/resource/MeshEmf.cpp b/ege/resource/MeshEmf.cpp index 21977f7..d294d43 100644 --- a/ege/resource/MeshEmf.cpp +++ b/ege/resource/MeshEmf.cpp @@ -62,7 +62,7 @@ static char* loadNextData(char* _elementLine, /* if (m_zipReadingOffset >= m_zipContent->size()) { element[0] = '\0'; - return nullptr; + return null; } */ char current = _file.fileGet(); @@ -95,12 +95,12 @@ static char* loadNextData(char* _elementLine, current = _file.fileGet(); } if (outSize == 0) { - return nullptr; + return null; } else { // send last line return _elementLine; } - return nullptr; + return null; } static void removeEndLine(char* _val) { @@ -184,7 +184,7 @@ bool ege::resource::Mesh::loadEMF(const etk::String& _fileName) { int32_t level = countIndent(fileName); if (level == 0) { // new section ... - if (loadNextData(inputDataLine, 2048, fileName) == nullptr) { + if (loadNextData(inputDataLine, 2048, fileName) == null) { // reach end of file ... break; } @@ -202,10 +202,10 @@ bool ege::resource::Mesh::loadEMF(const etk::String& _fileName) { currentMode = EMFModuleMaterial; // add previous material: if( materialName != "" - && material != nullptr) { + && material != null) { m_materials.add(materialName, material); materialName = ""; - material = nullptr; + material = null; } material = ememory::makeShared(); removeEndLine(inputDataLine); @@ -223,7 +223,7 @@ bool ege::resource::Mesh::loadEMF(const etk::String& _fileName) { && currentMode <= EMFModuleMesh_END) { if (level == 1) { // In the mesh level 2 the line size must not exced 2048 - if (loadNextData(inputDataLine, 2048, fileName, true) == nullptr) { + if (loadNextData(inputDataLine, 2048, fileName, true) == null) { // reach end of file ... break; } @@ -261,7 +261,7 @@ bool ege::resource::Mesh::loadEMF(const etk::String& _fileName) { break; case EMFModuleMeshVertex: { vec3 vertex(0,0,0); - while (loadNextData(inputDataLine, 2048, fileName, true, true) != nullptr) { + while (loadNextData(inputDataLine, 2048, fileName, true, true) != null) { if (inputDataLine[0] == '\0') { break; } @@ -278,7 +278,7 @@ bool ege::resource::Mesh::loadEMF(const etk::String& _fileName) { } case EMFModuleMeshUVMapping: { vec2 uvMap(0,0); - while (loadNextData(inputDataLine, 2048, fileName, true, true) != nullptr) { + while (loadNextData(inputDataLine, 2048, fileName, true, true) != null) { if (inputDataLine[0] == '\0') { break; } @@ -297,7 +297,7 @@ bool ege::resource::Mesh::loadEMF(const etk::String& _fileName) { m_normalMode = ege::resource::Mesh::normalMode::vertex; vec3 normal(0,0,0); // find the vertex Normal list. - while (loadNextData(inputDataLine, 2048, fileName, true, true) != nullptr) { + while (loadNextData(inputDataLine, 2048, fileName, true, true) != null) { if (inputDataLine[0] == '\0') { break; } @@ -317,7 +317,7 @@ bool ege::resource::Mesh::loadEMF(const etk::String& _fileName) { m_normalMode = ege::resource::Mesh::normalMode::face; // TODO : check if it is the same mode of display the normal from the start of the file vec3 normal(0,0,0); // find the face Normal list. - while (loadNextData(inputDataLine, 2048, fileName, true, true) != nullptr) { + while (loadNextData(inputDataLine, 2048, fileName, true, true) != null) { if (inputDataLine[0] == '\0') { break; } @@ -336,7 +336,7 @@ bool ege::resource::Mesh::loadEMF(const etk::String& _fileName) { case EMFModuleMeshFaceMaterial: if (level == 2) { //Find mesh name ... - if (loadNextData(inputDataLine, 2048, fileName, true) == nullptr) { + if (loadNextData(inputDataLine, 2048, fileName, true) == null) { // reach end of file ... break; } @@ -350,7 +350,7 @@ bool ege::resource::Mesh::loadEMF(const etk::String& _fileName) { meshFaceMaterialID = m_listFaces.getId(inputDataLine); EGE_VERBOSE(" " << inputDataLine); } else if (currentMode == EMFModuleMeshFaceMaterial) { - while (loadNextData(inputDataLine, 2048, fileName, true, true) != nullptr) { + while (loadNextData(inputDataLine, 2048, fileName, true, true) != null) { if (inputDataLine[0] == '\0') { // end of line break; @@ -429,14 +429,14 @@ bool ege::resource::Mesh::loadEMF(const etk::String& _fileName) { break; case EMFModuleMeshPhysics: case EMFModuleMeshPhysicsNamed: - if (loadNextData(inputDataLine, 2048, fileName, true, false, false) == nullptr) { + if (loadNextData(inputDataLine, 2048, fileName, true, false, false) == null) { // reach end of file ... break; } removeEndLine(inputDataLine); if (level == 2) { physics = ege::physics::Shape::create(inputDataLine); - if (physics == nullptr) { + if (physics == null) { EGE_ERROR("Allocation error when creating physical shape ..."); continue; } @@ -444,7 +444,7 @@ bool ege::resource::Mesh::loadEMF(const etk::String& _fileName) { EGE_VERBOSE(" " << m_physics.size() << " " << inputDataLine); currentMode = EMFModuleMeshPhysicsNamed; } else if (currentMode == EMFModuleMeshPhysicsNamed) { - if (physics == nullptr) { + if (physics == null) { EGE_ERROR("Can not parse :'" << inputDataLine << "' in physical shape ..."); continue; } @@ -458,12 +458,12 @@ bool ege::resource::Mesh::loadEMF(const etk::String& _fileName) { } else if ( currentMode >= EMFModuleMaterial && currentMode <= EMFModuleMaterial_END) { // all material element is stored on 1 line (size < 2048) - if (loadNextData(inputDataLine, 2048, fileName, true) == nullptr) { + if (loadNextData(inputDataLine, 2048, fileName, true) == null) { // reach end of file ... break; } removeEndLine(inputDataLine); - if (material == nullptr) { + if (material == null) { EGE_ERROR("material allocation error"); jumpEndLine(fileName); continue; @@ -528,7 +528,7 @@ bool ege::resource::Mesh::loadEMF(const etk::String& _fileName) { } } else if ( currentMode >= EMFModulePhysics && currentMode <= EMFModulePhysics_END) { - if (loadNextData(inputDataLine, 2048, fileName, true, false, false) == nullptr) { + if (loadNextData(inputDataLine, 2048, fileName, true, false, false) == null) { // reach end of file ... break; } @@ -536,7 +536,7 @@ bool ege::resource::Mesh::loadEMF(const etk::String& _fileName) { if (level == 1) { EGE_ERROR("Load shape : " << inputDataLine); physics = ege::physics::Shape::create(inputDataLine); - if (physics == nullptr) { + if (physics == null) { EGE_ERROR("Allocation error when creating physical shape ..."); continue; } @@ -544,7 +544,7 @@ bool ege::resource::Mesh::loadEMF(const etk::String& _fileName) { EGE_VERBOSE(" " << m_physics.size() << " " << inputDataLine); currentMode = EMFModulePhysicsNamed; } else if (currentMode == EMFModulePhysicsNamed) { - if (physics == nullptr) { + if (physics == null) { EGE_ERROR("Can not parse :'" << inputDataLine << "' in physical shape ..."); continue; } @@ -561,7 +561,7 @@ bool ege::resource::Mesh::loadEMF(const etk::String& _fileName) { } // add last material ... if( materialName != "" - && material != nullptr) { + && material != null) { m_materials.add(materialName, material); materialName = ""; material.reset(); diff --git a/ege/resource/MeshGird.cpp b/ege/resource/MeshGird.cpp index 30e641c..85ab1d4 100644 --- a/ege/resource/MeshGird.cpp +++ b/ege/resource/MeshGird.cpp @@ -9,7 +9,7 @@ ememory::SharedPtr ege::resource::Mesh::createGrid(int32_t _lineCount, const vec3& _position, float _size, const etk::String& _materialName) { ememory::SharedPtr out = ege::resource::Mesh::create("---", "DATA:color3.prog"); - if (out != nullptr) { + if (out != null) { ememory::SharedPtr material = ememory::makeShared(); // set the element material properties : material->setAmbientFactor(vec4(1,1,1,1)); diff --git a/ege/resource/MeshObj.cpp b/ege/resource/MeshObj.cpp index 6651d85..10978bb 100644 --- a/ege/resource/MeshObj.cpp +++ b/ege/resource/MeshObj.cpp @@ -25,7 +25,7 @@ bool ege::resource::Mesh::loadOBJ(const etk::String& _fileName) { char inputDataLine[2048]; int32_t lineID = 0; - while (fileName.fileGets(inputDataLine, 2048) != nullptr) + while (fileName.fileGets(inputDataLine, 2048) != null) { lineID++; if (inputDataLine[0] == 'v') { diff --git a/ege/resource/MeshSphere.cpp b/ege/resource/MeshSphere.cpp index 9ddfd47..5c7661e 100644 --- a/ege/resource/MeshSphere.cpp +++ b/ege/resource/MeshSphere.cpp @@ -10,7 +10,7 @@ ememory::SharedPtr ege::resource::Mesh::createSphere(float _radius, const etk::String& _materialName, const etk::Color& _color, int32_t _lats, int32_t _longs) { EGE_VERBOSE(" create a sphere _size=" << _radius << " _materialName=" << _materialName << " _color=" << _color); ememory::SharedPtr out = ege::resource::Mesh::create("---", "DATA:color3.prog"); - if (out != nullptr) { + if (out != null) { ememory::SharedPtr material = ememory::makeShared(); // set the element material properties : material->setAmbientFactor(vec4(1,1,1,1)); diff --git a/ege/resource/ParticuleMesh.cpp b/ege/resource/ParticuleMesh.cpp index 89ef534..22c185e 100644 --- a/ege/resource/ParticuleMesh.cpp +++ b/ege/resource/ParticuleMesh.cpp @@ -15,7 +15,7 @@ ege::resource::ParticuleMesh::ParticuleMesh() { void ege::resource::ParticuleMesh::init(const etk::String& _fileName, const etk::String& _shaderName) { ege::resource::Mesh::init(_fileName, _shaderName); - if (m_GLprogram != nullptr) { + if (m_GLprogram != null) { m_GLMainColor = m_GLprogram->getUniform("EW_mainColor"); } } @@ -29,7 +29,7 @@ void ege::resource::ParticuleMesh::draw(mat4& _positionMatrix, bool _enableDepthTest, bool _enableDepthUpdate) { - if (m_GLprogram == nullptr) { + if (m_GLprogram == null) { EGE_ERROR("No shader ..."); return; } diff --git a/ege/widget/Mesh.cpp b/ege/widget/Mesh.cpp index e762e0c..ff83352 100644 --- a/ege/widget/Mesh.cpp +++ b/ege/widget/Mesh.cpp @@ -26,7 +26,7 @@ void ege::widget::Mesh::init() { setMouseLimit(1); if (*propertyName != "") { m_object = ege::resource::Mesh::create(m_meshName); - if (m_object == nullptr) { + if (m_object == null) { EGE_ERROR("Can not load the resource : \"" << m_meshName << "\""); } } @@ -42,7 +42,7 @@ void ege::widget::Mesh::onDraw() { * etk::matRotate(vec3(1,0,0),m_angle.x()) * etk::matRotate(vec3(0,1,0),m_angle.y()) * etk::matRotate(vec3(0,0,1),m_angle.z()); - if (m_object != nullptr) { + if (m_object != null) { m_object->draw(transformationMatrix); } } @@ -90,7 +90,7 @@ void ege::widget::Mesh::setFile(const etk::String& _filename) { && m_meshName != _filename ) { m_meshName = _filename; m_object = ege::resource::Mesh::create(m_meshName); - if (m_object == nullptr) { + if (m_object == null) { EGE_ERROR("Can not load the resource : \"" << m_meshName << "\""); } } diff --git a/ege/widget/Scene.cpp b/ege/widget/Scene.cpp index f28af69..85f3ce0 100644 --- a/ege/widget/Scene.cpp +++ b/ege/widget/Scene.cpp @@ -52,9 +52,9 @@ ege::widget::Scene::~Scene() { void ege::widget::Scene::onRegenerateDisplay() { if (needRedraw() == true) { // Update the curent camera with the aspect ratio - if (m_env != nullptr) { + if (m_env != null) { ememory::SharedPtr camera = m_env->getCamera(m_cameraName); - if (camera != nullptr) { + if (camera != null) { camera->setSceenSize(getSize()); } } @@ -107,7 +107,7 @@ void ege::widget::Scene::systemDraw(const ewol::DrawProperty& _displayProp) { gale::openGL::setViewPort(m_origin, m_size); // configure render with the camera... ememory::SharedPtr camera = m_env->getCamera(m_cameraName); - if (camera != nullptr) { + if (camera != null) { camera->configureOpenGL(); } onDraw(); @@ -126,7 +126,7 @@ void ege::widget::Scene::setCamera(const etk::String& _cameraName) { m_cameraName = _cameraName; // Update camera aspect ratio: ememory::SharedPtr camera = m_env->getCamera(m_cameraName); - if (camera != nullptr) { + if (camera != null) { camera->setSceenSize(m_size); } } @@ -135,7 +135,7 @@ void ege::widget::Scene::calculateSize() { ewol::Widget::calculateSize(); // Update camera aspect ratio: ememory::SharedPtr camera = m_env->getCamera(m_cameraName); - if (camera != nullptr) { + if (camera != null) { camera->setSceenSize(m_size); } } diff --git a/sample/CameraPosition/appl/Windows.cpp b/sample/CameraPosition/appl/Windows.cpp index c03fbb8..b0a9287 100644 --- a/sample/CameraPosition/appl/Windows.cpp +++ b/sample/CameraPosition/appl/Windows.cpp @@ -32,7 +32,7 @@ appl::Windows::Windows() { static ememory::SharedPtr createViewBoxStar() { ememory::SharedPtr out = ege::resource::Mesh::create("viewBoxStar", "DATA:texturedNoMaterial.prog"); - if (out != nullptr) { + if (out != null) { ememory::SharedPtr material = ememory::makeShared(); // set the entity material properties : material->setAmbientFactor(vec4(1,1,1,1)); @@ -48,7 +48,7 @@ static ememory::SharedPtr createViewBoxStar() { out->addMaterial("basics", material); //material->setImageSize(ivec2(size,size)); egami::Image* myImage = material->get(); - if (nullptr == myImage) { + if (null == myImage) { return out; } myImage->clear(etk::color::black); @@ -80,7 +80,7 @@ void appl::Windows::init() { m_env->addCamera("basic", m_camera); ememory::SharedPtr tmpWidget = ege::widget::Scene::create(); - if (tmpWidget == nullptr) { + if (tmpWidget == null) { APPL_ERROR("Can not allocate widget ==> display might be in error"); } else { tmpWidget->setEnv(m_env); @@ -92,7 +92,7 @@ void appl::Windows::init() { ememory::SharedPtr myMesh; // Create an external box: (no physics) myMesh = createViewBoxStar(); - if (myMesh != nullptr) { + if (myMesh != null) { ememory::SharedPtr entity = ememory::makeShared(m_env); // 1st Position component: etk::Transform3D transform(vec3(0,0,0), etk::Quaternion::identity()); @@ -106,7 +106,7 @@ void appl::Windows::init() { } // create basic gird: (no physics) myMesh = ege::resource::Mesh::createGrid(10, vec3(0,0,0), 5); - if (myMesh != nullptr) { + if (myMesh != null) { ememory::SharedPtr entity = ememory::makeShared(m_env); // 1st Position component: etk::Transform3D transform(vec3(0,0,0), etk::Quaternion::identity()); diff --git a/sample/Collision/appl/Windows.cpp b/sample/Collision/appl/Windows.cpp index 133cde0..d7d82be 100644 --- a/sample/Collision/appl/Windows.cpp +++ b/sample/Collision/appl/Windows.cpp @@ -34,7 +34,7 @@ appl::Windows::Windows() { static ememory::SharedPtr createViewBoxStar() { ememory::SharedPtr out = ege::resource::Mesh::create("viewBoxStar", "DATA:texturedNoMaterial.prog"); - if (out == nullptr) { + if (out == null) { return out; } ememory::SharedPtr material = ememory::makeShared(); @@ -52,7 +52,7 @@ static ememory::SharedPtr createViewBoxStar() { out->addMaterial("basics", material); //material->setImageSize(ivec2(size,size)); egami::Image* myImage = material->get(); - if (myImage == nullptr) { + if (myImage == null) { return out; } myImage->clear(etk::color::black); @@ -86,7 +86,7 @@ void appl::Windows::init() { m_cameraControler.setCamera(m_camera); ememory::SharedPtr tmpWidget = ege::widget::Scene::create(); - if (tmpWidget == nullptr) { + if (tmpWidget == null) { APPL_CRITICAL("Can not allocate widget ==> display might be in error"); } else { tmpWidget->setEnv(m_env); @@ -99,7 +99,7 @@ void appl::Windows::init() { ememory::SharedPtr myMesh; // Create an external box: (no physics) myMesh = createViewBoxStar(); - if (myMesh != nullptr) { + if (myMesh != null) { ememory::SharedPtr entity = ememory::makeShared(m_env); // 1st Position component: etk::Transform3D transform(vec3(0,0,0), etk::Quaternion::identity()); @@ -113,7 +113,7 @@ void appl::Windows::init() { } // create basic gird: (no physics) myMesh = ege::resource::Mesh::createGrid(10, vec3(0,0,0), 5); - if (myMesh != nullptr) { + if (myMesh != null) { ememory::SharedPtr entity = ememory::makeShared(m_env); // 1st Position component: etk::Transform3D transform(vec3(0,0,0), etk::Quaternion::identity()); @@ -129,7 +129,7 @@ void appl::Windows::init() { // create cubes ... myMesh = ege::resource::Mesh::createCube(vec3(200,200,0.2), "basics", etk::color::green); - if (myMesh != nullptr) { + if (myMesh != null) { ememory::SharedPtr entity = ememory::makeShared(m_env); // add all component: // 1st Position component: @@ -154,7 +154,7 @@ void appl::Windows::init() { // create cubes ... myMesh = ege::resource::Mesh::createCube(vec3(5,0.2,5), "basics", etk::color::green); - if (myMesh != nullptr) { + if (myMesh != null) { ememory::SharedPtr entity = ememory::makeShared(m_env); // add all component: // 1st Position component: @@ -174,7 +174,7 @@ void appl::Windows::init() { m_env->addEntity(entity); } myMesh = ege::resource::Mesh::createCube(3, "basics", etk::color::orange); - if (myMesh != nullptr) { + if (myMesh != null) { ememory::SharedPtr entity = ememory::makeShared(m_env); // add all component: // 1st Position component: @@ -196,7 +196,7 @@ void appl::Windows::init() { m_env->addEntity(entity); } myMesh = ege::resource::Mesh::createSphere(4, "basics", etk::color::blue); - if (myMesh != nullptr) { + if (myMesh != null) { ememory::SharedPtr entity = ememory::makeShared(m_env); // add all component: // 1st Position component: @@ -218,7 +218,7 @@ void appl::Windows::init() { m_env->addEntity(entity); } myMesh = ege::resource::Mesh::createCylinder(4, 15, "basics", etk::color::blue); - if (myMesh != nullptr) { + if (myMesh != null) { ememory::SharedPtr entity = ememory::makeShared(m_env); // add all component: // 1st Position component: @@ -241,7 +241,7 @@ void appl::Windows::init() { m_env->addEntity(entity); } myMesh = ege::resource::Mesh::createCapsule(4, 15, "basics", etk::color::purple); - if (myMesh != nullptr) { + if (myMesh != null) { ememory::SharedPtr entity = ememory::makeShared(m_env); // add all component: // 1st Position component: @@ -264,7 +264,7 @@ void appl::Windows::init() { m_env->addEntity(entity); } myMesh = ege::resource::Mesh::createCone(4, 15, "basics", etk::color::purple); - if (myMesh != nullptr) { + if (myMesh != null) { ememory::SharedPtr entity = ememory::makeShared(m_env); // add all component: // 1st Position component: @@ -307,7 +307,7 @@ bool appl::Windows::onEventInput(const ewol::event::Input& _event) { ememory::SharedPtr myMesh; myMesh = ege::resource::Mesh::createCube(1, "basics", etk::color::orange); - if (myMesh != nullptr) { + if (myMesh != null) { ememory::SharedPtr entity = ememory::makeShared(m_env); // add all component: // 1st Position component: diff --git a/sample/DoubleView/appl/Windows.cpp b/sample/DoubleView/appl/Windows.cpp index bbc9777..bbf9a98 100644 --- a/sample/DoubleView/appl/Windows.cpp +++ b/sample/DoubleView/appl/Windows.cpp @@ -33,7 +33,7 @@ appl::Windows::Windows() { static ememory::SharedPtr createViewBoxStar() { ememory::SharedPtr out = ege::resource::Mesh::create("viewBoxStar", "DATA:texturedNoMaterial.prog"); - if (out != nullptr) { + if (out != null) { ememory::SharedPtr material = ememory::makeShared(); // set the entity material properties : material->setAmbientFactor(vec4(1,1,1,1)); @@ -49,7 +49,7 @@ static ememory::SharedPtr createViewBoxStar() { out->addMaterial("basics", material); //material->setImageSize(ivec2(size,size)); egami::Image* myImage = material->get(); - if (nullptr == myImage) { + if (null == myImage) { return out; } myImage->clear(etk::color::black); @@ -89,13 +89,13 @@ void appl::Windows::init() { m_env->addCamera("left", camera4); ememory::SharedPtr tmpSizerVert = ewol::widget::Sizer::create(); - if (tmpSizerVert == nullptr) { + if (tmpSizerVert == null) { APPL_CRITICAL("Can not allocate widget ==> display might be in error"); } else { tmpSizerVert->propertyMode.set(ewol::widget::Sizer::modeVert); setSubWidget(tmpSizerVert); ememory::SharedPtr tmpWidget = ege::widget::Scene::create(); - if (tmpWidget == nullptr) { + if (tmpWidget == null) { APPL_CRITICAL("Can not allocate widget ==> display might be in error"); } else { tmpWidget->setEnv(m_env); @@ -105,13 +105,13 @@ void appl::Windows::init() { tmpSizerVert->subWidgetAdd(tmpWidget); } ememory::SharedPtr tmpSizerHori = ewol::widget::Sizer::create(); - if (tmpSizerHori == nullptr) { + if (tmpSizerHori == null) { APPL_CRITICAL("Can not allocate widget ==> display might be in error"); } else { tmpSizerHori->propertyMode.set(ewol::widget::Sizer::modeHori); tmpSizerVert->subWidgetAdd(tmpSizerHori); tmpWidget = ege::widget::Scene::create(); - if (tmpWidget == nullptr) { + if (tmpWidget == null) { APPL_CRITICAL("Can not allocate widget ==> display might be in error"); } else { tmpWidget->setEnv(m_env); @@ -121,7 +121,7 @@ void appl::Windows::init() { tmpSizerHori->subWidgetAdd(tmpWidget); } tmpWidget = ege::widget::Scene::create(); - if (tmpWidget == nullptr) { + if (tmpWidget == null) { APPL_CRITICAL("Can not allocate widget ==> display might be in error"); } else { tmpWidget->setEnv(m_env); @@ -136,7 +136,7 @@ void appl::Windows::init() { ememory::SharedPtr myMesh; // Create an external box: (no physics) myMesh = createViewBoxStar(); - if (myMesh != nullptr) { + if (myMesh != null) { ememory::SharedPtr entity = ememory::makeShared(m_env); // 1st Position component: etk::Transform3D transform(vec3(0,0,0), etk::Quaternion::identity()); @@ -150,7 +150,7 @@ void appl::Windows::init() { } // create basic gird: (no physics) myMesh = ege::resource::Mesh::createGrid(10, vec3(0,0,0), 5); - if (myMesh != nullptr) { + if (myMesh != null) { ememory::SharedPtr entity = ememory::makeShared(m_env); // 1st Position component: etk::Transform3D transform(vec3(0,0,0), etk::Quaternion::identity()); @@ -163,7 +163,7 @@ void appl::Windows::init() { m_env->addEntity(entity); } myMesh = ege::resource::Mesh::createCube(3, "basics", etk::color::orange); - if (myMesh != nullptr) { + if (myMesh != null) { ememory::SharedPtr entity = ememory::makeShared(m_env); // add all component: // 1st Position component: @@ -185,7 +185,7 @@ void appl::Windows::init() { m_env->addEntity(entity); } myMesh = ege::resource::Mesh::createSphere(4, "basics", etk::color::blue); - if (myMesh != nullptr) { + if (myMesh != null) { ememory::SharedPtr entity = ememory::makeShared(m_env); // add all component: // 1st Position component: diff --git a/sample/LowPoly/appl/Windows.cpp b/sample/LowPoly/appl/Windows.cpp index 8985e1b..93b07c2 100644 --- a/sample/LowPoly/appl/Windows.cpp +++ b/sample/LowPoly/appl/Windows.cpp @@ -32,7 +32,7 @@ appl::Windows::Windows() { static ememory::SharedPtr createViewBoxStar() { ememory::SharedPtr out = ege::resource::Mesh::create("viewBoxStar", "DATA:texturedNoMaterial.prog"); - if (out != nullptr) { + if (out != null) { ememory::SharedPtr material = ememory::makeShared(); // set the entity material properties : material->setAmbientFactor(vec4(1,1,1,1)); @@ -48,7 +48,7 @@ static ememory::SharedPtr createViewBoxStar() { out->addMaterial("basics", material); //material->setImageSize(ivec2(size,size)); egami::Image* myImage = material->get(); - if (myImage == nullptr) { + if (myImage == null) { return out; } myImage->clear(etk::color::black); @@ -80,7 +80,7 @@ void appl::Windows::init() { m_cameraControler.setCamera(m_camera); ememory::SharedPtr tmpWidget = ege::widget::Scene::create(); - if (tmpWidget == nullptr) { + if (tmpWidget == null) { APPL_ERROR("Can not allocate widget ==> display might be in error"); } else { tmpWidget->setEnv(m_env); @@ -92,7 +92,7 @@ void appl::Windows::init() { ememory::SharedPtr myMesh; // Create an external box: (no physics) myMesh = createViewBoxStar(); - if (myMesh != nullptr) { + if (myMesh != null) { ememory::SharedPtr entity = ememory::makeShared(m_env); // 1st Position component: etk::Transform3D transform(vec3(0,0,0), etk::Quaternion::identity()); @@ -106,7 +106,7 @@ void appl::Windows::init() { } // create basic gird: (no physics) myMesh = ege::resource::Mesh::createGrid(10, vec3(0,0,0), 5); - if (myMesh != nullptr) { + if (myMesh != null) { ememory::SharedPtr entity = ememory::makeShared(m_env); // 1st Position component: etk::Transform3D transform(vec3(0,0,0), etk::Quaternion::identity()); @@ -119,7 +119,7 @@ void appl::Windows::init() { m_env->addEntity(entity); } myMesh = ege::resource::Mesh::create("DATA:tree_1.emf"); - if (myMesh != nullptr) { + if (myMesh != null) { ememory::SharedPtr entity = ememory::makeShared(m_env); // add all component: // 1st Position component: diff --git a/sample/MeshCreator/appl/Windows.cpp b/sample/MeshCreator/appl/Windows.cpp index adeaf61..ab1c8f7 100644 --- a/sample/MeshCreator/appl/Windows.cpp +++ b/sample/MeshCreator/appl/Windows.cpp @@ -32,7 +32,7 @@ appl::Windows::Windows() { static ememory::SharedPtr createViewBoxStar() { ememory::SharedPtr out = ege::resource::Mesh::create("---", "DATA:texturedNoMaterial.prog"); - if (out != nullptr) { + if (out != null) { ememory::SharedPtr material = ememory::makeShared(); // set the entity material properties : material->setAmbientFactor(vec4(1,1,1,1)); @@ -47,7 +47,7 @@ static ememory::SharedPtr createViewBoxStar() { int32_t size = 1<<11; material->setImageSize(ivec2(size,size)); egami::Image* myImage = material->get(); - if (nullptr == myImage) { + if (null == myImage) { return out; } myImage->clear(etk::color::black); @@ -67,7 +67,7 @@ static ememory::SharedPtr createViewBoxStar() { static ememory::SharedPtr createMars() { ememory::SharedPtr out = ege::resource::Mesh::create("---"); - if (out != nullptr) { + if (out != null) { ememory::SharedPtr material = ememory::makeShared(); material->setAmbientFactor(vec4(0.112f,0.112f,0.112f,1.0f)); material->setDiffuseFactor(vec4(0.512f,0.512f,0.512f,1.0f)); @@ -94,7 +94,7 @@ void appl::Windows::init() { m_cameraControler.setCamera(m_camera); ememory::SharedPtr tmpWidget = ege::widget::Scene::create(); - if (tmpWidget == nullptr) { + if (tmpWidget == null) { APPL_ERROR("Can not allocate widget ==> display might be in error"); } else { tmpWidget->setEnv(m_env); @@ -106,7 +106,7 @@ void appl::Windows::init() { ememory::SharedPtr myMesh; // Create an external box: (no physics) myMesh = createViewBoxStar(); - if (myMesh != nullptr) { + if (myMesh != null) { ememory::SharedPtr entity = ememory::makeShared(m_env); // 1st Position component: etk::Transform3D transform(vec3(0,0,0), etk::Quaternion::identity()); @@ -120,7 +120,7 @@ void appl::Windows::init() { } // create basic gird: (no physics) myMesh = ege::resource::Mesh::createGrid(10, vec3(0,0,0), 5); - if (myMesh != nullptr) { + if (myMesh != null) { ememory::SharedPtr entity = ememory::makeShared(m_env); // 1st Position component: etk::Transform3D transform(vec3(0,0,0), etk::Quaternion::identity()); @@ -134,7 +134,7 @@ void appl::Windows::init() { } if (false) { myMesh = createMars(); - if (myMesh != nullptr) { + if (myMesh != null) { ememory::SharedPtr entity = ememory::makeShared(m_env); // 1st Position component: etk::Transform3D transform(vec3(5,0,0), etk::Quaternion::identity()); @@ -163,7 +163,7 @@ void appl::Windows::setDebugShape() { void appl::Windows::setMeshName(const etk::String& _fileName) { // Create an external box: (no physics) ememory::SharedPtr myMesh = ege::resource::Mesh::create(_fileName); - if (myMesh != nullptr) { + if (myMesh != null) { ememory::SharedPtr entity = ememory::makeShared(m_env); // 1st Position component: etk::Transform3D transform(vec3(0,0,0), etk::Quaternion::identity()); @@ -214,7 +214,7 @@ bool appl::Windows::onEventInput(const ewol::event::Input& _event) { ememory::SharedPtr myMesh; myMesh = ege::resource::Mesh::createCube(1, "basics", etk::color::orange); - if (myMesh != nullptr) { + if (myMesh != null) { ememory::SharedPtr entity = ememory::makeShared(m_env); // add all component: // 1st Position component: diff --git a/sample/RayTest/appl/Windows.cpp b/sample/RayTest/appl/Windows.cpp index ca13bd3..e1c6639 100644 --- a/sample/RayTest/appl/Windows.cpp +++ b/sample/RayTest/appl/Windows.cpp @@ -31,7 +31,7 @@ appl::Windows::Windows() { static ememory::SharedPtr createViewBoxStar() { ememory::SharedPtr out = ege::resource::Mesh::create("viewBoxStar", "DATA:texturedNoMaterial.prog"); - if (out != nullptr) { + if (out != null) { ememory::SharedPtr material = ememory::makeShared(); // set the entity material properties : material->setAmbientFactor(vec4(1,1,1,1)); @@ -47,7 +47,7 @@ static ememory::SharedPtr createViewBoxStar() { out->addMaterial("basics", material); //material->setImageSize(ivec2(size,size)); egami::Image* myImage = material->get(); - if (nullptr == myImage) { + if (null == myImage) { return out; } myImage->clear(etk::color::black); @@ -80,7 +80,7 @@ void appl::Windows::init() { m_cameraControler.setCamera(m_camera); ememory::SharedPtr tmpWidget = ege::widget::Scene::create(); - if (tmpWidget == nullptr) { + if (tmpWidget == null) { APPL_ERROR("Can not allocate widget ==> display might be in error"); } else { tmpWidget->setEnv(m_env); @@ -93,7 +93,7 @@ void appl::Windows::init() { ememory::SharedPtr myMesh; // Create an external box: (no physics) myMesh = createViewBoxStar(); - if (myMesh != nullptr) { + if (myMesh != null) { ememory::SharedPtr entity = ememory::makeShared(m_env); // 1st Position component: etk::Transform3D transform(vec3(0,0,0), etk::Quaternion::identity()); @@ -107,7 +107,7 @@ void appl::Windows::init() { } // create basic gird: (no physics) myMesh = ege::resource::Mesh::createGrid(10, vec3(0,0,0), 5); - if (myMesh != nullptr) { + if (myMesh != null) { ememory::SharedPtr entity = ememory::makeShared(m_env); // 1st Position component: etk::Transform3D transform(vec3(0,0,0), etk::Quaternion::identity()); @@ -120,7 +120,7 @@ void appl::Windows::init() { m_env->addEntity(entity); } myMesh = ege::resource::Mesh::createCube(3, "basics", etk::color::orange); - if (myMesh != nullptr) { + if (myMesh != null) { ememory::SharedPtr entity = ememory::makeShared(m_env); // add all component: // 1st Position component: @@ -142,7 +142,7 @@ void appl::Windows::init() { m_env->addEntity(entity); } myMesh = ege::resource::Mesh::createSphere(4, "basics", etk::color::blue); - if (myMesh != nullptr) { + if (myMesh != null) { ememory::SharedPtr entity = ememory::makeShared(m_env); // add all component: // 1st Position component: @@ -184,10 +184,10 @@ bool appl::Windows::onEventInput(const ewol::event::Input& _event) { m_ray = etk::makePair(ray.getOrigin(), ray.getOrigin()+ray.getDirection()*50000); APPL_DEBUG("pos=" << pos << " ray = " << ray); ememory::SharedPtr engine = ememory::dynamicPointerCast(m_env->getEngine("physics")); - if (engine != nullptr) { + if (engine != null) { /* etk::Pair, etk::Pair> result = engine->testRayObject(m_ray); - if (result.first != nullptr) { + if (result.first != null) { APPL_INFO("Select Object :" << result.first->getUID()); } */ diff --git a/sample/TorqueApply/appl/Windows.cpp b/sample/TorqueApply/appl/Windows.cpp index d822db0..a3b0fb2 100644 --- a/sample/TorqueApply/appl/Windows.cpp +++ b/sample/TorqueApply/appl/Windows.cpp @@ -34,7 +34,7 @@ appl::Windows::Windows() { static ememory::SharedPtr createViewBoxStar() { ememory::SharedPtr out = ege::resource::Mesh::create("viewBoxStar", "DATA:texturedNoMaterial.prog"); - if (out == nullptr) { + if (out == null) { return out; } ememory::SharedPtr material = ememory::makeShared(); @@ -52,7 +52,7 @@ static ememory::SharedPtr createViewBoxStar() { out->addMaterial("basics", material); //material->setImageSize(ivec2(size,size)); egami::Image* myImage = material->get(); - if (myImage == nullptr) { + if (myImage == null) { return out; } myImage->clear(etk::color::black); @@ -96,7 +96,7 @@ void appl::Windows::init() { m_env->getEngine("physics")->properties.set("debug-shape", "true"); ememory::SharedPtr tmpPhysics = ememory::dynamicPointerCast(m_env->getEngine("physics")); - if (tmpPhysics != nullptr) { + if (tmpPhysics != null) { tmpPhysics->setGravity(vec3(0.0, 0.0, -9.81)); // generic earth gravity } @@ -106,7 +106,7 @@ void appl::Windows::init() { m_cameraControler.setCamera(m_camera); ememory::SharedPtr tmpWidget = ege::widget::Scene::create(); - if (tmpWidget == nullptr) { + if (tmpWidget == null) { APPL_CRITICAL("Can not allocate widget ==> display might be in error"); } else { tmpWidget->setEnv(m_env); @@ -119,7 +119,7 @@ void appl::Windows::init() { ememory::SharedPtr myMesh; // Create an external box: (no physics) myMesh = createViewBoxStar(); - if (myMesh != nullptr) { + if (myMesh != null) { ememory::SharedPtr entity = ememory::makeShared(m_env); // 1st Position component: etk::Transform3D transform(vec3(0,0,0), etk::Quaternion::identity()); @@ -133,7 +133,7 @@ void appl::Windows::init() { } // create basic gird: (no physics) myMesh = ege::resource::Mesh::createGrid(10, vec3(0,0,0), 5); - if (myMesh != nullptr) { + if (myMesh != null) { ememory::SharedPtr entity = ememory::makeShared(m_env); // 1st Position component: etk::Transform3D transform(vec3(0,0,0), etk::Quaternion::identity()); @@ -148,7 +148,7 @@ void appl::Windows::init() { // create cubes (surface) (the colision is bigger than the display) myMesh = ege::resource::Mesh::createCube(vec3(50,50,10), "basics", etk::color::green); - if (myMesh != nullptr) { + if (myMesh != null) { ememory::SharedPtr entity = ememory::makeShared(m_env); // add all component: // 1st Position component: @@ -171,7 +171,7 @@ void appl::Windows::init() { // create cubes that will move... myMesh = ege::resource::Mesh::createCube(vec3(5,5,5), "basics", etk::color::yellow); - if (myMesh != nullptr) { + if (myMesh != null) { ememory::SharedPtr entity = ememory::makeShared(m_env); // add all component: // 1st Position component: @@ -201,7 +201,7 @@ bool appl::Windows::onEventEntry(const ewol::event::Entry& _event) { } if(_event.getType() == gale::key::keyboard::character ) { ememory::SharedPtr physic = ememory::dynamicPointerCast(m_entity->getComponent("physics")); - if (physic == nullptr) { + if (physic == null) { APPL_ERROR("Can not get the component"); return false; } @@ -264,14 +264,14 @@ bool appl::Windows::onEventInput(const ewol::event::Input& _event) { if (_event.getId() == 2) { if (_event.getStatus() == gale::key::status::down) { ememory::SharedPtr physic = ememory::dynamicPointerCast(m_entity->getComponent("physics")); - if (physic == nullptr) { + if (physic == null) { APPL_ERROR("Can not get the component"); return false; } physic->applyForceToCenterOfMass(vec3(0,0,10000000), true); } else if (_event.getStatus() == gale::key::status::up) { ememory::SharedPtr physic = ememory::dynamicPointerCast(m_entity->getComponent("physics")); - if (physic == nullptr) { + if (physic == null) { APPL_ERROR("Can not get the component"); return false; } @@ -281,7 +281,7 @@ bool appl::Windows::onEventInput(const ewol::event::Input& _event) { if (_event.getId() == 1) { if (_event.getStatus() == gale::key::status::down) { ememory::SharedPtr physic = ememory::dynamicPointerCast(m_entity->getComponent("physics")); - if (physic == nullptr) { + if (physic == null) { APPL_ERROR("Can not get the component"); return false; } @@ -289,7 +289,7 @@ bool appl::Windows::onEventInput(const ewol::event::Input& _event) { physic->applyRelativeTorque(vec3(0,0,10000000), true); } else if (_event.getStatus() == gale::key::status::up) { ememory::SharedPtr physic = ememory::dynamicPointerCast(m_entity->getComponent("physics")); - if (physic == nullptr) { + if (physic == null) { APPL_ERROR("Can not get the component"); return false; } @@ -304,7 +304,7 @@ bool appl::Windows::onEventInput(const ewol::event::Input& _event) { ememory::SharedPtr myMesh; myMesh = ege::resource::Mesh::createCube(1, "basics", etk::color::orange); - if (myMesh != nullptr) { + if (myMesh != null) { ememory::SharedPtr entity = ememory::makeShared(m_env); // add all component: // 1st Position component: