diff --git a/example/Vulkan/SceneTree.cpp b/example/Vulkan/SceneTree.cpp index e3f61b30..40903f2d 100644 --- a/example/Vulkan/SceneTree.cpp +++ b/example/Vulkan/SceneTree.cpp @@ -149,7 +149,6 @@ private: return(true); } - public: bool Init() diff --git a/inc/hgl/graph/SceneNode.h b/inc/hgl/graph/SceneNode.h index 1699ad35..3a6336cd 100644 --- a/inc/hgl/graph/SceneNode.h +++ b/inc/hgl/graph/SceneNode.h @@ -50,6 +50,7 @@ namespace hgl { SetLocalMatrix(mat); } + virtual ~SceneNode() { ClearSubNode(); diff --git a/inc/hgl/type/List.h b/inc/hgl/type/List.h index 11c6616a..8b324d1d 100644 --- a/inc/hgl/type/List.h +++ b/inc/hgl/type/List.h @@ -86,7 +86,7 @@ namespace hgl } };//template class List - template T *GetObject(const List &list,const int index) + template T *GetListObject(const List &list,const int index) { T *obj; diff --git a/inc/hgl/type/Map.cpp b/inc/hgl/type/Map.cpp index a112be62..49cdc9ec 100644 --- a/inc/hgl/type/Map.cpp +++ b/inc/hgl/type/Map.cpp @@ -208,7 +208,7 @@ namespace hgl { int index=Find(flag); - DataPair *obj=GetObject(data_list,index); + DataPair *obj=GetListObject(data_list,index); if(!obj) return(false); @@ -223,7 +223,7 @@ namespace hgl { int index=Find(key); - DataPair *obj=GetObject(data_list,index); + DataPair *obj=GetListObject(data_list,index); if(!obj) return(false); @@ -315,7 +315,7 @@ namespace hgl { int index=Find(flag); - DataPair *dp=GetObject(data_list,index); + DataPair *dp=GetListObject(data_list,index); if(!dp) return(false); @@ -386,7 +386,7 @@ namespace hgl if(index<0 ||index>=data_list.GetCount())return(false); - data_pool.Release(GetObject(data_list,index)); + data_pool.Release(GetListObject(data_list,index)); data_list.DeleteMove(index); return(true); @@ -424,7 +424,7 @@ namespace hgl if(FindPos(flag,result)) { - DataPair *dp=GetObject(data_list,result); + DataPair *dp=GetListObject(data_list,result); if(dp) dp->right=data; @@ -449,7 +449,7 @@ namespace hgl template bool _Map::Change(const F &flag,const T &data) { - DataPair *dp=GetObject(data_list,Find(flag)); + DataPair *dp=GetListObject(data_list,Find(flag)); if(!dp) return(false); diff --git a/inc/hgl/type/Map.h b/inc/hgl/type/Map.h index 3a3350dc..cf57d4ba 100644 --- a/inc/hgl/type/Map.h +++ b/inc/hgl/type/Map.h @@ -93,7 +93,7 @@ namespace hgl return count; } - IDItem *GetItem(int n){return GetObject(data_list,n);} ///<取指定序号的数据 + IDItem *GetItem(int n){return GetListObject(data_list,n);} ///<取指定序号的数据 bool Get(int,F &,T &) const; ///<取指定序号的数据 bool GetKey(int,F &); ///<取指定序号的索引 bool GetValue(int,T &); ///<取指定序号的数据 @@ -116,7 +116,7 @@ namespace hgl virtual ~Map()=default; };//class Map - template T_U *GetObject(Map &list,const T_ID &id) + template T_U *GetListObject(Map &list,const T_ID &id) { T_U *result; @@ -141,7 +141,7 @@ namespace hgl void DeleteObject(int index) { - DeleteObject(GetObject(this->data_list,index)); + DeleteObject(GetListObject(this->data_list,index)); } public: @@ -259,7 +259,7 @@ namespace hgl { DeleteObject(index); - DataPair *dp=GetObject(this->data_list,index); + DataPair *dp=GetListObject(this->data_list,index); if(dp) dp->right=data; @@ -284,7 +284,7 @@ namespace hgl { DeleteObject(index); - DataPair *dp=GetObject(this->data_list,index); + DataPair *dp=GetListObject(this->data_list,index); if(!dp) return(false); @@ -327,7 +327,7 @@ namespace hgl T *operator[](const F &index)const { - auto *obj=GetObject(this->data_list,this->Find(index)); + auto *obj=GetListObject(this->data_list,this->Find(index)); if(obj) return obj->right; diff --git a/src/Base/CMakeLists.txt b/src/Base/CMakeLists.txt index 2d473610..fcf0346c 100644 --- a/src/Base/CMakeLists.txt +++ b/src/Base/CMakeLists.txt @@ -7,7 +7,8 @@ SET(BASE_TYPE_SOURCE DataType/Color3f.cpp DataType/Color4f.cpp # DataType/FontInfo.cpp - DataType/StringList.cpp) + DataType/StringList.cpp + DataType/Endian.cpp) SOURCE_GROUP("DataType" FILES ${BASE_TYPE_SOURCE}) diff --git a/src/Base/DataType/Endian.cpp b/src/Base/DataType/Endian.cpp new file mode 100644 index 00000000..ae8c5008 --- /dev/null +++ b/src/Base/DataType/Endian.cpp @@ -0,0 +1,15 @@ +#include + +namespace hgl +{ + bool CheckSystemEndian() + { + constexpr uint16 db=0xABCD; + + #if HGL_ENDIAN == HGL_BIG_ENDIAN + return(*(uint8 *)&db==0xAB); + #else + return(*(uint8 *)&db==0xCD); + #endif//HGL_BIG_ENDIAN + } +}//namespace hgl