From 158ec1c10c7b39014c30164c85a228746fc91795 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Sun, 25 Mar 2012 21:31:22 +0200 Subject: 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 --- src/menu/text.cpp | 5 +++-- src/menu/text.hpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src') 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); -- cgit v1.2.3