Author: shadowmaster
Date: Thu Sep 18 04:38:46 2008
New Revision: 29527

URL: http://svn.gna.org/viewcvs/wesnoth?rev=29527&view=rev
Log:
* Fix a logic change I did attempting to optimize image path recognition
* calling std::basic_string<...>::operator== less times; it broke ~TC()
* since it relies on a dirty change to revalidate it as ~RC() later.

Modified:
    trunk/src/image.cpp

Modified: trunk/src/image.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/image.cpp?rev=29527&r1=29526&r2=29527&view=diff
==============================================================================
--- trunk/src/image.cpp (original)
+++ trunk/src/image.cpp Thu Sep 18 04:38:46 2008
@@ -377,6 +377,12 @@
                                }
                                std::string field = *j++;
 
+                               // ~TC() is the only function which is an alias 
to another one,
+                               // so it must be out of the if-elseif chain.
+                               /** @todo: move RC functionality into a 
different method
+                                *         that is called by both functions to 
avoid the
+                                *         unneeded load of string comparison.
+                                */
                                if("TC" == function){
                                        std::vector<std::string> param = 
utils::split(field,',');
                                        if(param.size() < 2)
@@ -398,7 +404,8 @@
                                                field = param[1] + ">" + 
team_color;
                                        }
                                }
-                               else if("RC" == function){      // Re-color 
range/palette function
+
+                               if("RC" == function){   // Re-color 
range/palette function
                                        std::vector<std::string> 
recolor=utils::split(field,'>'); // recolor palette to range
                                        if(recolor.size()>1){
                                                std::map<Uint32, Uint32> 
tmp_map;


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

Reply via email to