From: <geo...@us...> - 2012-12-06 16:58:52
|
Revision: 5521 http://freeorion.svn.sourceforge.net/freeorion/revision/?rev=5521&view=rev Author: geoffthemedio Date: 2012-12-06 16:58:45 +0000 (Thu, 06 Dec 2012) Log Message: ----------- Removed some seemingly unnecessary instance counting from RotatingPlanetControl. Modified Paths: -------------- trunk/FreeOrion/UI/SidePanel.cpp Modified: trunk/FreeOrion/UI/SidePanel.cpp =================================================================== --- trunk/FreeOrion/UI/SidePanel.cpp 2012-12-06 14:46:41 UTC (rev 5520) +++ trunk/FreeOrion/UI/SidePanel.cpp 2012-12-06 16:58:45 UTC (rev 5521) @@ -576,16 +576,9 @@ s_scanline_shader = boost::shared_ptr<ShaderProgram>( ShaderProgram::shaderProgramFactory("", shader_text)); } - s_instances_counter++; Refresh(); } - ~RotatingPlanetControl() { - s_instances_counter--; - if (!s_instances_counter && s_scanline_shader) - s_scanline_shader.reset(); - } - virtual void Render() { GG::Pt ul = UpperLeft(), lr = LowerRight(); // render rotating base planet texture @@ -675,11 +668,10 @@ StarType m_star_type; static boost::shared_ptr<ShaderProgram> s_scanline_shader; - static int s_instances_counter; }; boost::shared_ptr<ShaderProgram> RotatingPlanetControl::s_scanline_shader = boost::shared_ptr<ShaderProgram>(); -int RotatingPlanetControl::s_instances_counter = 0; + namespace { int SystemNameFontSize() { return ClientUI::Pts()*1.5; @@ -1211,7 +1203,7 @@ bool mine = planet->OwnedBy(client_empire_id); bool populated = planet->CurrentMeterValue(METER_POPULATION) > 0.0; bool habitable = planet_env_for_colony_species >= PE_HOSTILE && planet_env_for_colony_species <= PE_GOOD; - bool visible = GetUniverse().GetObjectVisibilityByEmpire(m_planet_id, client_empire_id) >= VIS_PARTIAL_VISIBILITY; + bool visible = GetUniverse().GetObjectVisibilityByEmpire(m_planet_id, client_empire_id) >= VIS_BASIC_VISIBILITY; bool shielded = planet->CurrentMeterValue(METER_SHIELD) > 0.0; bool being_colonized = planet->IsAboutToBeColonized(); bool outpostable = !populated && ( !has_owner /*&& !shielded*/ ) && visible && !being_colonized; @@ -1633,9 +1625,7 @@ // cancel previous invasion orders for this planet for (std::set<int>::const_iterator o_it = planet_invade_orders.begin(); o_it != planet_invade_orders.end(); ++o_it) - { - HumanClientApp::GetApp()->Orders().RecindOrder(*o_it); - } + { HumanClientApp::GetApp()->Orders().RecindOrder(*o_it); } } else { // order selected invasion ships to invade planet @@ -1650,7 +1640,8 @@ CancelColonizeInvadeScrapShipOrders(ship); - HumanClientApp::GetApp()->Orders().IssueOrder(OrderPtr(new InvadeOrder(empire_id, ship->ID(), m_planet_id))); + HumanClientApp::GetApp()->Orders().IssueOrder(OrderPtr( + new InvadeOrder(empire_id, ship->ID(), m_planet_id))); } } } |