auto clear chars from tile font.
This commit is contained in:
@@ -101,6 +101,7 @@ namespace hgl
|
||||
int draw_chars_count; ///<要绘制字符列表
|
||||
|
||||
SortedSets<u32char> chars_sets; ///<不重复字符统计缓冲区
|
||||
SortedSets<u32char> clear_chars_sets; ///<待清除的字符合集
|
||||
TileUVFloatMap chars_uv; ///<所有要绘制字符的uv
|
||||
|
||||
struct CharDrawAttr
|
||||
@@ -111,7 +112,7 @@ namespace hgl
|
||||
|
||||
ObjectList<CharDrawAttr> draw_chars_list; ///<所有字符属性列表
|
||||
|
||||
template<typename T> bool preprocess(TileFont *,const T *,const int);
|
||||
template<typename T> bool preprocess(TextRenderable *,TileFont *,const T *,const int);
|
||||
|
||||
protected:
|
||||
|
||||
|
@@ -33,6 +33,8 @@ namespace hgl
|
||||
Color4f color;
|
||||
GPUBuffer * ubo_color;
|
||||
|
||||
SortedSets<TextRenderable *> tr_sets;
|
||||
|
||||
private:
|
||||
|
||||
friend TextRender *CreateTextRender(GPUDevice *,FontSource *,RenderPass *,GPUBuffer *);
|
||||
@@ -57,6 +59,8 @@ namespace hgl
|
||||
bool Layout(TextRenderable *tr,const UTF16String &str);
|
||||
|
||||
RenderableInstance *CreateRenderableInstance(TextRenderable *text_render_obj);
|
||||
|
||||
void Release(TextRenderable *);
|
||||
};//class TextRender
|
||||
|
||||
/**
|
||||
|
@@ -19,10 +19,24 @@ namespace hgl
|
||||
VBO * vbo_position;
|
||||
VBO * vbo_tex_coord;
|
||||
|
||||
protected:
|
||||
|
||||
friend class TextLayout;
|
||||
friend class TextRender;
|
||||
|
||||
SortedSets<u32char> chars_sets;
|
||||
|
||||
const SortedSets<u32char> &GetCharsSets()const{return chars_sets;}
|
||||
void SetCharsSets(const SortedSets<u32char> &sl){chars_sets=sl;}
|
||||
void ClearCharsSets(){chars_sets.Clear();}
|
||||
|
||||
private:
|
||||
|
||||
virtual ~TextRenderable();
|
||||
|
||||
public:
|
||||
|
||||
TextRenderable(GPUDevice *,Material *,uint mc=1024);
|
||||
virtual ~TextRenderable();
|
||||
|
||||
public:
|
||||
|
||||
|
Reference in New Issue
Block a user