From: <tz...@us...> - 2009-04-13 02:18:02
|
Revision: 2981 http://freeorion.svn.sourceforge.net/freeorion/revision/?rev=2981&view=rev Author: tzlaine Date: 2009-04-13 02:17:52 +0000 (Mon, 13 Apr 2009) Log Message: ----------- Fixed the use of move_line_dot_texture in MapWnd.cpp. It was being initialized at static initialization time, but was relying on values from the OptionsDB, which is also initialized at static initialization time, but in different files, leading to undefined behavior. Modified Paths: -------------- trunk/FreeOrion/UI/MapWnd.cpp Modified: trunk/FreeOrion/UI/MapWnd.cpp =================================================================== --- trunk/FreeOrion/UI/MapWnd.cpp 2009-04-12 20:57:48 UTC (rev 2980) +++ trunk/FreeOrion/UI/MapWnd.cpp 2009-04-13 02:17:52 UTC (rev 2981) @@ -205,8 +205,7 @@ /* Updated each frame to shift rendered posistion of dots that are drawn to show * fleet move lines. */ - static double move_line_animation_shift = 0.0; // in pixels - static boost::shared_ptr<GG::Texture> move_line_dot_texture = ClientUI::GetTexture(ClientUI::ArtDir() / "misc" / "move_line_dot.png"); + double move_line_animation_shift = 0.0; // in pixels } @@ -961,10 +960,6 @@ CheckGLVersion(); Universe& universe = GetUniverse(); - // (re)load fleet move line dot texture - move_line_dot_texture = ClientUI::GetTexture(ClientUI::ArtDir() / "misc" / "move_line_dot.png"); - - // adjust size of map window for universe and application size Resize(GG::Pt(static_cast<GG::X>(Universe::UniverseWidth() * ZOOM_MAX + GG::GUI::GetGUI()->AppWidth() * 1.5), static_cast<GG::Y>(Universe::UniverseWidth() * ZOOM_MAX + GG::GUI::GetGUI()->AppHeight() * 1.5))); @@ -2569,6 +2564,8 @@ glColor(clr); } + boost::shared_ptr<GG::Texture> move_line_dot_texture = + ClientUI::GetTexture(ClientUI::ArtDir() / "misc" / "move_line_dot.png"); GG::Pt texture_half_size = GG::Pt(GG::X(move_line_dot_texture->DefaultWidth() / 2), GG::Y(move_line_dot_texture->DefaultHeight() / 2)); const int MOVE_LINE_DOT_SPACING = GetOptionsDB().Get<int>("UI.fleet-supply-line-dot-spacing"); |