From: <geo...@us...> - 2006-12-25 22:56:57
|
Revision: 1978 http://svn.sourceforge.net/freeorion/revision/?rev=1978&view=rev Author: geoffthemedio Date: 2006-12-25 14:56:58 -0800 (Mon, 25 Dec 2006) Log Message: ----------- Changed StatisticIcon to use shared pointers to textures, rather than each icon have its own copy Modified Paths: -------------- trunk/FreeOrion/UI/CUIControls.cpp Modified: trunk/FreeOrion/UI/CUIControls.cpp =================================================================== --- trunk/FreeOrion/UI/CUIControls.cpp 2006-12-22 08:00:08 UTC (rev 1977) +++ trunk/FreeOrion/UI/CUIControls.cpp 2006-12-25 22:56:58 UTC (rev 1978) @@ -831,9 +831,12 @@ m_positive_color(text_color), m_zero_color(text_color), m_negative_color(text_color), - m_icon(new GG::StaticGraphic(0, 0, h, h, GG::GUI::GetGUI()->GetTexture(icon_filename), GG::GR_FITGRAPHIC)), + m_icon(0), m_text(new GG::TextControl(h, 0, w - h, h, "", GG::GUI::GetGUI()->GetFont(ClientUI::Font(), ClientUI::Pts()), text_color, GG::TF_LEFT | GG::TF_VCENTER)) -{ +{ + boost::shared_ptr<GG::Texture> texture = ClientUI::GetTexture(icon_filename); + m_icon = new GG::StaticGraphic(0, 0, h, h, texture, GG::GR_FITGRAPHIC); + AttachChild(m_icon); AttachChild(m_text); Refresh(); @@ -851,9 +854,12 @@ m_positive_color(text_color), m_zero_color(text_color), m_negative_color(text_color), - m_icon(new GG::StaticGraphic(0, 0, h, h, GG::GUI::GetGUI()->GetTexture(icon_filename), GG::GR_FITGRAPHIC)), + m_icon(0), m_text(new GG::TextControl(h, 0, w - h, h, "", GG::GUI::GetGUI()->GetFont(ClientUI::Font(), ClientUI::Pts()), text_color, GG::TF_LEFT | GG::TF_VCENTER)) -{ +{ + boost::shared_ptr<GG::Texture> texture = ClientUI::GetTexture(icon_filename); + m_icon = new GG::StaticGraphic(0, 0, h, h, texture, GG::GR_FITGRAPHIC); + m_values[0] = value0; m_values[1] = value1; m_digits[0] = digits0; |