Author: esr
Date: Tue Jul  3 10:04:50 2007
New Revision: 18633

URL: http://svn.gna.org/viewcvs/wesnoth?rev=18633&view=rev
Log:
To my intense disgust, the code for interpreting pseudo-ANSI sequences in
marked-up text actually has a use.  Restore it in order to avoid a
regression until we can clean it up.

Modified:
    trunk/src/marked-up_text.cpp

Modified: trunk/src/marked-up_text.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/marked-up_text.cpp?rev=18633&r1=18632&r2=18633&view=diff
==============================================================================
--- trunk/src/marked-up_text.cpp (original)
+++ trunk/src/marked-up_text.cpp Tue Jul  3 10:04:50 2007
@@ -14,6 +14,7 @@
 
 #include "font.hpp"
 #include "marked-up_text.hpp"
+#include "team.hpp"
 #include "video.hpp"
 #include "wassert.hpp"
 
@@ -64,6 +65,27 @@
                        break;
                case NULL_MARKUP:
                        return i1+1;
+               // semi ANSI colour escape sequences at the start of the line 
for now only
+               case '\033':
+                       if(i2 - i1 >= 4) {
+                               ++i1;
+                               if(*i1 == '[') {
+                                       ++i1;
+                                       if(*i1 == '3') {
+                                               ++i1;
+                                               if(*i1 >= '0' && *i1 <= '9' && 
*(i1 + 1) == 'm')
+                                               {
+                                                       if(*i1 != '0')
+                                                       {
+                                                               Uint32 rgb = 
team::get_side_rgb(lexical_cast<int, char>(*i1));
+                                                               *colour = 
int_to_color(rgb);
+                                                       }
+                                                       ++i1;
+                                               }
+                                       }
+                               }
+                       }
+                       break;
                case COLOR_TEXT:
                  {
                    //very primitive parsing for rgb value


_______________________________________________
Wesnoth-commits mailing list
Wesnoth-commits@gna.org
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to