update TileFont/TileData

This commit is contained in:
hyzboy 2020-08-01 22:10:06 +08:00
parent cbd3598ebb
commit 85dac21d87
3 changed files with 21 additions and 8 deletions

2
CMCore

@ -1 +1 @@
Subproject commit d4459cf4cd00f324f46fdb80522b8eb3c0beaea0 Subproject commit 339ee9a5614211383999d725cd90e4278c9e1594

View File

@ -147,6 +147,9 @@ namespace hgl
return(obj); return(obj);
} }
/**
* TileObject
*/
TileObject *TileData::Acquire() TileObject *TileData::Acquire()
{ {
TileObject *obj; TileObject *obj;

View File

@ -37,16 +37,26 @@ namespace hgl
List<u32char> new_chars; List<u32char> new_chars;
for(uint i=0;i<ch_list.GetCount();i++) int in_active_count;
int in_idle_count;
int out_count;
int idle_left_count;
int exist_count;
to_res.Stats(ch_list.GetData(),ch_list.GetCount(),&in_active_count,&in_idle_count,&out_count,&idle_left_count);
exist_count=in_active_count+in_idle_count;
if(exist_count>tile_data->GetFreeCount()) //剩余空间不够了
{ {
if(!to_res.KeyExist(*cp)) int need=new_chars.GetCount()-tile_data->GetFreeCount(); //计算需要的tile数量差值
new_chars.Add(*cp);
cp++; to_res.Get
}
if(new_chars.GetCount()>tile_data->GetFreeCount()) //剩余空间不够了 if(need>to_res.GetIdleCount()) //闲置项都不够,那没戏
return(false); return(false);
}
rs.ClearData(); rs.ClearData();
rs.SetCount(ch_list.GetCount()); rs.SetCount(ch_list.GetCount());