diff --git a/CMakeLists.txt b/CMakeLists.txt index 93c04d9..8d1c0f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,4 @@ - -macro(cm_example_project project_name) +macro(cm_example_project sub_folder project_name) target_link_libraries(${project_name} PRIVATE CMCore CMPlatform CMUtil) if(UNIX) @@ -14,63 +13,72 @@ macro(cm_example_project project_name) target_sources(${project_name} PRIVATE ${CM_MANIFEST}) ENDIF() - set_property(TARGET ${project_name} PROPERTY FOLDER "CM/Examples") + set_property(TARGET ${project_name} PROPERTY FOLDER "CM/Examples/${sub_folder}") endmacro() -add_executable(HalfFloatTest HalfFloatTest.cpp) -cm_example_project(HalfFloatTest) -add_executable(GetCpuInfo GetCpuInfo.cpp) -cm_example_project(GetCpuInfo) -add_executable(CollectionTest CollectionTest.cpp) -cm_example_project(CollectionTest) +add_executable(HalfFloatTest datatype/HalfFloatTest.cpp) +cm_example_project("DataType" HalfFloatTest) -add_executable(FixFilenameTest FixFilenameTest.cpp) -cm_example_project(FixFilenameTest) +add_executable(CollectionTest datatype/CollectionTest.cpp) +cm_example_project("DataType" CollectionTest) + +add_executable(SplitStringTest datatype/SplitStringTest.cpp) +cm_example_project("DataType" SplitStringTest) + +add_executable(MultiMapTest datatype/MultiMapTest.cpp) +cm_example_project("DataType" MultiMapTest) + +add_executable(RuntimeAssetManagerTest datatype/ram/RuntimeAssetManagerTest.cpp + datatype/ram/RuntimeAssetManager.h + datatype/ram/RAM_TestClass.h + datatype/ram/RAM_TestClass.cpp) + +cm_example_project("DataType/RAM" RuntimeAssetManagerTest) + +add_executable(Size2Test datatype/Size2Test.cpp) +cm_example_project("DataType" Size2Test) + +add_executable(DataArrayTest datatype/DataArrayTest.cpp) +cm_example_project("DataType" DataArrayTest) + + +add_executable(FixFilenameTest filesystem/FixFilenameTest.cpp) +cm_example_project("File System" FixFilenameTest) IF(WIN32) - add_executable(EnumVolumeTest EnumVolumeTest.cpp) - cm_example_project(EnumVolumeTest) + add_executable(EnumVolumeTest filesystem/EnumVolumeTest.cpp) + cm_example_project("File System" EnumVolumeTest) ENDIF(WIN32) -add_executable(SplitStringTest SplitStringTest.cpp) -cm_example_project(SplitStringTest) + +add_executable(GetCpuInfo GetCpuInfo.cpp) +cm_example_project("Hareware" GetCpuInfo) add_executable(CreateBinaryH CreateBinaryH.cpp) -cm_example_project(CreateBinaryH) +cm_example_project("" CreateBinaryH) add_executable(NormalCompressTest NormalCompressTest.cpp) -CM_EXAMPLE_PROJECT(NormalCompressTest) - -add_executable(MultiMapTest MultiMapTest.cpp) -cm_example_project(MultiMapTest) +CM_EXAMPLE_PROJECT("" NormalCompressTest) add_executable(OSFontList OSFontList.cpp) -cm_example_project(OSFontList) +cm_example_project("os" OSFontList) target_link_libraries(OSFontList PRIVATE CMUtil) -add_executable(RuntimeAssetManagerTest RuntimeAssetManagerTest.cpp RuntimeAssetManager.h RAM_TestClass.h RAM_TestClass.cpp) -cm_example_project(RuntimeAssetManagerTest) - add_executable(DistributionChart2D DistributionChart2D.cpp BitmapFont.cpp BitmapFont.h) -cm_example_project(DistributionChart2D) +cm_example_project("chart" DistributionChart2D) -add_executable(Size2Test Size2Test.cpp) -cm_example_project(Size2Test) +add_executable(AndroidDeviceAnalysis android/AndroidDeviceAnalysis/main.cpp + android/AndroidDeviceAnalysis/GameRecord.h + android/AndroidDeviceAnalysis/GameRecord.cpp + android/AndroidDeviceAnalysis/ParseDeviceID.cpp + android/AndroidDeviceAnalysis/ParseScreenSize.cpp + android/AndroidDeviceAnalysis/ParseDateTime.cpp + android/AndroidDeviceAnalysis/ParseAndroidVersion.cpp + android/AndroidDeviceAnalysis/ParseNumber.cpp + android/AndroidDeviceAnalysis/LoadRecordFile.cpp) +cm_example_project("android" AndroidDeviceAnalysis) -add_executable(AndroidDeviceAnalysis AndroidDeviceAnalysis/main.cpp - AndroidDeviceAnalysis/GameRecord.h - AndroidDeviceAnalysis/GameRecord.cpp - AndroidDeviceAnalysis/ParseDeviceID.cpp - AndroidDeviceAnalysis/ParseScreenSize.cpp - AndroidDeviceAnalysis/ParseDateTime.cpp - AndroidDeviceAnalysis/ParseAndroidVersion.cpp - AndroidDeviceAnalysis/ParseNumber.cpp - AndroidDeviceAnalysis/LoadRecordFile.cpp) -cm_example_project(AndroidDeviceAnalysis) - -add_executable(DataArrayTest DataArrayTest.cpp) -cm_example_project(DataArrayTest) \ No newline at end of file diff --git a/TestNormal.tga b/TestNormal.tga deleted file mode 100644 index eae878e..0000000 Binary files a/TestNormal.tga and /dev/null differ diff --git a/android/AndroidDeviceAnalysis b/android/AndroidDeviceAnalysis new file mode 160000 index 0000000..8fdb442 --- /dev/null +++ b/android/AndroidDeviceAnalysis @@ -0,0 +1 @@ +Subproject commit 8fdb442ef22b0c2d6944aa7d9750a93be6d5d2da diff --git a/CollectionTest.cpp b/datatype/CollectionTest.cpp similarity index 96% rename from CollectionTest.cpp rename to datatype/CollectionTest.cpp index ab509e4..c9bf462 100644 --- a/CollectionTest.cpp +++ b/datatype/CollectionTest.cpp @@ -58,7 +58,9 @@ void main(int,char **) out(cu); } - cu.Insert(0,0);out(cu); + std::cout<<"insert 'A' data at first."< + struct DataPair + { + KEY key; + VALUE value; + }; + +template +class UnorderedMap +{ + ObjectList> data_list; +}; \ No newline at end of file diff --git a/datatype/MultiMapTest.cpp b/datatype/MultiMapTest.cpp new file mode 100644 index 0000000..a61e8e4 --- /dev/null +++ b/datatype/MultiMapTest.cpp @@ -0,0 +1,8 @@ +struct Person +{ + char name[128]; + bool sex; + int age; +}; + +template Table \ No newline at end of file diff --git a/Size2Test.cpp b/datatype/Size2Test.cpp similarity index 100% rename from Size2Test.cpp rename to datatype/Size2Test.cpp diff --git a/SplitStringTest.cpp b/datatype/SplitStringTest.cpp similarity index 100% rename from SplitStringTest.cpp rename to datatype/SplitStringTest.cpp diff --git a/RAM_TestClass.cpp b/datatype/ram/RAM_TestClass.cpp similarity index 100% rename from RAM_TestClass.cpp rename to datatype/ram/RAM_TestClass.cpp diff --git a/RAM_TestClass.h b/datatype/ram/RAM_TestClass.h similarity index 89% rename from RAM_TestClass.h rename to datatype/ram/RAM_TestClass.h index 6bd1ed7..5e70f9d 100644 --- a/RAM_TestClass.h +++ b/datatype/ram/RAM_TestClass.h @@ -1,11 +1,13 @@ #pragma once #include"RuntimeAssetManager.h" +#include #include +#include using namespace hgl; -using InstanceID =uint64_t; -using PhysicalDeviceID =uint64_t; +using InstanceID =uint64; +using PhysicalDeviceID =uint64; struct Instance:public RuntimeAsset { diff --git a/RuntimeAssetManager.h b/datatype/ram/RuntimeAssetManager.h similarity index 92% rename from RuntimeAssetManager.h rename to datatype/ram/RuntimeAssetManager.h index 7fe6e46..c978f8d 100644 --- a/RuntimeAssetManager.h +++ b/datatype/ram/RuntimeAssetManager.h @@ -1,10 +1,10 @@ #pragma once -#include +#include using namespace hgl; -template struct RuntimeAssetManager:public ResManage +template struct RuntimeAssetManager:public ObjectManage { public: @@ -12,7 +12,7 @@ public: { if(!v)return(false); - return ResManage::Add(v->GetID(),v); + return ObjectManage::Add(v->GetID(),v); } }; diff --git a/RuntimeAssetManagerTest.cpp b/datatype/ram/RuntimeAssetManagerTest.cpp similarity index 100% rename from RuntimeAssetManagerTest.cpp rename to datatype/ram/RuntimeAssetManagerTest.cpp diff --git a/EnumVolumeTest.cpp b/filesystem/EnumVolumeTest.cpp similarity index 100% rename from EnumVolumeTest.cpp rename to filesystem/EnumVolumeTest.cpp diff --git a/FixFilenameTest.cpp b/filesystem/FixFilenameTest.cpp similarity index 100% rename from FixFilenameTest.cpp rename to filesystem/FixFilenameTest.cpp