Author: alink
Date: Sun Nov 22 00:04:51 2009
New Revision: 39860

URL: http://svn.gna.org/viewcvs/wesnoth?rev=39860&view=rev
Log:
Rename marked_route::waypoints as marked_route::marks.
(to avoid the name collision with the other waypoints added by user)

Modified:
    trunk/src/game_display.cpp
    trunk/src/menu_events.cpp
    trunk/src/pathfind.cpp
    trunk/src/pathfind.hpp

Modified: trunk/src/game_display.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game_display.cpp?rev=39860&r1=39859&r2=39860&view=diff
==============================================================================
--- trunk/src/game_display.cpp (original)
+++ trunk/src/game_display.cpp Sun Nov 22 00:04:51 2009
@@ -597,11 +597,11 @@
 
 void game_display::draw_movement_info(const map_location& loc)
 {
-       // Search if there is a waypoint here
-       marked_route::waypoint_map::iterator w = route_.waypoints.find(loc);
+       // Search if there is a mark here
+       marked_route::mark_map::iterator w = route_.marks.find(loc);
 
        // Don't use empty route or the first step (the unit will be there)
-       if(w != route_.waypoints.end()
+       if(w != route_.marks.end()
                                && !route_.steps.empty() && 
route_.steps.front() != loc) {
                const unit_map::const_iterator un = 
units_.find(route_.steps.front());
                if(un != units_.end()) {
@@ -612,7 +612,7 @@
 
                        SDL_Color color = 
int_to_color(game_config::red_to_green(def, false));
 
-                       // simple waypoint (no turn point) use smaller font
+                       // simple mark (no turn point) use smaller font
                        int def_font = w->second.turns > 0 ? 18 : 16;
                        draw_text_in_hex(loc, LAYER_MOVE_INFO, def_text.str(), 
def_font, color);
 
@@ -828,7 +828,7 @@
                route_ = *route;
        } else {
                route_.steps.clear();
-               route_.waypoints.clear();
+               route_.marks.clear();
        }
 
        invalidate_route();

Modified: trunk/src/menu_events.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/menu_events.cpp?rev=39860&r1=39859&r2=39860&view=diff
==============================================================================
--- trunk/src/menu_events.cpp (original)
+++ trunk/src/menu_events.cpp Sun Nov 22 00:04:51 2009
@@ -1653,8 +1653,8 @@
 
                        // look where we will stop this turn (turn_1 waypoint 
or goto)
                        map_location next_stop = goto_loc;
-                       marked_route::waypoint_map::const_iterator w = 
route.waypoints.begin();
-                       for(; w != route.waypoints.end(); ++w) {
+                       marked_route::mark_map::const_iterator w = 
route.marks.begin();
+                       for(; w != route.marks.end(); ++w) {
                                if (w->second.turns == 1) {
                                        next_stop = w->first;
                                        break;

Modified: trunk/src/pathfind.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/pathfind.cpp?rev=39860&r1=39859&r2=39860&view=diff
==============================================================================
--- trunk/src/pathfind.cpp (original)
+++ trunk/src/pathfind.cpp Sun Nov 22 00:04:51 2009
@@ -398,7 +398,6 @@
        std::vector<map_location>::const_iterator i = rt.steps.begin();
        std::list<map_location>::const_iterator w = waypoints.begin();
 
-       // TODO fix the name confusion with waypoints and route.waypoints
        for (; i !=rt.steps.end(); i++) {
                bool last_step = (i+1 == rt.steps.end());
 
@@ -424,7 +423,7 @@
 
                        bool invisible = u.invisible(*i,units,teams,false);
 
-                       res.waypoints[*i] = marked_route::waypoint(turns, 
pass_here, zoc, capture, invisible);
+                       res.marks[*i] = marked_route::mark(turns, pass_here, 
zoc, capture, invisible);
 
                        if (last_step) break; // finished and we used dummy 
move_cost
 
@@ -434,7 +433,7 @@
                        }
                } else if (pass_here) {
                        bool invisible = u.invisible(*i,units,teams,false);
-                       res.waypoints[*i] = marked_route::waypoint(0, 
pass_here, zoc, false, invisible);
+                       res.marks[*i] = marked_route::mark(0, pass_here, zoc, 
false, invisible);
                }
 
                zoc = enemy_zoc(units, teams, *(i + 1), viewing_team,u.side())

Modified: trunk/src/pathfind.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/pathfind.hpp?rev=39860&r1=39859&r2=39860&view=diff
==============================================================================
--- trunk/src/pathfind.hpp (original)
+++ trunk/src/pathfind.hpp Sun Nov 22 00:04:51 2009
@@ -107,18 +107,18 @@
        dest_vect destinations;
 };
 
-/** Structure which holds a single route and waypoints for special events. */
+/** Structure which holds a single route and marks for special events. */
 struct marked_route
 {
        marked_route()
                : steps()
-               , waypoints()
+               , marks()
        {
        }
 
-       struct waypoint
-       {
-               waypoint(int turns_number = 0, bool pass = false,  bool in_zoc 
= false,
+       struct mark
+       {
+               mark(int turns_number = 0, bool pass = false,  bool in_zoc = 
false,
                         bool do_capture = false, bool is_invisible = false)
                        : turns(turns_number), pass_here(pass), zoc(in_zoc),
                          capture(do_capture), invisible(is_invisible) {}
@@ -128,9 +128,9 @@
                bool capture;
                bool invisible;
        };
-       typedef std::map<map_location, waypoint> waypoint_map;
+       typedef std::map<map_location, mark> mark_map;
        std::vector<map_location> steps;
-       waypoint_map waypoints;
+       mark_map marks;
 };
 
 /** Structure which holds a single route between one location and another. */
@@ -148,7 +148,7 @@
                            std::set<map_location> const *teleports = NULL);
 
 /**
- * Marks a route @a rt with waypoints assuming that a @unit u travels along it.
+ * Add marks on a route @a rt assuming that a @unit u travels along it.
  */
 marked_route mark_route(const plain_route &rt,
        const std::list<map_location>& waypoints, const unit &u,


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to