Skip to content

Commit

Permalink
refactor CCBundle3DData (#19756)
Browse files Browse the repository at this point in the history
* remove superfluous constructor and non-virtual destructor

destructor should be trivial if it doesn't manage resource. A vector
member clears itself automatically. No need to call `clear` in
destructor.
  • Loading branch information
JohnCoconut authored and minggo committed May 27, 2019
1 parent 39199b1 commit 2727af8
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions cocos/3d/CCBundle3DData.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,8 @@ struct ModelData
std::vector<std::string> bones;
std::vector<Mat4> invBindPose;

virtual ~ModelData()
{
resetData();
}
virtual ~ModelData() {}

virtual void resetData()
{
bones.clear();
Expand Down Expand Up @@ -188,10 +186,6 @@ struct MeshData
, attribCount(0)
{
}
~MeshData()
{
resetData();
}
};

/** mesh datas
Expand Down Expand Up @@ -326,7 +320,7 @@ struct NTextureData
Usage type;
GLenum wrapS;
GLenum wrapT;
} ;
};
struct NMaterialData
{
std::vector<NTextureData> textures;
Expand Down Expand Up @@ -440,14 +434,9 @@ struct Animation3DData
*/
struct Reference
{
public:
std::string id;
unsigned int type;
unsigned int offset;

Reference(){}

~Reference(){}
};

NS_CC_END
Expand Down

0 comments on commit 2727af8

Please sign in to comment.