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 groundpiece_data.cxx,1.


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src/worldobjsdata groundpiece_data.cxx,1.2,1.3
Date: 16 Sep 2002 22:36:51 -0000

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

Modified Files:
        groundpiece_data.cxx 
Log Message:
editor saves now in the new groundpiece format

WARNING: this is not well tested and might trash your levels

Index: groundpiece_data.cxx
===================================================================
RCS file: 
/usr/local/cvsroot/Games/Pingus/src/worldobjsdata/groundpiece_data.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- groundpiece_data.cxx        16 Sep 2002 21:03:59 -0000      1.2
+++ groundpiece_data.cxx        16 Sep 2002 22:36:48 -0000      1.3
@@ -41,7 +41,7 @@
       xmlFree(gptype_c_str);
     }
   else
-    std::cout << "XMLPLF: groundtype empty" << std::endl;
+    std::cout << "XMLPLF: groundtype empty, which might be ok." << std::endl;
 
   cur = cur->children;
 
@@ -61,6 +61,11 @@
        {
          desc = XMLhelper::parse_surface(doc, cur);
        }
+      else if (XMLhelper::equal_str(cur->name, "type"))
+       {
+         std::string type = XMLhelper::parse_string(doc, cur);
+         gptype = Groundtype::string_to_type (type);
+       }
       else
        {
          printf("Unhandled: %s\n", (char*)cur->name);
@@ -112,10 +117,11 @@
 void
 GroundpieceData::write_xml(std::ostream& xml)
 {
-  xml << "<groundpiece type=\"" << Groundtype::type_to_string(gptype) << 
"\">\n";
+  xml << "<worldobj type=\"groundpiece\">\n";
+  xml << "  <type>" << Groundtype::type_to_string(gptype) << "</type>\n";
   XMLhelper::write_desc_xml(xml, desc);
   XMLhelper::write_vector_xml(xml, pos);
-  xml << "</groundpiece>\n" << std::endl;
+  xml << "</worldobj>\n" << std::endl;
 }
 
 } // namespace WorldObjsData





reply via email to

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