~widelands-dev/widelands/trunk

« back to all changes in this revision

Viewing changes to src/building_ui.cc

  • Committer: sigra
  • Date: 2007-01-26 16:12:13 UTC
  • Revision ID: git-v1:f983e08603f59bc6a6e99cb732d9102bfbfb3db8
* Try to optimize the set terrain tool by adding Map::set_height for areas. That means first set the height of every node in the area, then adjust the surrounding nodes ([http://sourceforge.net/tracker/index.php?func=detail&aid=1640305&group_id=40163&atid=427221], "Editor set height tool set to max produces funny mountain" is still present though).
* Use Area and Player_Area.
* Put most of the code from Event_Conquer_Area and Event_Unhide_Area into a common base.
* Initialize the names of events and triggers in their initializer lists.

git-svn-id: https://widelands.svn.sourceforge.net/svnroot/widelands/trunk@1965 37b2a8de-5219-0410-9f54-a31bc463ab9c

Show diffs side-by-side

added added

removed removed

Lines of Context:
802
802
                static_cast<Interactive_Player * const>(get_parent())->egbase().map();
803
803
        Overlay_Manager & overlay_manager = map.overlay_manager();
804
804
        if (m_workarea_job_id.isNull()) {
805
 
                const Coords position = m_building->get_position();
806
805
                m_workarea_job_id = overlay_manager.get_a_job_id();
 
806
                HollowArea hollow_area =
 
807
                        HollowArea(Area(m_building->get_position(), 0), 0);
807
808
                const Workarea_Info & workarea_info =
808
809
                        m_building->descr().m_recursive_workarea_info;
809
 
                m_workarea_job_id = overlay_manager.get_a_job_id();
810
 
                unsigned int hole_radius = 0;
811
810
                Workarea_Info::const_iterator it = workarea_info.begin();
812
811
                for
813
812
                        (Workarea_Info::size_type i =
816
815
                         ++it)
817
816
                {
818
817
                        --i;
819
 
                        const unsigned int radius = it->first;
820
 
                        MapHollowRegion workarea
821
 
                                = MapHollowRegion(map, position, radius, hole_radius);
 
818
                        hollow_area.radius = it->first;
 
819
                        MapHollowRegion workarea = MapHollowRegion(map, hollow_area);
822
820
                        Coords c;
823
821
                        while (workarea.next(c)) overlay_manager.register_overlay
824
822
                                (c,
826
824
                                 0,
827
825
                                 Point::invalid(),
828
826
                                 m_workarea_job_id);
829
 
                        hole_radius = radius;
 
827
                        hollow_area.hole_radius = hollow_area.radius;
830
828
                }
831
829
                m_toggle_workarea->set_tooltip(_("Hide workarea").c_str());
832
830
        } else {