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