pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] CVS: Games/Pingus/src exit_menu.cxx,1.16,1.17 game_time.cx


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src exit_menu.cxx,1.16,1.17 game_time.cxx,1.6,1.7 pingus_main.cxx,1.66,1.67 result_screen.cxx,1.12,1.13 start_screen.cxx,1.11,1.12 system.cxx,1.10,1.11xml_helper.cxx,1.29,1.30
Date: 9 Apr 2003 21:57:26 -0000

Update of /var/lib/cvs/Games/Pingus/src
In directory dark:/tmp/cvs-serv20828/src

Modified Files:
        exit_menu.cxx game_time.cxx pingus_main.cxx result_screen.cxx 
        start_screen.cxx system.cxx xml_helper.cxx 
Log Message:
- fixed some bugs in the translation
- fixed some bugs in the align of text
- fixed utf8 to latin1 stuff
- added dot highlighting (a bit buggy) to worldmap 

Index: exit_menu.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/exit_menu.cxx,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- exit_menu.cxx       3 Apr 2003 17:03:24 -0000       1.16
+++ exit_menu.cxx       9 Apr 2003 21:57:24 -0000       1.17
@@ -41,7 +41,7 @@
  
   void draw (GraphicContext& gc) {
     SurfaceButton::draw(gc);
-    gc.print_left(Fonts::chalk_large, 250,  325, _("Yes"));
+    gc.print_right(Fonts::chalk_large, 320,  325, _("Yes"));
   }
 
   void on_click()
@@ -73,7 +73,7 @@
 
   void draw (GraphicContext& gc) {
     SurfaceButton::draw(gc);
-    gc.print_left(Fonts::chalk_large, 460, 325, _("No"));
+    gc.print_right(Fonts::chalk_large, 480, 325, _("No"));
   }
 
   void on_click() {

Index: game_time.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/game_time.cxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- game_time.cxx       9 Apr 2003 16:20:19 -0000       1.6
+++ game_time.cxx       9 Apr 2003 21:57:24 -0000       1.7
@@ -17,6 +17,7 @@
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
+#include "my_gettext.hxx"
 #include "globals.hxx"
 #include "game_time.hxx"
 
@@ -58,24 +59,25 @@
 std::string
 GameTime::ticks_to_realtime_string(int ticks)
 {
-  char time_str[10];
+  const int time_str_size = 20;
+  char time_str[time_str_size];
 
   if (ticks == -1)
     {
-      snprintf(time_str, 10, "unlimited");
+      snprintf(time_str, time_str_size, _("unlimited"));
     }
   else
     {
       int total_seconds = ticks * game_speed / 1000;
-      int seconds   = total_seconds % 60;
-      int minutes   = total_seconds / 60;
+      int seconds       = total_seconds % 60;
+      int minutes       = total_seconds / 60;
   
       // Stop displaying negative seconds, which can happen if armageddon is
       // clicked with 1 second left.
       if (seconds < 0)
         seconds = 0;
   
-      snprintf(time_str, 10, "%2d:%02d", minutes, seconds);
+      snprintf(time_str, time_str_size, "%2d:%02d", minutes, seconds);
     }
   return time_str;
 }

Index: pingus_main.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/pingus_main.cxx,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- pingus_main.cxx     8 Apr 2003 19:56:40 -0000       1.66
+++ pingus_main.cxx     9 Apr 2003 21:57:24 -0000       1.67
@@ -98,7 +98,7 @@
   switch(signo)
     {
     case SIGSEGV:
-      
puts(_("\n,------------------------------------------------------------------------"));
+      
puts("\n,------------------------------------------------------------------------");
       puts(_("| segfault_handler: catched a SIGSEGV."));
       puts ("|");
       puts(_("| Woops, Pingus just crashed, congratulations you've found a 
bug."));
@@ -123,7 +123,7 @@
     case SIGINT:
       
puts(_("\n,------------------------------------------------------------------------"));
       puts (_("| Warning: Pingus recieved a SIGINT, exiting now."));
-      
puts(_("`------------------------------------------------------------------------\n"));
+      
puts("`------------------------------------------------------------------------\n");
       break;
 
     default:

Index: result_screen.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/result_screen.cxx,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- result_screen.cxx   6 Apr 2003 14:37:07 -0000       1.12
+++ result_screen.cxx   9 Apr 2003 21:57:24 -0000       1.13
@@ -155,7 +155,7 @@
   gc.draw(background, 0, 0);
 
   if (!result.success())
-    gc.print_left(Fonts::chalk_normal, 635, 410, _("Retry"));
+    gc.print_right(Fonts::chalk_normal, 675, 410, _("Retry"));
 
   gc.print_center(Fonts::chalk_large, gc.get_width()/2, 100, 
                   System::translate(result.plf->get_levelname()));

Index: start_screen.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/start_screen.cxx,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- start_screen.cxx    9 Apr 2003 20:20:20 -0000       1.11
+++ start_screen.cxx    9 Apr 2003 21:57:24 -0000       1.12
@@ -136,17 +136,17 @@
   gc.print_center(Fonts::chalk_large, gc.get_width()/2, 100, 
System::translate(plf->get_levelname()));
   gc.print_left(Fonts::chalk_normal, 130, 160, 
format_description(gc.get_width() - 260));
 
-  gc.print_left (Fonts::chalk_normal, 300, 310, _("Number of Pingus: "));
-  gc.print_right(Fonts::chalk_normal, 500, 310, to_string(plf->get_pingus()));
+  gc.print_left (Fonts::chalk_normal, 280, 310, _("Number of Pingus: "));
+  gc.print_right(Fonts::chalk_normal, 520, 310, to_string(plf->get_pingus()));
 
-  gc.print_left (Fonts::chalk_normal, 300, 340, _("Number to Save: "));
-  gc.print_right(Fonts::chalk_normal, 500, 340, 
to_string(plf->get_number_to_save()));
+  gc.print_left (Fonts::chalk_normal, 280, 340, _("Number to Save: "));
+  gc.print_right(Fonts::chalk_normal, 520, 340, 
to_string(plf->get_number_to_save()));
 
-  gc.print_left (Fonts::chalk_normal, 300, 370, _("Time: "));
-  gc.print_right(Fonts::chalk_normal, 500, 370, time_str);
+  gc.print_left (Fonts::chalk_normal, 280, 370, _("Time: "));
+  gc.print_right(Fonts::chalk_normal, 520, 370, time_str);
   
-  gc.print_left (Fonts::chalk_normal, 300, 400, _("Difficulty:"));
-  gc.print_right(Fonts::chalk_normal, 500, 400, 
to_string(plf->get_difficulty()) + "/100");
+  gc.print_left (Fonts::chalk_normal, 280, 400, _("Difficulty:"));
+  gc.print_right(Fonts::chalk_normal, 520, 400, 
to_string(plf->get_difficulty()) + "/100");
 
   /*for (int i = 0; plf->get_difficulty())
     {

Index: system.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/system.cxx,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- system.cxx  16 Mar 2003 10:40:36 -0000      1.10
+++ system.cxx  9 Apr 2003 21:57:24 -0000       1.11
@@ -342,10 +342,14 @@
 std::string
 System::get_language()
 {
-  char* clang = getenv("LANG");
+  char* clang = getenv("LC_MESSAGES");
+  if (clang == 0)
+    clang = getenv("LANG");
+  
   std::string lang;
   
-  if (clang) lang = clang;
+  if (clang) 
+    lang = clang;
 
   if (lang == "C")
     return "en";

Index: xml_helper.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/xml_helper.cxx,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- xml_helper.cxx      9 Apr 2003 20:20:20 -0000       1.29
+++ xml_helper.cxx      9 Apr 2003 21:57:24 -0000       1.30
@@ -458,11 +458,14 @@
 std::string
 XMLhelper::xmlChar2string(const xmlChar* in)
 {
-  int in_len = xmlUTF8Strsize(in, xmlUTF8Strlen(in)) + 1;
-  int out_len = in_len;
+  int chars   = xmlUTF8Strlen(in);
+  int in_len  = xmlUTF8Strsize(in, chars);
+  int out_len = chars + 1;
   unsigned char* out = new unsigned char[out_len];
-  int ret = UTF8Toisolat1(out, &out_len, in,  &in_len);
-    
+
+  //std::cout << "OUT: in_len: " << in_len << " out_len: " << out_len << 
std::endl;
+  int ret = UTF8Toisolat1(out, &out_len, in,  &in_len);   
+
   if (ret != 0)
     {
       std::cout << "Error: XMLhelper: Encoding failed: ret: " << ret 
@@ -475,7 +478,11 @@
     }
   else
     {
-      out[out_len-1] = '\0';
+      out[out_len] = '\0';
+
+      //std::cout << "IN:  in_len: " << in_len << " out_len: " << out_len
+      //        << " => " << out << std::endl;
+
       std::string ret_str = reinterpret_cast<char*>(out);
       delete[] out;
       return ret_str;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]