mail[Wesnoth-commits] r43667 - in /trunk/src: game_display.cpp generate_report.cpp pathfind/pathfind.cpp unit.cpp unit.hpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by alinktomine on June 24, 2010 - 03:49:
Author: alink
Date: Thu Jun 24 03:49:22 2010
New Revision: 43667

URL: http://svn.gna.org/viewcvs/wesnoth?rev=43667&view=rev
Log:
use resources::units in get_visible_unit()

Modified:
    trunk/src/game_display.cpp
    trunk/src/generate_report.cpp
    trunk/src/pathfind/pathfind.cpp
    trunk/src/unit.cpp
    trunk/src/unit.hpp

Modified: trunk/src/game_display.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game_display.cpp?rev=43667&r1=43666&r2=43667&view=diff
==============================================================================
--- trunk/src/game_display.cpp (original)
+++ trunk/src/game_display.cpp Thu Jun 24 03:49:22 2010
@@ -219,12 +219,12 @@
 
 void game_display::highlight_hex(map_location hex)
 {
-       const unit *u = get_visible_unit(units_, hex, teams_[viewing_team()], 
!viewpoint_);
+       const unit *u = get_visible_unit(hex, teams_[viewing_team()], 
!viewpoint_);
        if (u) {
                displayedUnitHex_ = hex;
                invalidate_unit();
        } else {
-               u = get_visible_unit(units_, mouseoverHex_, 
teams_[viewing_team()], !viewpoint_);
+               u = get_visible_unit(mouseoverHex_, teams_[viewing_team()], 
!viewpoint_);
                if (u) {
                        // mouse moved from unit hex to non-unit hex
                        if (units_.count(selectedHex_)) {
@@ -241,7 +241,7 @@
 
 void game_display::display_unit_hex(map_location hex)
 {
-       const unit *u = get_visible_unit(units_, hex, teams_[viewing_team()], 
!viewpoint_);
+       const unit *u = get_visible_unit(hex, teams_[viewing_team()], 
!viewpoint_);
        if (u) {
                displayedUnitHex_ = hex;
                invalidate_unit();
@@ -285,7 +285,7 @@
                if (loc == mouseoverHex_ || loc == attack_indicator_src_) {
                        return image::BRIGHTENED;
                } else if (loc == selectedHex_) {
-                       const unit *un = get_visible_unit(units_, loc, 
teams_[currentTeam_], !viewpoint_);
+                       const unit *un = get_visible_unit(loc, 
teams_[currentTeam_], !viewpoint_);
                        if (un && !un->get_hidden()) {
                                return image::BRIGHTENED;
                        }

Modified: trunk/src/generate_report.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/generate_report.cpp?rev=43667&r1=43666&r2=43667&view=diff
==============================================================================
--- trunk/src/generate_report.cpp (original)
+++ trunk/src/generate_report.cpp Thu Jun 24 03:49:22 2010
@@ -69,7 +69,7 @@
        const unit *u = NULL;
 
        if((int(type) >= int(UNIT_REPORTS_BEGIN) && int(type) < 
int(UNIT_REPORTS_END)) || type == POSITION){
-               u = get_visible_unit(units, displayed_unit_hex, current_team, 
show_everything);
+               u = get_visible_unit(displayed_unit_hex, current_team, 
show_everything);
                if (!u && type != POSITION) {
                        return report();
                }

Modified: trunk/src/pathfind/pathfind.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/pathfind/pathfind.cpp?rev=43667&r1=43666&r2=43667&view=diff
==============================================================================
--- trunk/src/pathfind/pathfind.cpp (original)
+++ trunk/src/pathfind/pathfind.cpp Thu Jun 24 03:49:22 2010
@@ -85,7 +85,7 @@
        return map_location();
 }
 
-bool pathfind::enemy_zoc(unit_map const &units, std::vector<team> const 
&teams,
+bool pathfind::enemy_zoc(unit_map const & /*units*/, std::vector<team> const 
&teams,
        map_location const &loc, team const &viewing_team, int side, bool 
see_all)
 {
        map_location locs[6];
@@ -93,7 +93,7 @@
        get_adjacent_tiles(loc,locs);
        for (int i = 0; i != 6; ++i)
        {
-               const unit *u = get_visible_unit(units, locs[i], 
viewing_team, see_all);
+               const unit *u = get_visible_unit(locs[i], viewing_team, 
see_all);
                if (u && u->side() != side && 
current_team.is_enemy(u->side()) &&
                    u->emits_zoc())
                {
@@ -105,7 +105,7 @@
 }
 
 std::set<map_location> pathfind::get_teleport_locations(const unit &u,
-       const unit_map &units, const team &viewing_team,
+       const unit_map & /*units*/, const team &viewing_team,
        bool see_all, bool ignore_units)
 {
        std::set<map_location> res;
@@ -120,7 +120,7 @@
                if (!see_all && viewing_team.is_enemy(u.side()) && 
viewing_team.fogged(l))
                        continue;
                if (!ignore_units && l != loc &&
-                   get_visible_unit(units, l, viewing_team, see_all))
+                   get_visible_unit(l, viewing_team, see_all))
                        continue;
                res.insert(l);
        }
@@ -256,7 +256,7 @@
 
                        if (!ignore_units) {
                                const unit *v =
-                                       get_visible_unit(units, locs[i], 
viewing_team, see_all);
+                                       get_visible_unit(locs[i], 
viewing_team, see_all);
                                if (v && current_team.is_enemy(v->side()))
                                        continue;
 
@@ -480,7 +480,7 @@
        int other_unit_subcost = 0;
        if (!ignore_unit_) {
                const unit *other_unit =
-                       get_visible_unit(units_, loc, viewing_team_, 
see_all_);
+                       get_visible_unit(loc, viewing_team_, see_all_);
 
                // We can't traverse visible enemy and we also prefer empty 
hexes
                // (less blocking in multi-turn moves and better when 
exploring fog,

Modified: trunk/src/unit.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit.cpp?rev=43667&r1=43666&r2=43667&view=diff
==============================================================================
--- trunk/src/unit.cpp (original)
+++ trunk/src/unit.cpp Thu Jun 24 03:49:22 2010
@@ -2756,12 +2756,12 @@
        return u;
 }
 
-const unit *get_visible_unit(const unit_map &units, const map_location &loc,
+const unit *get_visible_unit(const map_location &loc,
        const team &current_team, bool see_all)
 {
        unit_map::const_iterator ui = find_visible_unit(loc,
                current_team, see_all);
-       if (ui == units.end()) return NULL;
+       if (ui == resources::units->end()) return NULL;
        return &*ui;
 }
 

Modified: trunk/src/unit.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit.hpp?rev=43667&r1=43666&r2=43667&view=diff
==============================================================================
--- trunk/src/unit.hpp (original)
+++ trunk/src/unit.hpp Thu Jun 24 03:49:22 2010
@@ -479,7 +479,7 @@
 unit_map::iterator find_visible_unit(const map_location &loc,
        const team &current_team, bool see_all = false);
 
-const unit *get_visible_unit(const unit_map &units, const map_location &loc,
+const unit *get_visible_unit(const map_location &loc,
        const team &current_team, bool see_all = false);
 
 struct team_data




Related Messages


Powered by MHonArc, Updated Thu Jun 24 04:00:18 2010