diff --git a/ege/AudioElement.cpp b/ege/AudioElement.cpp index 8991c8f..92fb6a2 100644 --- a/ege/AudioElement.cpp +++ b/ege/AudioElement.cpp @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #include diff --git a/ege/AudioElement.h b/ege/AudioElement.h index 545099c..c6668d4 100644 --- a/ege/AudioElement.h +++ b/ege/AudioElement.h @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #pragma once diff --git a/ege/AudioEngine.cpp b/ege/AudioEngine.cpp index 61c5c1a..71006f5 100644 --- a/ege/AudioEngine.cpp +++ b/ege/AudioEngine.cpp @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #include diff --git a/ege/AudioEngine.h b/ege/AudioEngine.h index a071632..22ddbe5 100644 --- a/ege/AudioEngine.h +++ b/ege/AudioEngine.h @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #pragma once diff --git a/ege/CollisionShapeCreator.cpp b/ege/CollisionShapeCreator.cpp index c2f0f19..072a00d 100644 --- a/ege/CollisionShapeCreator.cpp +++ b/ege/CollisionShapeCreator.cpp @@ -1,10 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) - * + * @license APACHE v2.0 (see license file) */ #include @@ -25,11 +22,8 @@ // Documentetion of bullet library : // http://bulletphysics.org/mediawiki-1.5.8/index.php/Collision_Shapes -#undef __class__ -#define __class__ "CollisionShapeCreator" - btCollisionShape* ege::collision::createShape(const std::shared_ptr& _mesh) { - if (nullptr == _mesh) { + if (_mesh == nullptr) { EGE_DEBUG("Create empty shape (no mesh)"); return new btEmptyShape();; } @@ -40,7 +34,7 @@ btCollisionShape* ege::collision::createShape(const std::shared_ptrgetType()) { case ege::PhysicsShape::box : { EGE_DEBUG(" Box"); const ege::PhysicsBox* tmpElement = physiqueProperty[iii]->toBox(); - if (nullptr == tmpElement) { + if (tmpElement == nullptr) { // ERROR ... continue; } btCollisionShape* tmpShape = new btBoxShape(tmpElement->getSize()); - if (nullptr != tmpShape) { + if (tmpShape != nullptr) { if (outputShape == nullptr) { return tmpShape; } else { @@ -79,12 +73,12 @@ btCollisionShape* ege::collision::createShape(const std::shared_ptrtoCylinder(); - if (nullptr == tmpElement) { + if (tmpElement == nullptr) { // ERROR ... continue; } btCollisionShape* tmpShape = new btCylinderShape(tmpElement->getSize()); - if (nullptr != tmpShape) { + if (tmpShape != nullptr) { if (outputShape == nullptr) { return tmpShape; } else { @@ -98,12 +92,12 @@ btCollisionShape* ege::collision::createShape(const std::shared_ptrtoCapsule(); - if (nullptr == tmpElement) { + if (tmpElement == nullptr) { // ERROR ... continue; } btCollisionShape* tmpShape = new btCapsuleShape(tmpElement->getRadius(), tmpElement->getHeight()); - if (nullptr != tmpShape) { + if (tmpShape != nullptr) { if (outputShape == nullptr) { return tmpShape; } else { @@ -117,12 +111,12 @@ btCollisionShape* ege::collision::createShape(const std::shared_ptrtoCone(); - if (nullptr == tmpElement) { + if (tmpElement == nullptr) { // ERROR ... continue; } btCollisionShape* tmpShape = new btConeShape(tmpElement->getRadius(), tmpElement->getHeight()); - if (nullptr != tmpShape) { + if (tmpShape != nullptr) { if (outputShape == nullptr) { return tmpShape; } else { @@ -136,12 +130,12 @@ btCollisionShape* ege::collision::createShape(const std::shared_ptrtoSphere(); - if (nullptr == tmpElement) { + if (tmpElement == nullptr) { // ERROR ... continue; } btCollisionShape* tmpShape = new btSphereShape(tmpElement->getRadius()); - if (nullptr != tmpShape) { + if (tmpShape != nullptr) { if (outputShape == nullptr) { return tmpShape; } else { @@ -155,12 +149,12 @@ btCollisionShape* ege::collision::createShape(const std::shared_ptrtoConvexHull(); - if (nullptr == tmpElement) { + if (tmpElement == nullptr) { // ERROR ... continue; } btConvexHullShape* tmpShape = new btConvexHullShape(&(tmpElement->getPointList()[0].x()), tmpElement->getPointList().size()); - if (nullptr != tmpShape) { + if (tmpShape != nullptr) { if (outputShape == nullptr) { return tmpShape; } else { @@ -177,7 +171,7 @@ btCollisionShape* ege::collision::createShape(const std::shared_ptr @@ -26,10 +24,6 @@ #include #include -#undef __class__ -#define __class__ "Environement" - - std::shared_ptr ege::Environement::getElementNearest(std::shared_ptr _sourceRequest, float& _distance) { if (_sourceRequest == nullptr) { return nullptr; @@ -71,7 +65,7 @@ void ege::Environement::getElementNearest(const vec3& _sourcePosition, for (size_t iii=0; iii ege::Environement::createElement(const std::string EGE_ERROR("allocation error '" << _type << "'"); return nullptr; } - if (false == tmpElement->initString(_description)) { + if (tmpElement->initString(_description) == false) { EGE_ERROR("Init error ... '" << _type << "'"); return nullptr; } @@ -181,7 +175,7 @@ std::shared_ptr ege::Environement::createElement(const std::string EGE_ERROR("allocation error '" << _type << "'"); return nullptr; } - if (false == tmpElement->initJSON(_value)) { + if (tmpElement->initJSON(_value) == false) { EGE_ERROR("Init error ... '" << _type << "'"); return nullptr; } @@ -206,7 +200,7 @@ std::shared_ptr ege::Environement::createElement(const std::string EGE_ERROR("allocation error '" << _type << "'"); return nullptr; } - if (false == tmpElement->initXML(_node)) { + if (tmpElement->initXML(_node) == false) { EGE_ERROR("Init error ... '" << _type << "'"); return nullptr; } @@ -231,7 +225,7 @@ std::shared_ptr ege::Environement::createElement(const std::string EGE_ERROR("allocation error '" << _type << "'"); return nullptr; } - if (false == tmpElement->initVoid(_data)) { + if (tmpElement->initVoid(_data) == false) { EGE_ERROR("Init error ... '" << _type << "'"); return nullptr; } @@ -256,7 +250,7 @@ std::shared_ptr ege::Environement::createElement(const std::string EGE_ERROR("allocation error '" << _type << "'"); return nullptr; } - if (false == tmpElement->init()) { + if (tmpElement->init() == false) { EGE_ERROR("Init error ... '" << _type << "'"); return nullptr; } @@ -317,7 +311,7 @@ void ege::Environement::getOrderedElementForDisplay(std::vector this permit to keep pointer on elements ... for (size_t iii=0; iii @@ -28,7 +26,7 @@ ege::Light::~Light() { } void ege::Light::link(const std::shared_ptr& _prog, const std::string& _baseName) { - if (nullptr == _prog) { + if (_prog == nullptr) { return; } m_GL_direction = _prog->getUniform(_baseName+".direction"); diff --git a/ege/Light.h b/ege/Light.h index e4061b5..5f13d11 100644 --- a/ege/Light.h +++ b/ege/Light.h @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #pragma once diff --git a/ege/Material.cpp b/ege/Material.cpp index 6db36a0..cafbf92 100644 --- a/ege/Material.cpp +++ b/ege/Material.cpp @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #include @@ -20,7 +18,7 @@ ege::MaterialGlId::MaterialGlId() : } void ege::MaterialGlId::link(const std::shared_ptr& _prog, const std::string& _baseName) { - if (nullptr == _prog) { + if (_prog == nullptr) { return; } m_GL_ambientFactor = _prog->getUniform(_baseName+".ambientFactor"); @@ -45,12 +43,14 @@ ege::Material::~Material() { } void ege::Material::draw(const std::shared_ptr& _prog, const MaterialGlId& _glID) { + EGE_INFO("draw Material : (start)"); _prog->uniform4(_glID.m_GL_ambientFactor, m_ambientFactor); _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 (nullptr != m_texture0) { - _prog->setTexture0(_glID.m_GL_texture0, m_texture0->getId()); + if (m_texture0 != nullptr) { + EGE_INFO(" set texture: " << _glID.m_GL_texture0 << " " << m_texture0->getId()); + _prog->setTexture0(_glID.m_GL_texture0, m_texture0->getRendererId()); #if DEBUG if (_prog->checkIdValidity(_glID.m_GL_texture0) == false) { EGE_ERROR("try to set texture on a unexistant shader interface (wrong ID)"); @@ -63,6 +63,7 @@ void ege::Material::draw(const std::shared_ptr& _prog, } #endif } + EGE_INFO("draw Material: ( end )"); } void ege::Material::setTexture0(const std::string& _filename) { diff --git a/ege/Material.h b/ege/Material.h index e0cc112..bbd2a06 100644 --- a/ege/Material.h +++ b/ege/Material.h @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #pragma once diff --git a/ege/Particule.cpp b/ege/Particule.cpp index 8cea63d..49df96e 100644 --- a/ege/Particule.cpp +++ b/ege/Particule.cpp @@ -1,18 +1,13 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #include #include #include -#undef __class__ -#define __class__ "Particule" - ege::Particule::Particule(ege::ParticuleEngine* _particuleEngine, const char* _particuleType) : m_particuleEngine(_particuleEngine), m_particuleType(_particuleType) { diff --git a/ege/Particule.h b/ege/Particule.h index b15ae2b..6a2d436 100644 --- a/ege/Particule.h +++ b/ege/Particule.h @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #pragma once diff --git a/ege/ParticuleEngine.cpp b/ege/ParticuleEngine.cpp index 84573ca..c0043be 100644 --- a/ege/ParticuleEngine.cpp +++ b/ege/ParticuleEngine.cpp @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #include @@ -11,9 +9,6 @@ #include #include -#undef __class__ -#define __class__ "ParticuleEngine" - ege::ParticuleEngine::ParticuleEngine(ege::Environement* _env) : m_env(_env) { diff --git a/ege/ParticuleEngine.h b/ege/ParticuleEngine.h index af7758e..05cef1d 100644 --- a/ege/ParticuleEngine.h +++ b/ege/ParticuleEngine.h @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #pragma once namespace ege { diff --git a/ege/ParticuleSimple.cpp b/ege/ParticuleSimple.cpp index d8b3fa2..306bbd4 100644 --- a/ege/ParticuleSimple.cpp +++ b/ege/ParticuleSimple.cpp @@ -1,23 +1,17 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #include #include -#undef __class__ -#define __class__ "ParticuleSimple" - ege::ParticuleSimple::ParticuleSimple(ege::ParticuleEngine* _particuleEngine, const char* _particuleType) : Particule(_particuleEngine, _particuleType) { init(); } - void ege::ParticuleSimple::init() { m_lifeFull = 3; m_life = m_lifeFull; diff --git a/ege/ParticuleSimple.h b/ege/ParticuleSimple.h index e5a180d..964a967 100644 --- a/ege/ParticuleSimple.h +++ b/ege/ParticuleSimple.h @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #pragma once diff --git a/ege/Ray.cpp b/ege/Ray.cpp index b06a771..84bdbc1 100644 --- a/ege/Ray.cpp +++ b/ege/Ray.cpp @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #include #include @@ -13,9 +11,6 @@ #include #include -#undef __class__ -#define __class__ "Ray" - ege::Ray::Ray(const vec3& _origin, const vec3& _direction) : m_origin(_origin), m_direction(_direction) { diff --git a/ege/Ray.h b/ege/Ray.h index 6a5c9d6..8566d53 100644 --- a/ege/Ray.h +++ b/ege/Ray.h @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #pragma once diff --git a/ege/camera/Camera.cpp b/ege/camera/Camera.cpp index a596495..a4695a4 100644 --- a/ege/camera/Camera.cpp +++ b/ege/camera/Camera.cpp @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2013, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ @@ -12,9 +10,6 @@ #include -#undef __class__ -#define __class__ "Camera" - ege::Camera::Camera() : m_aspectRatio(0.5), m_angleView(M_PI/3.0), diff --git a/ege/camera/Camera.h b/ege/camera/Camera.h index 24f7cba..72bdf01 100644 --- a/ege/camera/Camera.h +++ b/ege/camera/Camera.h @@ -1,14 +1,11 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2013, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #pragma once - #include #include #include diff --git a/ege/camera/View.cpp b/ege/camera/View.cpp index fc604f9..0880115 100644 --- a/ege/camera/View.cpp +++ b/ege/camera/View.cpp @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2013, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ @@ -11,9 +9,6 @@ #include #include -#undef __class__ -#define __class__ "camera::View" - void ege::camera::View::update() { //m_matrix = etk::matLookAt(m_eye, m_target, m_up); //m_matrix.translate(m_eye); diff --git a/ege/camera/View.h b/ege/camera/View.h index 2d56301..c5034f8 100644 --- a/ege/camera/View.h +++ b/ege/camera/View.h @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2013, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #pragma once diff --git a/ege/debug.cpp b/ege/debug.cpp index 8eeca56..8cbc451 100644 --- a/ege/debug.cpp +++ b/ege/debug.cpp @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #include diff --git a/ege/debug.h b/ege/debug.h index 95ba113..f611f49 100644 --- a/ege/debug.h +++ b/ege/debug.h @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #pragma once diff --git a/ege/elements/Element.cpp b/ege/elements/Element.cpp index b9f58f8..6864e66 100644 --- a/ege/elements/Element.cpp +++ b/ege/elements/Element.cpp @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #include @@ -80,7 +78,7 @@ bool ege::Element::unInit() { bool ege::Element::loadMesh(const std::string& _meshFileName) { std::shared_ptr tmpMesh = ege::resource::Mesh::create(_meshFileName); - if(nullptr == tmpMesh) { + if(tmpMesh == nullptr) { EGE_ERROR("can not load the resources : " << _meshFileName); return false; } @@ -88,7 +86,7 @@ bool ege::Element::loadMesh(const std::string& _meshFileName) { } bool ege::Element::setMesh(const std::shared_ptr& _mesh) { - if (nullptr!=m_mesh) { + if (m_mesh != nullptr) { m_mesh.reset(); } m_mesh = _mesh; @@ -114,7 +112,7 @@ void ege::Element::setFireOn(int32_t _groupIdSource, int32_t _type, float _power if (m_life <= 0) { EGE_DEBUG("[" << getUID() << "] element is killed ..." << getType()); } - if (m_life!=previousLife) { + if (m_life != previousLife) { onLifeChange(); } } @@ -132,7 +130,7 @@ const float lifeWidth = 2.0f; const float lifeYPos = 1.7f; void ege::Element::drawLife(const std::shared_ptr& _draw, const std::shared_ptr& _camera) { - if (nullptr == _draw) { + if (_draw == nullptr) { return; } float ratio = getLifeRatio(); diff --git a/ege/elements/Element.h b/ege/elements/Element.h index 0c7f434..040df27 100644 --- a/ege/elements/Element.h +++ b/ege/elements/Element.h @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #pragma once diff --git a/ege/elements/ElementBase.cpp b/ege/elements/ElementBase.cpp index 961ea74..c51c8ca 100644 --- a/ege/elements/ElementBase.cpp +++ b/ege/elements/ElementBase.cpp @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ diff --git a/ege/elements/ElementBase.h b/ege/elements/ElementBase.h index c78659a..71657be 100644 --- a/ege/elements/ElementBase.h +++ b/ege/elements/ElementBase.h @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #pragma once diff --git a/ege/elements/ElementPhysic.cpp b/ege/elements/ElementPhysic.cpp index 0893ecc..ca0c46e 100644 --- a/ege/elements/ElementPhysic.cpp +++ b/ege/elements/ElementPhysic.cpp @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #include @@ -25,9 +23,6 @@ #include -#undef __class__ -#define __class__ "ElementPhysic" - const std::string& ege::ElementPhysic::getType() const { static const std::string nameType("----"); return nameType; @@ -117,7 +112,7 @@ bool ege::ElementPhysic::setShape(btCollisionShape* _shape) { void ege::ElementPhysic::removeShape() { // no shape - if (nullptr == m_shape) { + if (m_shape == nullptr) { return; } // need to chek if the shape is the same as the mesh shape ... diff --git a/ege/elements/ElementPhysic.h b/ege/elements/ElementPhysic.h index 1dded7d..a8b7c5b 100644 --- a/ege/elements/ElementPhysic.h +++ b/ege/elements/ElementPhysic.h @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #pragma once diff --git a/ege/physics/Engine.cpp b/ege/physics/Engine.cpp index b985dec..9f78849 100644 --- a/ege/physics/Engine.cpp +++ b/ege/physics/Engine.cpp @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #include diff --git a/ege/physics/Engine.h b/ege/physics/Engine.h index 1836375..528efe0 100644 --- a/ege/physics/Engine.h +++ b/ege/physics/Engine.h @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #pragma once diff --git a/ege/physicsShape/PhysicsBox.cpp b/ege/physicsShape/PhysicsBox.cpp index 560edc4..660ac7f 100644 --- a/ege/physicsShape/PhysicsBox.cpp +++ b/ege/physicsShape/PhysicsBox.cpp @@ -1,20 +1,17 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #include #include - bool ege::PhysicsBox::parse(const char* _line) { - if (true == ege::PhysicsShape::parse(_line)) { + if (ege::PhysicsShape::parse(_line) == true) { return true; } - if(0 == strncmp(_line, "half-extents : ", 15) ) { + if(strncmp(_line, "half-extents : ", 15) == 0) { sscanf(&_line[15], "%f %f %f", &m_size.m_floats[0], &m_size.m_floats[1], &m_size.m_floats[2] ); EGE_VERBOSE(" halfSize=" << m_size); return true; diff --git a/ege/physicsShape/PhysicsBox.h b/ege/physicsShape/PhysicsBox.h index 6669714..c544902 100644 --- a/ege/physicsShape/PhysicsBox.h +++ b/ege/physicsShape/PhysicsBox.h @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #pragma once diff --git a/ege/physicsShape/PhysicsCapsule.cpp b/ege/physicsShape/PhysicsCapsule.cpp index fab3685..828383d 100644 --- a/ege/physicsShape/PhysicsCapsule.cpp +++ b/ege/physicsShape/PhysicsCapsule.cpp @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #include #include @@ -11,15 +9,15 @@ bool ege::PhysicsCapsule::parse(const char* _line) { - if (true == ege::PhysicsShape::parse(_line)) { + if (ege::PhysicsShape::parse(_line) == true) { return true; } - if(0 == strncmp(_line, "radius : ", 9) ) { + if(strncmp(_line, "radius : ", 9) == 0) { sscanf(&_line[9], "%f", &m_radius ); EGE_VERBOSE(" radius=" << m_radius); return true; } - if(0 == strncmp(_line, "height : ", 9) ) { + if(strncmp(_line, "height : ", 9) == 0) { sscanf(&_line[9], "%f", &m_height ); EGE_VERBOSE(" height=" << m_height); return true; diff --git a/ege/physicsShape/PhysicsCapsule.h b/ege/physicsShape/PhysicsCapsule.h index 9312569..1e4fb21 100644 --- a/ege/physicsShape/PhysicsCapsule.h +++ b/ege/physicsShape/PhysicsCapsule.h @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #pragma once diff --git a/ege/physicsShape/PhysicsCone.cpp b/ege/physicsShape/PhysicsCone.cpp index ff10fdb..0e950e3 100644 --- a/ege/physicsShape/PhysicsCone.cpp +++ b/ege/physicsShape/PhysicsCone.cpp @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #include #include @@ -11,15 +9,15 @@ bool ege::PhysicsCone::parse(const char* _line) { - if (true == ege::PhysicsShape::parse(_line)) { + if (ege::PhysicsShape::parse(_line) == true) { return true; } - if(0 == strncmp(_line, "radius : ", 9) ) { + if(strncmp(_line, "radius : ", 9) == 0) { sscanf(&_line[9], "%f", &m_radius ); EGE_VERBOSE(" radius=" << m_radius); return true; } - if(0 == strncmp(_line, "height : ", 9) ) { + if(strncmp(_line, "height : ", 9) == 0) { sscanf(&_line[9], "%f", &m_height ); EGE_VERBOSE(" height=" << m_height); return true; diff --git a/ege/physicsShape/PhysicsCone.h b/ege/physicsShape/PhysicsCone.h index 3537f04..79c5e7b 100644 --- a/ege/physicsShape/PhysicsCone.h +++ b/ege/physicsShape/PhysicsCone.h @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #pragma once diff --git a/ege/physicsShape/PhysicsConvexHull.cpp b/ege/physicsShape/PhysicsConvexHull.cpp index 6ecc616..c9400a6 100644 --- a/ege/physicsShape/PhysicsConvexHull.cpp +++ b/ege/physicsShape/PhysicsConvexHull.cpp @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #include #include @@ -11,10 +9,10 @@ bool ege::PhysicsConvexHull::parse(const char* _line) { - if (true == ege::PhysicsShape::parse(_line)) { + if (ege::PhysicsShape::parse(_line) == true) { return true; } - if(0 == strncmp(_line, "points : ", 8) ) { + if(strncmp(_line, "points : ", 8) == 0) { //EGE_DEBUG("convex hull point parsing " << _line); char* base = (char*)(&_line[8]); char* tmp= strchr(base, '|'); @@ -35,7 +33,7 @@ bool ege::PhysicsConvexHull::parse(const char* _line) { */ return true; } - if(0 == strncmp(_line, "scale : ", 8) ) { + if(strncmp(_line, "scale : ", 8) == 0) { sscanf(&_line[8], "%f %f %f", &m_scale.m_floats[0], &m_scale.m_floats[1], &m_scale.m_floats[2] ); EGE_VERBOSE(" scale=" << m_scale); return true; diff --git a/ege/physicsShape/PhysicsConvexHull.h b/ege/physicsShape/PhysicsConvexHull.h index bc838d0..a631314 100644 --- a/ege/physicsShape/PhysicsConvexHull.h +++ b/ege/physicsShape/PhysicsConvexHull.h @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #pragma once diff --git a/ege/physicsShape/PhysicsCylinder.cpp b/ege/physicsShape/PhysicsCylinder.cpp index 898750f..28bb27e 100644 --- a/ege/physicsShape/PhysicsCylinder.cpp +++ b/ege/physicsShape/PhysicsCylinder.cpp @@ -1,19 +1,17 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #include #include bool ege::PhysicsCylinder::parse(const char* _line) { - if (true == ege::PhysicsShape::parse(_line)) { + if (ege::PhysicsShape::parse(_line) == true) { return true; } - if(0 == strncmp(_line, "half-extents : ", 15) ) { + if(strncmp(_line, "half-extents : ", 15) == 0) { sscanf(&_line[15], "%f %f %f", &m_size.m_floats[0], &m_size.m_floats[1], &m_size.m_floats[2] ); EGE_VERBOSE(" halfSize=" << m_size); return true; diff --git a/ege/physicsShape/PhysicsCylinder.h b/ege/physicsShape/PhysicsCylinder.h index 38658d3..f2e35ee 100644 --- a/ege/physicsShape/PhysicsCylinder.h +++ b/ege/physicsShape/PhysicsCylinder.h @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #pragma once diff --git a/ege/physicsShape/PhysicsShape.cpp b/ege/physicsShape/PhysicsShape.cpp index 067ef2c..be604d1 100644 --- a/ege/physicsShape/PhysicsShape.cpp +++ b/ege/physicsShape/PhysicsShape.cpp @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #include #include @@ -42,12 +40,12 @@ std::shared_ptr ege::PhysicsShape::create(const std::string& bool ege::PhysicsShape::parse(const char* _line) { - if(0 == strncmp(_line, "origin : ", 9) ) { + if(strncmp(_line, "origin : ", 9) == 0) { sscanf(&_line[9], "%f %f %f", &m_origin.m_floats[0], &m_origin.m_floats[1], &m_origin.m_floats[2] ); EGE_VERBOSE(" Origin=" << m_origin); return true; } - if(0 == strncmp(_line, "rotate : ", 9) ) { + if(strncmp(_line, "rotate : ", 9) == 0) { sscanf(&_line[9], "%f %f %f %f", &m_quaternion.m_floats[0], &m_quaternion.m_floats[1], &m_quaternion.m_floats[2], &m_quaternion.m_floats[3] ); EGE_VERBOSE(" rotate=" << m_quaternion); return true; diff --git a/ege/physicsShape/PhysicsShape.h b/ege/physicsShape/PhysicsShape.h index 26ac09d..ba77004 100644 --- a/ege/physicsShape/PhysicsShape.h +++ b/ege/physicsShape/PhysicsShape.h @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #pragma once diff --git a/ege/physicsShape/PhysicsSphere.cpp b/ege/physicsShape/PhysicsSphere.cpp index ef402be..ed7d07d 100644 --- a/ege/physicsShape/PhysicsSphere.cpp +++ b/ege/physicsShape/PhysicsSphere.cpp @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #include #include @@ -11,10 +9,10 @@ bool ege::PhysicsSphere::parse(const char* _line) { - if (true == ege::PhysicsShape::parse(_line)) { + if (ege::PhysicsShape::parse(_line) == true) { return true; } - if(0 == strncmp(_line, "radius : ", 9) ) { + if(strncmp(_line, "radius : ", 9) == 0) { sscanf(&_line[9], "%f", &m_radius ); EGE_VERBOSE(" radius=" << m_radius); return true; diff --git a/ege/physicsShape/PhysicsSphere.h b/ege/physicsShape/PhysicsSphere.h index b607100..3fc564e 100644 --- a/ege/physicsShape/PhysicsSphere.h +++ b/ege/physicsShape/PhysicsSphere.h @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #pragma once diff --git a/ege/resource/Mesh.cpp b/ege/resource/Mesh.cpp index fe8bf7e..a8d7bbc 100644 --- a/ege/resource/Mesh.cpp +++ b/ege/resource/Mesh.cpp @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #include @@ -15,9 +13,6 @@ #include #include -#undef __class__ -#define __class__ "resource::Mesh" - ege::resource::Mesh::Mesh() : m_normalMode(normalModeNone), m_checkNormal(false), @@ -46,7 +41,7 @@ void ege::resource::Mesh::init(const std::string& _fileName, const std::string& m_light.setDiffuseColor(vec4(1.0f,1.0f,1.0f,1.0f)); m_light.setSpecularColor(vec4(0.0f,0.0f,0.0f,1.0f)); - //EGE_DEBUG(m_name << " " << m_light); + EGE_ERROR(m_name << " " << m_light << " shader=" << _shaderName); m_GLprogram = gale::resource::Program::create(_shaderName); if (m_GLprogram != nullptr) { m_GLPosition = m_GLprogram->getAttribute("EW_coord3d"); @@ -89,7 +84,7 @@ void ege::resource::Mesh::init(const std::string& _fileName, const std::string& ege::resource::Mesh::~Mesh() { // remove dynamics dependencies : - if (m_functionFreeShape!=nullptr) { + if (m_functionFreeShape != nullptr) { m_functionFreeShape(m_pointerShape); m_pointerShape = nullptr; } @@ -110,8 +105,12 @@ void ege::resource::Mesh::clean() { //#define DISPLAY_NB_VERTEX_DISPLAYED void ege::resource::Mesh::draw(mat4& _positionMatrix, - bool _enableDepthTest, - bool _enableDepthUpdate) { + bool _enableDepthTest, + bool _enableDepthUpdate) { + + // TODO : Remove this, it is just for test the 23-04-2016 + //m_checkNormal = false; + EGE_INFO("draw Mesh : " << m_name << " (start)"); if (m_GLprogram == nullptr) { EGE_ERROR("No shader ..."); return; @@ -159,7 +158,7 @@ void ege::resource::Mesh::draw(mat4& _positionMatrix, int32_t nbElementDraw = 0; #endif for (int32_t kkk=0; kkk auto generate Face normal .... calculateNormaleFace(m_listFaces.getKeys()[0]); } - EGE_WARNING("Generate VBO for nb faces : " << m_listFaces.size()); + EGE_WARNING("Generate VBO for nb faces layers: " << m_listFaces.size() << " list layer=" << etk::to_string(m_listFaces.getKeys())); // generate element in 2 pass : // - create new index dependeng a vertex is a unique componenet of position, texture, normal @@ -392,7 +392,7 @@ void ege::resource::Mesh::generateVBO() { } } #endif - if (false == elementFind) { + if (elementFind == false) { m_verticesVBO->pushOnBuffer(MESH_VBO_VERTICES, position); if (m_normalMode != normalModeNone) { m_verticesVBO->pushOnBuffer(MESH_VBO_VERTICES_NORMAL, normal); @@ -431,7 +431,7 @@ void ege::resource::Mesh::createIcoSphere(const std::string& _materialName,float void ege::resource::Mesh::addMaterial(const std::string& _name, std::shared_ptr _data) { - if (nullptr == _data) { + if (_data == nullptr) { EGE_ERROR(" can not add material with null pointer"); return; } @@ -554,6 +554,7 @@ void ege::resource::Mesh::addTriangle(const std::string& _layerName, const vec3& _pos1, const vec3& _pos2, const vec3& _pos3, const vec2& _uv1, const vec2& _uv2, const vec2& _uv3, const etk::Color& _color1, const etk::Color& _color2, const etk::Color& _color3) { + EGE_INFO("add Triangle: " << _layerName << " ..."); if ( m_listFaces.exist(_layerName) == false || m_materials.exist(_layerName) == false) { EGE_ERROR("Mesh layer : " << _layerName << " does not exist in list faces=" << m_listFaces.exist(_layerName) << " materials=" << m_listFaces.exist(_layerName) << " ..."); @@ -583,6 +584,7 @@ void ege::resource::Mesh::addTriangle(const std::string& _layerName, pos3, uv3); tmpFace.setColor(color1, color2, color3); m_listFaces[_layerName].m_faces.push_back(tmpFace); + EGE_INFO(" nbFace: " << m_listFaces[_layerName].m_faces.size()); } void ege::resource::Mesh::addTriangle(const std::string& _layerName, const vec3& _pos1, const vec3& _pos2, const vec3& _pos3, diff --git a/ege/resource/Mesh.h b/ege/resource/Mesh.h index 4d39f02..fc956cd 100644 --- a/ege/resource/Mesh.h +++ b/ege/resource/Mesh.h @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #pragma once diff --git a/ege/resource/MeshCube.cpp b/ege/resource/MeshCube.cpp index 67b51eb..98924c5 100644 --- a/ege/resource/MeshCube.cpp +++ b/ege/resource/MeshCube.cpp @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #include diff --git a/ege/resource/MeshEmf.cpp b/ege/resource/MeshEmf.cpp index 8d1018d..c47914b 100644 --- a/ege/resource/MeshEmf.cpp +++ b/ege/resource/MeshEmf.cpp @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #include @@ -150,16 +148,16 @@ bool ege::resource::Mesh::loadEMF(const std::string& _fileName) { EGE_ERROR("No data in the file named=\"" << fileName << "\""); return false; } - if(false == fileName.fileOpenRead() ) { + if (fileName.fileOpenRead() == false) { EGE_ERROR("Can not find the file name=\"" << fileName << "\""); return false; } char inputDataLine[2048]; // load the first line : fileName.fileGets(inputDataLine, 2048); - if(0 == strncmp(inputDataLine, "EMF(STRING)", 11)) { + if(strncmp(inputDataLine, "EMF(STRING)", 11) == 0) { // parse in string mode ... - } else if (0 == strncmp(inputDataLine, "EMF(BINARY)", 11)) { + } else if (strncmp(inputDataLine, "EMF(BINARY)", 11) == 0) { EGE_ERROR(" file binary mode is not supported now : 'EMF(BINARY)'"); return false; } else { @@ -176,18 +174,18 @@ bool ege::resource::Mesh::loadEMF(const std::string& _fileName) { std::shared_ptr material; // physical shape: std::shared_ptr physics; - while(1) { + while (1) { int32_t level = countIndent(fileName); if (level == 0) { // new section ... - if (nullptr == loadNextData(inputDataLine, 2048, fileName)) { + if (loadNextData(inputDataLine, 2048, fileName) == nullptr) { // reach end of file ... break; } - if(0 == strncmp(inputDataLine, "Mesh :", 6) ) { + if(strncmp(inputDataLine, "Mesh :", 6) == 0) { currentMode = EMFModuleMesh; EGE_VERBOSE("Parse Mesh :"); - } else if(0 == strncmp(inputDataLine, "Materials : ", 11) ) { + } else if(strncmp(inputDataLine, "Materials : ", 11) == 0) { currentMode = EMFModuleMaterial; EGE_VERBOSE("Parse Material :"); } else { @@ -197,7 +195,7 @@ bool ege::resource::Mesh::loadEMF(const std::string& _fileName) { if (currentMode >= EMFModuleMesh && currentMode <= EMFModuleMesh_END) { if (level == 1) { //Find mesh name ... - if (nullptr == loadNextData(inputDataLine, 2048, fileName, true)) { + if (loadNextData(inputDataLine, 2048, fileName, true) == nullptr) { // reach end of file ... break; } @@ -209,27 +207,27 @@ bool ege::resource::Mesh::loadEMF(const std::string& _fileName) { } if (level == 2) { // In the mesh level 2 the line size must not exced 2048 - if (nullptr == loadNextData(inputDataLine, 2048, fileName, true)) { + if (loadNextData(inputDataLine, 2048, fileName, true) == nullptr) { // reach end of file ... break; } removeEndLine(inputDataLine); - if(0 == strncmp(inputDataLine, "Vertex", 6) ) { + if(strncmp(inputDataLine, "Vertex", 6) == 0) { currentMode = EMFModuleMeshVertex; EGE_VERBOSE(" Vertex ..."); - } else if(0 == strncmp(inputDataLine, "UV-mapping", 10) ) { + } else if(strncmp(inputDataLine, "UV-mapping", 10) == 0) { currentMode = EMFModuleMeshUVMapping; EGE_VERBOSE(" UV-mapping ..."); - } else if(0 == strncmp(inputDataLine, "Normal(vertex)", 14) ) { + } else if(strncmp(inputDataLine, "Normal(vertex)", 14) == 0) { currentMode = EMFModuleMeshNormalVertex; EGE_VERBOSE(" Normal(vertex) ..."); - } else if(0 == strncmp(inputDataLine, "Normal(face)", 12) ) { + } else if(strncmp(inputDataLine, "Normal(face)", 12) == 0) { currentMode = EMFModuleMeshNormalFace; EGE_VERBOSE(" Normal(face) ..."); - } else if(0 == strncmp(inputDataLine, "Face", 4) ) { + } else if(strncmp(inputDataLine, "Face", 4) == 0) { currentMode = EMFModuleMeshFace; EGE_VERBOSE(" Face ..."); - } else if(0 == strncmp(inputDataLine, "Physics", 7) ) { + } else if(strncmp(inputDataLine, "Physics", 7) == 0) { currentMode = EMFModuleMeshPhysics; EGE_VERBOSE(" Physics ..."); } else { @@ -246,7 +244,7 @@ bool ege::resource::Mesh::loadEMF(const std::string& _fileName) { break; case EMFModuleMeshVertex: { vec3 vertex(0,0,0); - while (nullptr != loadNextData(inputDataLine, 2048, fileName, true, true) ) { + while (loadNextData(inputDataLine, 2048, fileName, true, true) != nullptr) { if (inputDataLine[0] == '\0') { break; } @@ -263,7 +261,7 @@ bool ege::resource::Mesh::loadEMF(const std::string& _fileName) { } case EMFModuleMeshUVMapping: { vec2 uvMap(0,0); - while (nullptr != loadNextData(inputDataLine, 2048, fileName, true, true) ) { + while (loadNextData(inputDataLine, 2048, fileName, true, true) != nullptr) { if (inputDataLine[0] == '\0') { break; } @@ -282,7 +280,7 @@ bool ege::resource::Mesh::loadEMF(const std::string& _fileName) { m_normalMode = normalModeVertex; vec3 normal(0,0,0); // find the vertex Normal list. - while (nullptr != loadNextData(inputDataLine, 2048, fileName, true, true) ) { + while (loadNextData(inputDataLine, 2048, fileName, true, true) != nullptr) { if (inputDataLine[0] == '\0') { break; } @@ -301,7 +299,7 @@ bool ege::resource::Mesh::loadEMF(const std::string& _fileName) { m_normalMode = normalModeFace; vec3 normal(0,0,0); // find the face Normal list. - while (nullptr != loadNextData(inputDataLine, 2048, fileName, true, true) ) { + while (loadNextData(inputDataLine, 2048, fileName, true, true) != nullptr) { if (inputDataLine[0] == '\0') { break; } @@ -320,7 +318,7 @@ bool ege::resource::Mesh::loadEMF(const std::string& _fileName) { case EMFModuleMeshFaceMaterial: if (level == 3) { //Find mesh name ... - if (nullptr == loadNextData(inputDataLine, 2048, fileName, true)) { + if (loadNextData(inputDataLine, 2048, fileName, true) == nullptr) { // reach end of file ... break; } @@ -332,7 +330,7 @@ bool ege::resource::Mesh::loadEMF(const std::string& _fileName) { meshFaceMaterialID = m_listFaces.getId(inputDataLine); EGE_VERBOSE(" " << inputDataLine); } else if (currentMode == EMFModuleMeshFaceMaterial) { - while (nullptr != loadNextData(inputDataLine, 2048, fileName, true, true) ) { + while (loadNextData(inputDataLine, 2048, fileName, true, true) != nullptr) { if (inputDataLine[0] == '\0') { // end of line break; @@ -377,7 +375,7 @@ bool ege::resource::Mesh::loadEMF(const std::string& _fileName) { break; case EMFModuleMeshPhysics: case EMFModuleMeshPhysicsNamed: - if (nullptr == loadNextData(inputDataLine, 2048, fileName, true, false, false)) { + if (loadNextData(inputDataLine, 2048, fileName, true, false, false) == nullptr) { // reach end of file ... break; } @@ -396,7 +394,7 @@ bool ege::resource::Mesh::loadEMF(const std::string& _fileName) { EGE_ERROR("Can not parse :'" << inputDataLine << "' in physical shape ..."); continue; } - if (false == physics->parse(inputDataLine)) { + if (physics->parse(inputDataLine) == false) { EGE_ERROR("ERROR when parsing :'" << inputDataLine << "' in physical shape ..."); } } @@ -405,7 +403,7 @@ bool ege::resource::Mesh::loadEMF(const std::string& _fileName) { continue; } else if (currentMode >= EMFModuleMaterial && currentMode <= EMFModuleMaterial_END) { // all material element is stored on 1 line (size < 2048) - if (nullptr == loadNextData(inputDataLine, 2048, fileName, true)) { + if (loadNextData(inputDataLine, 2048, fileName, true) == nullptr) { // reach end of file ... break; } @@ -413,7 +411,7 @@ bool ege::resource::Mesh::loadEMF(const std::string& _fileName) { if (level == 1) { // add previous material : if( materialName != "" - && material!=nullptr) { + && material != nullptr) { m_materials.add(materialName, material); materialName = ""; material = nullptr; @@ -430,17 +428,17 @@ bool ege::resource::Mesh::loadEMF(const std::string& _fileName) { jumpEndLine(fileName); continue; } - if (nullptr == material) { + if (material == nullptr) { EGE_ERROR("material allocation error"); jumpEndLine(fileName); continue; } - if(0 == strncmp(inputDataLine,"Ns ",3)) { + if(strncmp(inputDataLine,"Ns ",3) == 0) { float tmpVal=0; sscanf(&inputDataLine[3], "%f", &tmpVal); material->setShininess(tmpVal); EGE_VERBOSE(" Shininess " << tmpVal); - } else if(0 == strncmp(inputDataLine,"Ka ",3)) { + } else if(strncmp(inputDataLine,"Ka ",3) == 0) { float tmpVal1=0; float tmpVal2=0; float tmpVal3=0; @@ -448,7 +446,7 @@ bool ege::resource::Mesh::loadEMF(const std::string& _fileName) { vec4 tmp(tmpVal1, tmpVal2, tmpVal3, 1); material->setAmbientFactor(tmp); EGE_VERBOSE(" AmbientFactor " << tmp); - } else if(0 == strncmp(inputDataLine,"Kd ",3)) { + } else if(strncmp(inputDataLine,"Kd ",3) == 0) { float tmpVal1=0; float tmpVal2=0; float tmpVal3=0; @@ -456,7 +454,7 @@ bool ege::resource::Mesh::loadEMF(const std::string& _fileName) { vec4 tmp(tmpVal1, tmpVal2, tmpVal3, 1); material->setDiffuseFactor(tmp); EGE_VERBOSE(" DiffuseFactor " << tmp); - } else if(0 == strncmp(inputDataLine,"Ks ",3)) { + } else if(strncmp(inputDataLine,"Ks ",3) == 0) { float tmpVal1=0; float tmpVal2=0; float tmpVal3=0; @@ -464,25 +462,25 @@ bool ege::resource::Mesh::loadEMF(const std::string& _fileName) { vec4 tmp(tmpVal1, tmpVal2, tmpVal3, 1); material->setSpecularFactor(tmp); EGE_VERBOSE(" SpecularFactor " << tmp); - } else if(0 == strncmp(inputDataLine,"Ni ",3)) { + } else if(strncmp(inputDataLine,"Ni ",3) == 0) { float tmpVal=0; sscanf(&inputDataLine[3], "%f", &tmpVal); // TODO : ... EGE_VERBOSE(" Ni " << tmpVal); - } else if(0 == strncmp(inputDataLine,"d ",2)) { + } else if(strncmp(inputDataLine,"d ",2) == 0) { float tmpVal=0; sscanf(&inputDataLine[2], "%f", &tmpVal); // TODO : ... EGE_VERBOSE(" d " << tmpVal); - } else if(0 == strncmp(inputDataLine,"illum ",6)) { + } else if(strncmp(inputDataLine,"illum ",6) == 0) { int tmpVal=0; sscanf(&inputDataLine[6], "%d", &tmpVal); // TODO : ... EGE_VERBOSE(" illum " << tmpVal); - } else if(0 == strncmp(inputDataLine,"map_Kd ",7)) { + } else if(strncmp(inputDataLine,"map_Kd ",7) == 0) { material->setTexture0(fileName.getRelativeFolder() + &inputDataLine[7]); EGE_VERBOSE(" Texture " << &inputDataLine[7]); - } else if(0 == strncmp(inputDataLine,"renderMode ",11)) { + } else if(strncmp(inputDataLine,"renderMode ",11) == 0) { gale::openGL::renderMode mode; etk::from_string(mode, &inputDataLine[11]); material->setRenderMode(mode); @@ -499,7 +497,7 @@ bool ege::resource::Mesh::loadEMF(const std::string& _fileName) { } // add last material ... if( materialName != "" - && material!=nullptr) { + && material != nullptr) { m_materials.add(materialName, material); materialName = ""; material.reset(); diff --git a/ege/resource/MeshGird.cpp b/ege/resource/MeshGird.cpp index ece9d42..e3e3bde 100644 --- a/ege/resource/MeshGird.cpp +++ b/ege/resource/MeshGird.cpp @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #include diff --git a/ege/resource/MeshObj.cpp b/ege/resource/MeshObj.cpp index 1c6a40d..76b8969 100644 --- a/ege/resource/MeshObj.cpp +++ b/ege/resource/MeshObj.cpp @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #include @@ -20,14 +18,14 @@ bool ege::resource::Mesh::loadOBJ(const std::string& _fileName) { EGE_ERROR("No data in the file named=\"" << fileName << "\""); return false; } - if(false == fileName.fileOpenRead() ) { + if (fileName.fileOpenRead() == false) { EGE_ERROR("Can not find the file name=\"" << fileName << "\""); return false; } char inputDataLine[2048]; int32_t lineID = 0; - while (nullptr != fileName.fileGets(inputDataLine, 2048) ) + while (fileName.fileGets(inputDataLine, 2048) != nullptr) { lineID++; if (inputDataLine[0] == 'v') { @@ -81,7 +79,7 @@ bool ege::resource::Mesh::loadOBJ(const std::string& _fileName) { } } } - if (true == quadMode) { + if (quadMode == true) { m_listFaces.push_back(Face(vertexIndex[0]-1, uvIndex[0]-1, vertexIndex[1]-1, uvIndex[1]-1, vertexIndex[2]-1, uvIndex[2]-1, diff --git a/ege/resource/ParticuleMesh.cpp b/ege/resource/ParticuleMesh.cpp index 2226f3a..d0452e0 100644 --- a/ege/resource/ParticuleMesh.cpp +++ b/ege/resource/ParticuleMesh.cpp @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #include @@ -38,7 +36,7 @@ void ege::resource::ParticuleMesh::draw(mat4& _positionMatrix, //EGE_DEBUG(m_name << " " << m_light); if (_enableDepthTest == true) { gale::openGL::enable(gale::openGL::flag_depthTest); - if (false == _enableDepthUpdate) { + if (_enableDepthUpdate == false) { glDepthMask(GL_FALSE); } } else { @@ -67,7 +65,7 @@ void ege::resource::ParticuleMesh::draw(mat4& _positionMatrix, int32_t nbElementDraw = 0; #endif for (int32_t kkk=0; kkkunUse(); if (_enableDepthTest == true){ - if (false == _enableDepthUpdate) { + if (_enableDepthUpdate == false) { glDepthMask(GL_TRUE); } gale::openGL::disable(gale::openGL::flag_depthTest); diff --git a/ege/resource/ParticuleMesh.h b/ege/resource/ParticuleMesh.h index 1ad28c9..5a45162 100644 --- a/ege/resource/ParticuleMesh.h +++ b/ege/resource/ParticuleMesh.h @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #pragma once diff --git a/ege/resource/tools/Face.h b/ege/resource/tools/Face.h index 8d33b70..ce56f6c 100644 --- a/ege/resource/tools/Face.h +++ b/ege/resource/tools/Face.h @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #pragma once diff --git a/ege/resource/tools/FaceIndexing.h b/ege/resource/tools/FaceIndexing.h index 70834ab..0133ccd 100644 --- a/ege/resource/tools/FaceIndexing.h +++ b/ege/resource/tools/FaceIndexing.h @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #pragma once diff --git a/ege/resource/tools/icoSphere.cpp b/ege/resource/tools/icoSphere.cpp index e9d348f..59268e9 100644 --- a/ege/resource/tools/icoSphere.cpp +++ b/ege/resource/tools/icoSphere.cpp @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #include diff --git a/ege/resource/tools/icoSphere.h b/ege/resource/tools/icoSphere.h index 5699ae3..51887e2 100644 --- a/ege/resource/tools/icoSphere.h +++ b/ege/resource/tools/icoSphere.h @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #pragma once diff --git a/ege/resource/tools/isoSphere.cpp b/ege/resource/tools/isoSphere.cpp index 4b7f19f..1cdbaad 100644 --- a/ege/resource/tools/isoSphere.cpp +++ b/ege/resource/tools/isoSphere.cpp @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #include diff --git a/ege/resource/tools/isoSphere.h b/ege/resource/tools/isoSphere.h index c7bed4a..53deabc 100644 --- a/ege/resource/tools/isoSphere.h +++ b/ege/resource/tools/isoSphere.h @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #pragma once diff --git a/ege/resource/tools/viewBox.cpp b/ege/resource/tools/viewBox.cpp index 74956c3..ab49cec 100644 --- a/ege/resource/tools/viewBox.cpp +++ b/ege/resource/tools/viewBox.cpp @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #include diff --git a/ege/resource/tools/viewBox.h b/ege/resource/tools/viewBox.h index a53baa4..10fdf45 100644 --- a/ege/resource/tools/viewBox.h +++ b/ege/resource/tools/viewBox.h @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #pragma once diff --git a/ege/widget/Mesh.cpp b/ege/widget/Mesh.cpp index e8fd1b8..bf64e55 100644 --- a/ege/widget/Mesh.cpp +++ b/ege/widget/Mesh.cpp @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #include @@ -11,11 +9,6 @@ #include #include -#undef __class__ -#define __class__ "Mesh" - - - ege::widget::Mesh::Mesh(): signalPressed(this, "pressed", ""), m_position(0,0,0), @@ -30,9 +23,9 @@ void ege::widget::Mesh::init() { m_meshName = *propertyName; // Limit event at 1: setMouseLimit(1); - if (*propertyName!="") { + if (*propertyName != "") { m_object = ege::resource::Mesh::create(m_meshName); - if (nullptr == m_object) { + if (m_object == nullptr) { EGE_ERROR("Can not load the resource : \"" << m_meshName << "\""); } } @@ -48,7 +41,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 (nullptr != m_object) { + if (m_object != nullptr) { m_object->draw(transformationMatrix); } } @@ -70,7 +63,7 @@ void ege::widget::Mesh::systemDraw(const ewol::DrawProperty& _displayProp) { } void ege::widget::Mesh::onRegenerateDisplay() { - if (true == needRedraw()) { + if (needRedraw() == true) { } } @@ -96,7 +89,7 @@ void ege::widget::Mesh::setFile(const std::string& _filename) { && m_meshName != _filename ) { m_meshName = _filename; m_object = ege::resource::Mesh::create(m_meshName); - if (nullptr == m_object) { + if (m_object == nullptr) { EGE_ERROR("Can not load the resource : \"" << m_meshName << "\""); } } @@ -114,7 +107,7 @@ void ege::widget::Mesh::setAngle(const vec3& _angle) { } void ege::widget::Mesh::setAngleSpeed(const vec3& _speed) { - if (_speed!=vec3(0,0,0)) { + if (_speed != vec3(0,0,0)) { periodicCallEnable(); } else { periodicCallDisable(); diff --git a/ege/widget/Mesh.h b/ege/widget/Mesh.h index 8038b21..687b2f4 100644 --- a/ege/widget/Mesh.h +++ b/ege/widget/Mesh.h @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #pragma once diff --git a/ege/widget/Scene.cpp b/ege/widget/Scene.cpp index 675f49b..190cb1f 100644 --- a/ege/widget/Scene.cpp +++ b/ege/widget/Scene.cpp @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #include @@ -27,8 +25,6 @@ #include #include -#undef __class__ -#define __class__ "Scene" namespace etk { template<> std::string to_string >(const std::shared_ptr& _value) { return "{{ERROR}}"; @@ -60,7 +56,7 @@ ege::widget::Scene::~Scene() { } void ege::widget::Scene::onRegenerateDisplay() { - if (true == needRedraw()) { + if (needRedraw() == true) { } } diff --git a/ege/widget/Scene.h b/ege/widget/Scene.h index 086f21a..dbae741 100644 --- a/ege/widget/Scene.h +++ b/ege/widget/Scene.h @@ -1,9 +1,7 @@ -/** +/** @file * @author Edouard DUPIN - * * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) + * @license APACHE v2.0 (see license file) */ #pragma once