diff options
author | chai <chaifix@163.com> | 2021-11-05 14:25:39 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-11-05 14:25:39 +0800 |
commit | 2b9621a46288532b352b7838f96aca80f971e3d1 (patch) | |
tree | 6131ef5484e4f6d4c14c541b65a107869e3b112e /Runtime/GUI | |
parent | 6d5787d8da9ad1685864668dd4c3d6aa73a563db (diff) |
*misc
Diffstat (limited to 'Runtime/GUI')
-rw-r--r-- | Runtime/GUI/Font.h | 2 | ||||
-rw-r--r-- | Runtime/GUI/UITextMesh.cpp | 1 | ||||
-rw-r--r-- | Runtime/GUI/UITextMesh.h | 12 |
3 files changed, 7 insertions, 8 deletions
diff --git a/Runtime/GUI/Font.h b/Runtime/GUI/Font.h index 565fafc..df0bc7b 100644 --- a/Runtime/GUI/Font.h +++ b/Runtime/GUI/Font.h @@ -36,7 +36,7 @@ namespace character Unicode codepoint; unsigned short size;//字体大小 }; -#pragma pack() +#pragma pack(pop) bool operator==(const Hash &other) const { diff --git a/Runtime/GUI/UITextMesh.cpp b/Runtime/GUI/UITextMesh.cpp index 23c0a9c..aeaee38 100644 --- a/Runtime/GUI/UITextMesh.cpp +++ b/Runtime/GUI/UITextMesh.cpp @@ -33,7 +33,6 @@ struct TextInfo { int line; // 从0开始 }; - InitializeStaticVariables([]() { VertexAttributeDescriptor POSITION = VertexAttributeDescriptor(0, 2, VertexAttrFormat_Float, sizeof(TextMeshVBOLayout)); VertexAttributeDescriptor UV = VertexAttributeDescriptor(sizeof(Vector2), 2, VertexAttrFormat_Float, sizeof(TextMeshVBOLayout)); diff --git a/Runtime/GUI/UITextMesh.h b/Runtime/GUI/UITextMesh.h index 505b390..ea543f3 100644 --- a/Runtime/GUI/UITextMesh.h +++ b/Runtime/GUI/UITextMesh.h @@ -36,6 +36,12 @@ class UITextMesh public: void Draw() const; +private: + friend class TextMeshGenerator; + + UITextMesh(const UnicodeString& str, Font* font, int pixelSize, int lineHeight, Color32 color32 = Color32::white, ETextAnchor anchor = TextAnchor_UpperLeft, ETextAlignment alignment = TextAlignment_Left, bool wordwrap = false, float preferred = 0)/*throw TextMeshException*/; + ~UITextMesh(); + GET(const Font*, Font, m_Font); GET(int, PixelSize, m_PixelSize); GET(int, LineHeight, m_LineHeight); @@ -46,12 +52,6 @@ public: GET(float, Preferred, m_Preferred); GET(const UnicodeString&, Content, m_Content); -private: - friend class TextMeshGenerator; - - UITextMesh(const UnicodeString& str, Font* font, int pixelSize, int lineHeight, Color32 color32 = Color32::white, ETextAnchor anchor = TextAnchor_UpperLeft, ETextAlignment alignment = TextAlignment_Left, bool wordwrap = false, float preferred = 0)/*throw TextMeshException*/; - ~UITextMesh(); - std::unordered_map<int, VertexBuffer*> m_VBOs; Font* m_Font; |