diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2012-03-25 21:31:22 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2013-01-13 22:40:51 +0100 |
commit | 158ec1c10c7b39014c30164c85a228746fc91795 (patch) | |
tree | 3736d70411a1a68552102f0f8a9b63a1c1c3045f | |
parent | 26a298e59af130dbee55cb87b181128bfdaebd00 (diff) | |
download | usdx-158ec1c10c7b39014c30164c85a228746fc91795.tar.gz usdx-158ec1c10c7b39014c30164c85a228746fc91795.tar.xz usdx-158ec1c10c7b39014c30164c85a228746fc91795.zip |
menu/text: renamed text_mutex to font_mutex
no the font_mutex should not only serialize all accesses to the text,
that should be drawn, also all accesses to the under laying font
object should not be at the same time
-rw-r--r-- | src/menu/text.cpp | 5 | ||||
-rw-r--r-- | src/menu/text.hpp | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/menu/text.cpp b/src/menu/text.cpp index 8e3ae04a..d5e658e1 100644 --- a/src/menu/text.cpp +++ b/src/menu/text.cpp @@ -59,13 +59,14 @@ namespace usdx glScalef(1, -1, 1); { - boost::mutex::scoped_lock lock(text_mutex); + boost::mutex::scoped_lock lock(font_mutex); font->Render(text.c_str()); } } void Text::set_font_size(unsigned int value) { + boost::mutex::scoped_lock lock(font_mutex); font->FaceSize(value); } @@ -76,7 +77,7 @@ namespace usdx void Text::set_text(const std::string value) { - boost::mutex::scoped_lock lock(text_mutex); + boost::mutex::scoped_lock lock(font_mutex); text = value; } diff --git a/src/menu/text.hpp b/src/menu/text.hpp index 9c910b98..ad5fcb9a 100644 --- a/src/menu/text.hpp +++ b/src/menu/text.hpp @@ -63,8 +63,8 @@ namespace usdx bool stretch; FTFont *font; + boost::mutex font_mutex; - boost::mutex text_mutex; protected: virtual void draw(void); |