updated list/pool/map....,but can't run.

This commit is contained in:
HuYingzhuo(hugo/hyzboy) 2023-08-14 21:03:20 +08:00
parent 95c67ba857
commit 74003df08b
12 changed files with 26 additions and 22 deletions

2
CMCore

@ -1 +1 @@
Subproject commit 116799bc4ea02ffe85e8cb071272b1cddc2753c1 Subproject commit 3b71e680cc71689bed3dbed0491324819f5e2edc

@ -1 +1 @@
Subproject commit 618fda25036a1949de990d0588e87f838f15e6c8 Subproject commit 2ad618e1ffd27bfe8df2b966e1cb8049fa9d114b

@ -1 +1 @@
Subproject commit 1c67c9e3ac8d7ccf6c05e9b67ad525a8d94fc496 Subproject commit 286f5f438733ac608b8a0892d5869620c06d7f86

2
CMUtil

@ -1 +1 @@
Subproject commit 3afa4e27e9cf444c4d6c875d41ab4a25d7454980 Subproject commit ff819d8a60753269343a3f87777ee03ae5071cb4

View File

@ -63,9 +63,9 @@ public:
void Add(Renderable *ri,const Matrix4f &mat); void Add(Renderable *ri,const Matrix4f &mat);
void ClearData() void Clear()
{ {
rn_list.ClearData(); rn_list.Clear();
} }
void End(); void End();

View File

@ -12,7 +12,7 @@ public:
void Begin() void Begin()
{ {
for(auto *it:data_list) for(auto *it:data_list)
it->value->ClearData(); it->value->Clear();
} }
void End() void End()

View File

@ -43,7 +43,7 @@ namespace hgl
void Clear() void Clear()
{ {
SubNode.ClearData(); SubNode.Clear();
render_obj=nullptr; render_obj=nullptr;
} }

View File

@ -3,7 +3,7 @@
#include<hgl/graph/TileData.h> #include<hgl/graph/TileData.h>
#include<hgl/graph/font/FontSource.h> #include<hgl/graph/font/FontSource.h>
#include<hgl/type/ResPool.h> #include<hgl/type/RefObjectPool.h>
namespace hgl namespace hgl
{ {
@ -11,7 +11,7 @@ namespace hgl
{ {
using TileUVFloatMap=Map<u32char,RectScope2f>; using TileUVFloatMap=Map<u32char,RectScope2f>;
using TileResPool=ResPool<u32char,TileObject *>; using TileResPool=RefObjectPool<u32char,TileObject *>;
/** /**
* Tile字符管理<br> * Tile字符管理<br>

View File

@ -11,6 +11,8 @@ struct Material2DCreateConfig:public MaterialCreateConfig
bool local_to_world; ///<包含LocalToWorld矩阵 bool local_to_world; ///<包含LocalToWorld矩阵
bool use_8bit_color; ///<使用rgba8格式颜色(默认使用rgba32f)
public: public:
Material2DCreateConfig(const GPUDeviceAttribute *da,const AnsiString &name):MaterialCreateConfig(da,name) Material2DCreateConfig(const GPUDeviceAttribute *da,const AnsiString &name):MaterialCreateConfig(da,name)

View File

@ -128,10 +128,10 @@ void MaterialRenderList::Stat()
const uint count=rn_list.GetCount(); const uint count=rn_list.GetCount();
RenderNode *rn=rn_list.GetData(); RenderNode *rn=rn_list.GetData();
ri_list.ClearData(); ri_list.Clear();
ri_list.PreAlloc(count); ri_list.PreAlloc(count);
mi_set.ClearData(); mi_set.Clear();
RenderItem *ri=ri_list.GetData(); RenderItem *ri=ri_list.GetData();

View File

@ -25,14 +25,14 @@ namespace hgl
to_pool.PreAlloc(tile_max_count); to_pool.PreAlloc(tile_max_count);
{ {
int col=0,row=0; int col=0,row=0;
TileObject **to=to_pool.GetInactiveData(); TileObject *to=new TileObject;
for(uint i=0;i<tile_max_count;i++) for(uint i=0;i<tile_max_count;i++)
{ {
(*to)->col =col; to->col =col;
(*to)->row =row; to->row =row;
(*to)->uv_pixel.Set(col*tile_width, to->uv_pixel.Set(col*tile_width,
row*tile_height, row*tile_height,
0, 0,
0); 0);
@ -45,6 +45,8 @@ namespace hgl
++row; ++row;
col=0; col=0;
} }
to_pool.AppendToIdle(to);
} }
} }
@ -63,7 +65,7 @@ namespace hgl
void TileData::BeginCommit() void TileData::BeginCommit()
{ {
commit_list.ClearData(); commit_list.Clear();
commit_ptr=(uint8 *)tile_buffer->Map(); commit_ptr=(uint8 *)tile_buffer->Map();
} }
@ -82,7 +84,7 @@ namespace hgl
const int result=commit_list.GetCount(); const int result=commit_list.GetCount();
commit_list.ClearData(); commit_list.Clear();
return result; return result;
} }

View File

@ -69,10 +69,10 @@ namespace
void DescriptorSet::Clear() void DescriptorSet::Clear()
{ {
buffer_list.ClearData(); buffer_list.Clear();
image_list.ClearData(); image_list.Clear();
wds_list.ClearData(); wds_list.Clear();
binded_sets.ClearData(); binded_sets.Clear();
is_dirty=true; is_dirty=true;
} }