diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-05-19 14:49:19 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-05-20 00:02:36 +0300 |
commit | e224a077737739a895fe533c9cce93783621d8e9 (patch) | |
tree | 28194260919ffcc8aa77f52caf45cbf3a1747334 /src/gui/fonts/textchunk.h | |
parent | fd85f62f2e3003a79e90611e95b09e23710be479 (diff) | |
download | manaverse-e224a077737739a895fe533c9cce93783621d8e9.tar.gz manaverse-e224a077737739a895fe533c9cce93783621d8e9.tar.bz2 manaverse-e224a077737739a895fe533c9cce93783621d8e9.tar.xz manaverse-e224a077737739a895fe533c9cce93783621d8e9.zip |
Add fast way for draw not changed text strings.
TextChunk with colors and image stored inside draw object.
If string or color changed old string image moved to cache.
New string image generated or moved from cache.
Use new way in drawing string in label.
Diffstat (limited to 'src/gui/fonts/textchunk.h')
-rw-r--r-- | src/gui/fonts/textchunk.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/fonts/textchunk.h b/src/gui/fonts/textchunk.h index 13187473d..6b8beec35 100644 --- a/src/gui/fonts/textchunk.h +++ b/src/gui/fonts/textchunk.h @@ -38,10 +38,12 @@ class Image; class TextChunk final { public: + TextChunk(); + TextChunk(const std::string &text0, const Color &color0, const Color &color1, - const Font *const font); + Font *const font); A_DELETE_COPY(TextChunk) @@ -51,8 +53,10 @@ class TextChunk final void generate(TTF_Font *const font, const float alpha); + void deleteImage(); + Image *img; - const Font *textFont; + Font *textFont; std::string text; Color color; Color color2; |