mail[Wesnoth-commits] r44604 - /trunk/src/builder.cpp


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

Header


Content

Posted by alinktomine on July 24, 2010 - 04:24:
Author: alink
Date: Sat Jul 24 04:24:20 2010
New Revision: 44604

URL: http://svn.gna.org/viewcvs/wesnoth?rev=44604&view=rev
Log:
New key 'set_no_flag' in [tile] which combines 'set_flag' and 'no_flag'
because most of the times we use same flags in both keys.
This will also reduce the macro use in terrain_graphics.

Modified:
    trunk/src/builder.cpp

Modified: trunk/src/builder.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/builder.cpp?rev=44604&r1=44603&r2=44604&view=diff
==============================================================================
--- trunk/src/builder.cpp (original)
+++ trunk/src/builder.cpp Sat Jul 24 04:24:20 2010
@@ -652,6 +652,13 @@
        constraint.no_flag.insert(constraint.no_flag.end(),
                        item_string.begin(), item_string.end());
 
+       item_string = utils::split(cfg["set_no_flag"]);
+       constraint.set_flag.insert(constraint.set_flag.end(),
+                       item_string.begin(), item_string.end());
+       constraint.no_flag.insert(constraint.no_flag.end(),
+                       item_string.begin(), item_string.end());
+
+
        add_images_from_config(constraint.images, cfg, false);
 }
 
@@ -791,6 +798,7 @@
                const std::vector<std::string> global_set_flag = 
utils::split(br["set_flag"]);
                const std::vector<std::string> global_no_flag = 
utils::split(br["no_flag"]);
                const std::vector<std::string> global_has_flag = 
utils::split(br["has_flag"]);
+               const std::vector<std::string> global_set_no_flag = 
utils::split(br["set_no_flag"]);
 
                for(constraint_set::iterator constraint = 
pbr.constraints.begin(); constraint != pbr.constraints.end();
                    ++constraint) {
@@ -807,6 +815,13 @@
                                
constraint->second.has_flag.insert(constraint->second.has_flag.end(),
                                                global_has_flag.begin(), 
global_has_flag.end());
 
+                       if(!global_set_no_flag.empty()) {
+                               
constraint->second.set_flag.insert(constraint->second.set_flag.end(),
+                                               global_set_no_flag.begin(), 
global_set_no_flag.end());
+
+                               
constraint->second.no_flag.insert(constraint->second.no_flag.end(),
+                                               global_set_no_flag.begin(), 
global_set_no_flag.end());
+                       }
                }
 
                // Handles rotations




Related Messages


Powered by MHonArc, Updated Sat Jul 24 04:40:14 2010