代码排版与补齐未初始化变量

This commit is contained in:
hyzboy 2025-06-09 22:47:54 +08:00
parent 0be9cb3f74
commit b5a5cb16c0
2 changed files with 13 additions and 12 deletions

View File

@ -12,6 +12,7 @@ PrimitiveData::PrimitiveData(const VIL *_vil,const uint32_t vc)
vil=_vil; vil=_vil;
vertex_count=vc; vertex_count=vc;
index_count=0;
vab_list=hgl_zero_new<VAB *>(_vil->GetVertexAttribCount()); vab_list=hgl_zero_new<VAB *>(_vil->GetVertexAttribCount());
vab_map_list=new VABMap[_vil->GetVertexAttribCount()]; vab_map_list=new VABMap[_vil->GetVertexAttribCount()];
@ -87,7 +88,7 @@ VABMap *PrimitiveData::GetVABMap(const int vab_index)
return vab_map; return vab_map;
} }
IndexBuffer *PrimitiveData::InitIBO(const uint32_t ic,IndexType it) IndexBuffer *PrimitiveData::InitIBO(const int ic,IndexType it)
{ {
if(ibo)delete ibo; if(ibo)delete ibo;
@ -105,7 +106,7 @@ IndexBuffer *PrimitiveData::InitIBO(const uint32_t ic,IndexType it)
void PrimitiveData::UnmapAll() void PrimitiveData::UnmapAll()
{ {
for(int i=0;i<vil->GetVertexAttribCount();i++) for(uint32_t i=0;i<vil->GetVertexAttribCount();i++)
vab_map_list[i].Unmap(); vab_map_list[i].Unmap();
ibo_map.Unmap(); ibo_map.Unmap();
@ -177,9 +178,9 @@ namespace
public: public:
int32_t GetVertexOffset()const override { return vab_node->GetStart(); } int32_t GetVertexOffset ()const override{return vab_node->GetStart();}
uint32_t GetFirstIndex ()const override { return ib_node->GetStart(); } uint32_t GetFirstIndex ()const override{return ib_node->GetStart();}
VertexDataManager * GetVDM()const override{return vdm;} ///<取得顶点数据管理器 VertexDataManager * GetVDM ()const override{return vdm;} ///<取得顶点数据管理器
public: public:

View File

@ -54,7 +54,7 @@ public:
VAB * InitVAB (const int vab_index,const void *data); VAB * InitVAB (const int vab_index,const void *data);
VABMap * GetVABMap (const int vab_index); VABMap * GetVABMap (const int vab_index);
IndexBuffer * InitIBO(const uint32_t index_count,IndexType it); IndexBuffer * InitIBO (const int index_count,IndexType it);
IndexBuffer * GetIBO (){return ibo;} IndexBuffer * GetIBO (){return ibo;}
IBMap * GetIBMap (){return &ibo_map;} IBMap * GetIBMap (){return &ibo_map;}
uint32_t GetIndexCount ()const{return index_count;} uint32_t GetIndexCount ()const{return index_count;}