[DEV] update sharedPtr

This commit is contained in:
Edouard DUPIN 2016-07-19 21:43:58 +02:00
parent 1a97ed92ac
commit 00045ece2b
19 changed files with 33 additions and 33 deletions

View File

@ -229,7 +229,7 @@ namespace ege {
void addStaticMeshToDraw(const ememory::SharedPtr<ege::resource::Mesh>& _mesh) {
m_listMeshToDrawFirst.push_back(_mesh);
}
const std::vector<ememory::SharedPtr<ege::resource::Mesh>>& getStaticMeshToDraw() {
std::vector<ememory::SharedPtr<ege::resource::Mesh>>& getStaticMeshToDraw() {
return m_listMeshToDrawFirst;
}
virtual void onChangePropertyStatus();

View File

@ -25,7 +25,7 @@ ege::Light::~Light() {
}
void ege::Light::link(const ememory::SharedPtr<gale::resource::Program>& _prog, const std::string& _baseName) {
void ege::Light::link(ememory::SharedPtr<gale::resource::Program> _prog, const std::string& _baseName) {
if (_prog == nullptr) {
return;
}
@ -36,7 +36,7 @@ void ege::Light::link(const ememory::SharedPtr<gale::resource::Program>& _prog,
m_GL_specularColor = _prog->getUniform(_baseName+".specularColor");
}
void ege::Light::draw(const ememory::SharedPtr<gale::resource::Program>& _prog) {
void ege::Light::draw(ememory::SharedPtr<gale::resource::Program> _prog) {
_prog->uniform3(m_GL_direction, m_direction);
_prog->uniform3(m_GL_halfplane, m_halfplane);
_prog->uniform4(m_GL_ambientColor, m_ambientColor);

View File

@ -29,8 +29,8 @@ namespace ege {
public:
Light();
~Light();
void link(const ememory::SharedPtr<gale::resource::Program>& _prog, const std::string& _baseName);
void draw(const ememory::SharedPtr<gale::resource::Program>& _prog);
void link(ememory::SharedPtr<gale::resource::Program> _prog, const std::string& _baseName);
void draw(ememory::SharedPtr<gale::resource::Program> _prog);
void setDirection(const vec3& val) {
m_direction = val;
}

View File

@ -17,7 +17,7 @@ ege::MaterialGlId::MaterialGlId() :
// nothing to do else ...
}
void ege::MaterialGlId::link(const ememory::SharedPtr<gale::resource::Program>& _prog, const std::string& _baseName) {
void ege::MaterialGlId::link(ememory::SharedPtr<gale::resource::Program> _prog, const std::string& _baseName) {
if (_prog == nullptr) {
return;
}
@ -42,7 +42,7 @@ ege::Material::~Material() {
}
void ege::Material::draw(const ememory::SharedPtr<gale::resource::Program>& _prog, const MaterialGlId& _glID) {
void ege::Material::draw(ememory::SharedPtr<gale::resource::Program> _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);

View File

@ -24,7 +24,7 @@ namespace ege {
int32_t m_GL_shininess;
int32_t m_GL_texture0;
MaterialGlId();
void link(const ememory::SharedPtr<gale::resource::Program>& _prog, const std::string& _baseName);
void link(ememory::SharedPtr<gale::resource::Program> _prog, const std::string& _baseName);
};
@ -42,7 +42,7 @@ namespace ege {
public:
Material();
~Material();
void draw(const ememory::SharedPtr<gale::resource::Program>& _prog, const ege::MaterialGlId& _glID);
void draw(ememory::SharedPtr<gale::resource::Program> _prog, const ege::MaterialGlId& _glID);
void setAmbientFactor(const vec4& _val) {
m_ambientFactor = _val;
}

View File

@ -168,7 +168,7 @@ namespace ege {
* @brief Debug display of the current element
* @param[in,out] draw Basic system to draw the debug shape and informations
*/
virtual void drawDebug(const ememory::SharedPtr<ewol::resource::Colored3DObject>& _draw, const ememory::SharedPtr<ege::Camera>& _camera) { }
virtual void drawDebug(ememory::SharedPtr<ewol::resource::Colored3DObject> _draw, ememory::SharedPtr<ege::Camera> _camera) { }
};
}

View File

@ -90,7 +90,7 @@ ege::Ray ege::camera::View::getRayFromScreen(const vec2& _offset) {
return out;
}
void ege::camera::View::drawDebug(const ememory::SharedPtr<ewol::resource::Colored3DObject>& _draw, const ememory::SharedPtr<ege::Camera>& _camera) {
void ege::camera::View::drawDebug(ememory::SharedPtr<ewol::resource::Colored3DObject> _draw, ememory::SharedPtr<ege::Camera> _camera) {
mat4 mat;
if (_camera != sharedFromThis()) {
mat.identity();

View File

@ -73,7 +73,7 @@ namespace ege {
virtual vec3 getViewVector() const;
public:
virtual ege::Ray getRayFromScreen(const vec2& _offset);
virtual void drawDebug(const ememory::SharedPtr<ewol::resource::Colored3DObject>& _draw, const ememory::SharedPtr<ege::Camera>& _camera);
virtual void drawDebug(ememory::SharedPtr<ewol::resource::Colored3DObject> _draw, ememory::SharedPtr<ege::Camera> _camera);
virtual float getTetha();
virtual float getPsy();
};

View File

@ -85,7 +85,7 @@ bool ege::Element::loadMesh(const std::string& _meshFileName) {
return setMesh(tmpMesh);
}
bool ege::Element::setMesh(const ememory::SharedPtr<ege::resource::Mesh>& _mesh) {
bool ege::Element::setMesh(ememory::SharedPtr<ege::resource::Mesh> _mesh) {
if (m_mesh != nullptr) {
m_mesh.reset();
}
@ -129,7 +129,7 @@ const float lifeHeight = 0.3f;
const float lifeWidth = 2.0f;
const float lifeYPos = 1.7f;
void ege::Element::drawLife(const ememory::SharedPtr<ewol::resource::Colored3DObject>& _draw, const ememory::SharedPtr<ege::Camera>& _camera) {
void ege::Element::drawLife(ememory::SharedPtr<ewol::resource::Colored3DObject> _draw, ememory::SharedPtr<ege::Camera> _camera) {
if (_draw == nullptr) {
return;
}
@ -168,7 +168,7 @@ void ege::Element::drawLife(const ememory::SharedPtr<ewol::resource::Colored3DOb
#endif
}
void ege::Element::drawDebug(const ememory::SharedPtr<ewol::resource::Colored3DObject>& _draw, const ememory::SharedPtr<ege::Camera>& _camera) {
void ege::Element::drawDebug(ememory::SharedPtr<ewol::resource::Colored3DObject> _draw, ememory::SharedPtr<ege::Camera> _camera) {
m_debugText.clear();
m_debugText.setColor(etk::Color<>(0x00, 0xFF, 0x00, 0xFF));
m_debugText.setPos(vec3(-20,32,0));

View File

@ -82,12 +82,12 @@ namespace ege {
* @note : this remove the shape and the mesh properties.
* @return true if no error occured
*/
virtual bool setMesh(const ememory::SharedPtr<ege::resource::Mesh>& _mesh);
virtual bool setMesh(ememory::SharedPtr<ege::resource::Mesh> _mesh);
/**
* @brief get a pointer on the Mesh file.
* @return the mesh pointer.
*/
inline const ememory::SharedPtr<ege::resource::Mesh>& getMesh() {
inline ememory::SharedPtr<ege::resource::Mesh> getMesh() {
return m_mesh;
};
protected:
@ -159,7 +159,7 @@ namespace ege {
* @brief draw the current life of the element
*/
// TODO : Remove this ...
virtual void drawLife(const ememory::SharedPtr<ewol::resource::Colored3DObject>& _draw, const ememory::SharedPtr<ege::Camera>& _camera);
virtual void drawLife(ememory::SharedPtr<ewol::resource::Colored3DObject> _draw, ememory::SharedPtr<ege::Camera> _camera);
protected:
// For debug only ...
@ -169,7 +169,7 @@ namespace ege {
* @brief Debug display of the current element
* @param[in,out] draw Basic system to draw the debug shape and informations
*/
virtual void drawDebug(const ememory::SharedPtr<ewol::resource::Colored3DObject>& _draw, const ememory::SharedPtr<ege::Camera>& _camera);
virtual void drawDebug(ememory::SharedPtr<ewol::resource::Colored3DObject> _draw, ememory::SharedPtr<ege::Camera> _camera);
/**
* @brief get the theoric position. Sometimes, the element has move due to an explosion or something else, then its real position in not the one that woult it be at the end ...

View File

@ -72,9 +72,9 @@ void ege::ElementPhysic::createRigidBody(float _mass) {
}
bool ege::ElementPhysic::setMesh(const ememory::SharedPtr<ege::resource::Mesh>& _mesh) {
bool ege::ElementPhysic::setMesh(ememory::SharedPtr<ege::resource::Mesh> _mesh) {
EGE_WARNING("Set Mesh");
if (nullptr!=m_mesh) {
if (m_mesh != nullptr) {
removeShape();
}
ege::Element::setMesh(_mesh);
@ -170,7 +170,7 @@ const float ege::ElementPhysic::getInvMass() {
};
void ege::ElementPhysic::drawShape(const btCollisionShape* _shape,
const ememory::SharedPtr<ewol::resource::Colored3DObject>& _draw,
ememory::SharedPtr<ewol::resource::Colored3DObject> _draw,
mat4 _transformationMatrix,
std::vector<vec3> _tmpVertices) {
if( _draw == nullptr
@ -316,7 +316,7 @@ void ege::ElementPhysic::drawShape(const btCollisionShape* _shape,
}
}
void ege::ElementPhysic::drawDebug(const ememory::SharedPtr<ewol::resource::Colored3DObject>& _draw, const ememory::SharedPtr<ege::Camera>& _camera) {
void ege::ElementPhysic::drawDebug(ememory::SharedPtr<ewol::resource::Colored3DObject> _draw, ememory::SharedPtr<ege::Camera> _camera) {
ege::Element::drawDebug(_draw, _camera);
btScalar mmm[16];
btDefaultMotionState* myMotionState = (btDefaultMotionState*)m_body->getMotionState();

View File

@ -76,7 +76,7 @@ namespace ege {
*/
void removeShape();
public:
virtual bool setMesh(const ememory::SharedPtr<ege::resource::Mesh>& _mesh);
virtual bool setMesh(ememory::SharedPtr<ege::resource::Mesh> _mesh);
/**
* @brief draw the curent element (can have multiple display)
* @param[in] pass Id of the current pass : [0..?]
@ -175,10 +175,10 @@ namespace ege {
virtual void onDestroy() {};
virtual const vec3& getPosition();
virtual void setPosition(const vec3& _pos);
virtual void drawDebug(const ememory::SharedPtr<ewol::resource::Colored3DObject>& _draw, const ememory::SharedPtr<ege::Camera>& _camera);
virtual void drawDebug(ememory::SharedPtr<ewol::resource::Colored3DObject> _draw, ememory::SharedPtr<ege::Camera> _camera);
protected:
void drawShape(const btCollisionShape* _shape,
const ememory::SharedPtr<ewol::resource::Colored3DObject>& _draw,
ememory::SharedPtr<ewol::resource::Colored3DObject> _draw,
mat4 _transformationMatrix,
std::vector<vec3> _tmpVertices);
protected:

View File

@ -18,7 +18,7 @@ namespace ege {
virtual bool parse(const char* _line);
virtual void display() {};
public:
virtual enum ege::PhysicsShape::type getType() {
virtual enum ege::PhysicsShape::type getType() const {
return ege::PhysicsShape::box;
};
private:

View File

@ -19,7 +19,7 @@ namespace ege {
virtual bool parse(const char* _line);
virtual void display() {};
public:
virtual enum ege::PhysicsShape::type getType() {
virtual enum ege::PhysicsShape::type getType() const {
return ege::PhysicsShape::capsule;
};
private:

View File

@ -17,7 +17,7 @@ namespace ege {
virtual bool parse(const char* _line);
virtual void display() {};
public:
virtual enum ege::PhysicsShape::type getType() {
virtual enum ege::PhysicsShape::type getType() const {
return ege::PhysicsShape::cone;
};
private:

View File

@ -17,7 +17,7 @@ namespace ege {
virtual bool parse(const char* _line);
virtual void display() {};
public:
virtual enum ege::PhysicsShape::type getType() {
virtual enum ege::PhysicsShape::type getType() const {
return ege::PhysicsShape::convexHull;
};
private:

View File

@ -19,7 +19,7 @@ namespace ege {
virtual bool parse(const char* _line);
virtual void display() {};
public:
virtual enum ege::PhysicsShape::type getType() {
virtual enum ege::PhysicsShape::type getType() const {
return ege::PhysicsShape::cylinder;
};
private:

View File

@ -43,7 +43,7 @@ namespace ege {
};
public:
virtual enum ege::PhysicsShape::type getType() {
virtual enum ege::PhysicsShape::type getType() const {
return ege::PhysicsShape::unknow;
};

View File

@ -19,7 +19,7 @@ namespace ege {
virtual bool parse(const char* _line);
virtual void display() {};
public:
virtual enum ege::PhysicsShape::type getType() {
virtual enum ege::PhysicsShape::type getType() const {
return ege::PhysicsShape::sphere;
};
private: