不再使用hgl_zero,避免莫明其妙的内存损坏问题

This commit is contained in:
hyzboy 2020-06-20 00:44:38 +08:00
parent 858a7e26ab
commit 7eb49939fd

View File

@ -10,10 +10,10 @@ namespace hgl
{ {
struct MeshData struct MeshData
{ {
int index; int index=-1;
uint32 vertex_count; ///<顶点数量 uint32 vertex_count=0; ///<顶点数量
uint8 ntb; uint8 ntb=0;
float *position; float *position;
float *normal; float *normal;
@ -25,14 +25,14 @@ namespace hgl
float *binormal; float *binormal;
}; };
uint32 color_count; uint32 color_count=0;
uint8 **colors; uint8 **colors=nullptr;
uint32 uv_count; uint32 uv_count=0;
const uint8 *uv_component; const uint8 *uv_component=nullptr;
float **uv; float **uv=nullptr;
uint32 indices_count; uint32 indices_count=0;
union union
{ {
@ -45,13 +45,6 @@ namespace hgl
public: public:
MeshData()
{
hgl_zero(this,sizeof(MeshData));
index=-1;
}
~MeshData() ~MeshData()
{ {
if(colors) if(colors)