mail[Wesnoth-commits] r20019 - in /trunk: changelog src/unit_animation.cpp src/unit_animation.hpp


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

Header


Content

Posted by jeremy . rosen on September 01, 2007 - 08:29:
Author: boucman
Date: Sat Sep  1 08:28:43 2007
New Revision: 20019

URL: http://svn.gna.org/viewcvs/wesnoth?rev=20019&view=rev
Log:
removed the unused [neighbour_unit_filter] from animations, SUF does it for 
us, and does it better

Modified:
    trunk/changelog
    trunk/src/unit_animation.cpp
    trunk/src/unit_animation.hpp

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=20019&r1=20018&r2=20019&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Sat Sep  1 08:28:43 2007
@@ -14,6 +14,8 @@
      a game to avoid ambiguity in case of multiple games with the same name
  * WML engine:
    * now tag [filter_adjacent] is supported in the Standard Unit Filter
+   * remove the unused [neighbour_unit_filter] animation filter, now that SUF
+   does it for us (and better)
  * graphics:
    * new graphics for the highwayman
  * miscellaneous and bug fixes

Modified: trunk/src/unit_animation.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit_animation.cpp?rev=20019&r1=20018&r2=20019&view=diff
==============================================================================
--- trunk/src/unit_animation.cpp (original)
+++ trunk/src/unit_animation.cpp Sat Sep  1 08:28:43 2007
@@ -133,9 +133,6 @@
        }
        frequency_ = atoi(cfg["frequency"].c_str());
 
-       for(itor = cfg.child_range("neighbour_unit_filter").first; itor 
<cfg.child_range("neighbour_unit_filter").second;itor++) {
-               neighbour_unit_filter_.push_back(**itor);
-       }
        std::vector<std::string> value_str = utils::split(cfg["value"]);
        std::vector<std::string>::iterator value;
        for(value=value_str.begin() ; value != value_str.end() ; value++) {
@@ -202,26 +199,6 @@
                                }
                        }
                        if(unit == disp.get_const_units().end()) return 
MATCH_FAIL;
-               }
-               if(!neighbour_unit_filter_.empty()) {
-                       gamemap::location neighbour_loc[6] ;
-                       get_adjacent_tiles(loc,neighbour_loc);
-                       unit_map::const_iterator unit;
-                       std::vector<config>::const_iterator second_itor;
-                       for(second_itor = neighbour_unit_filter_.begin(); 
second_itor != neighbour_unit_filter_.end(); second_itor++) {
-                               bool found = false;
-                               for(unit=disp.get_const_units().begin() ; 
unit != disp.get_const_units().end() ; unit++) {
-                                       for(int dir =0; dir < 6 ;dir++) {
-                                               if(unit->first == 
neighbour_loc[dir]) {
-                                                       
if(unit->second.matches_filter(&(*second_itor),neighbour_loc[dir])) {
-                                                               result++;
-                                                               found=true;
-                                                       }
-                                               }
-                                       }
-                               }
-                               if(!found) return MATCH_FAIL;
-                       }
                }
 
        } else if (!unit_filter_.empty()) return MATCH_FAIL;

Modified: trunk/src/unit_animation.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit_animation.hpp?rev=20019&r1=20018&r2=20019&view=diff
==============================================================================
--- trunk/src/unit_animation.hpp (original)
+++ trunk/src/unit_animation.hpp Sat Sep  1 08:28:43 2007
@@ -43,7 +43,6 @@
                t_translation::t_list terrain_types_;
                std::vector<config> unit_filter_;
                std::vector<config> secondary_unit_filter_;
-               std::vector<config> neighbour_unit_filter_;
                std::vector<gamemap::location::DIRECTION> directions;
                int frequency_;
                int base_score_;




Related Messages


Powered by MHonArc, Updated Sat Sep 01 09:00:35 2007