pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src/worldobjsdata exit_data.cxx,1.1,1.2 g


From: torangan
Subject: [Pingus-CVS] CVS: Games/Pingus/src/worldobjsdata exit_data.cxx,1.1,1.2 groundpiece_data.cxx,1.6,1.7 liquid_data.cxx,1.3,1.4 prefab_obj_data.cxx,1.4,1.5 starfield_background_data.cxx,1.4,1.5
Date: 28 Sep 2002 19:31:09 -0000

Update of /usr/local/cvsroot/Games/Pingus/src/worldobjsdata
In directory dark:/tmp/cvs-serv23571/worldobjsdata

Modified Files:
        exit_data.cxx groundpiece_data.cxx liquid_data.cxx 
        prefab_obj_data.cxx starfield_background_data.cxx 
Log Message:
made XMLhelper::get_prop more versatile (may have introduced bugs)


Index: exit_data.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjsdata/exit_data.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- exit_data.cxx       27 Sep 2002 16:01:55 -0000      1.1
+++ exit_data.cxx       28 Sep 2002 19:31:06 -0000      1.2
@@ -34,12 +34,9 @@
 ExitData::ExitData (xmlDocPtr doc, xmlNodePtr cur) : owner_id(0),
                                                      use_old_pos_handling(true)
 {
-  char* pos_handling = XMLhelper::get_prop(cur, "use-old-pos-handling");
-  if (pos_handling)
+  if (XMLhelper::get_prop(cur, "use-old-pos-handling", use_old_pos_handling));
     {
-      std::cout << "XMLPLF: Use Old Pos Handling: " << pos_handling << 
std::endl;
-      use_old_pos_handling = StringConverter::to_int(pos_handling);
-      xmlFree (pos_handling);
+      std::cout << "XMLPLF: Use Old Pos Handling: " << use_old_pos_handling << 
std::endl;
     }
 
   cur = cur->children;

Index: groundpiece_data.cxx
===================================================================
RCS file: 
/usr/local/cvsroot/Games/Pingus/src/worldobjsdata/groundpiece_data.cxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- groundpiece_data.cxx        28 Sep 2002 11:52:26 -0000      1.6
+++ groundpiece_data.cxx        28 Sep 2002 19:31:06 -0000      1.7
@@ -34,11 +34,10 @@
 {
   gptype = Groundtype::GP_GROUND;
 
-  char* gptype_c_str = XMLhelper::get_prop(cur, "type");
-  if (gptype_c_str)
+  std::string gptype_string;
+  if (XMLhelper::get_prop(cur, "type", gptype_string))
     {
-      gptype = Groundtype::string_to_type (gptype_c_str);
-      xmlFree(gptype_c_str);
+      gptype = Groundtype::string_to_type (gptype_string);
     }
   else
     std::cout << "XMLPLF: groundtype empty, which might be ok." << std::endl;

Index: liquid_data.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjsdata/liquid_data.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- liquid_data.cxx     27 Sep 2002 18:36:41 -0000      1.3
+++ liquid_data.cxx     28 Sep 2002 19:31:06 -0000      1.4
@@ -36,12 +36,9 @@
 {
   std::cout << "LiquidData::create(xmlDocPtr doc, xmlNodePtr cur)" << 
std::endl;
   
-  char* width_handling = XMLhelper::get_prop(cur, "use-old-width-handling");
-  if (width_handling)
+  if (XMLhelper::get_prop(cur, "use-old-width-handling", old_width_handling))
     {
-      std::cout << "XMLPLF: Use Old Width Handling: " << width_handling << 
std::endl;
-      old_width_handling = StringConverter::to_int(width_handling);
-      xmlFree(width_handling);
+      std::cout << "XMLPLF: Use Old Width Handling: " << old_width_handling << 
std::endl;
     }
 
   cur = cur->children;

Index: prefab_obj_data.cxx
===================================================================
RCS file: 
/usr/local/cvsroot/Games/Pingus/src/worldobjsdata/prefab_obj_data.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- prefab_obj_data.cxx 28 Sep 2002 11:52:27 -0000      1.4
+++ prefab_obj_data.cxx 28 Sep 2002 19:31:06 -0000      1.5
@@ -26,16 +26,12 @@
 
 PrefabObjData::PrefabObjData (xmlDocPtr doc, xmlNodePtr cur)
 {
-  char* uid_cstr = XMLhelper::get_prop(cur, "type");
-  if (uid_cstr)
-    uid = uid_cstr;
-  else
+  if (!XMLhelper::get_prop(cur, "type", uid))
     {
       std::cout << "PrefabObjData: missing type! Default to test" << std::endl;
       uid = "test";
     }
-  xmlFree (uid_cstr);
-
+    
   cur = cur->children;
 
   while (cur)

Index: starfield_background_data.cxx
===================================================================
RCS file: 
/usr/local/cvsroot/Games/Pingus/src/worldobjsdata/starfield_background_data.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- starfield_background_data.cxx       28 Sep 2002 11:52:27 -0000      1.4
+++ starfield_background_data.cxx       28 Sep 2002 19:31:07 -0000      1.5
@@ -58,30 +58,15 @@
       
       if (XMLhelper::equal_str(cur->name, "small-stars"))
        {
-         char* count = XMLhelper::get_prop(cur, "count");
-         if (count)
-           {
-             small_stars_count = StringConverter::to_int(count);
-             xmlFree(count);
-           }
+         XMLhelper::get_prop(cur, "count", small_stars_count);
        }
       else if (XMLhelper::equal_str(cur->name, "middle-stars"))
        {
-         char* count = XMLhelper::get_prop(cur, "count");
-         if (count)
-           {
-             middle_stars_count = StringConverter::to_int(count);
-             xmlFree(count);
-           }     
+         XMLhelper::get_prop(cur, "count", middle_stars_count);
        }
       else if (XMLhelper::equal_str(cur->name, "large-stars"))
        {
-         char* count = XMLhelper::get_prop(cur, "count");
-         if (count)
-           {
-             large_stars_count = StringConverter::to_int(count);
-             xmlFree(count);
-           }     
+         XMLhelper::get_prop(cur, "count", large_stars_count);
        }
       else
        {





reply via email to

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