pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src pingus_main.cxx,1.19,1.20 worldobj_da


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src pingus_main.cxx,1.19,1.20 worldobj_data_factory.cxx,1.27,1.28 xml_helper.cxx,1.20,1.21 xml_helper.hxx,1.14,1.15 xml_plf.cxx,1.28,1.29
Date: 1 Oct 2002 23:10:43 -0000

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

Modified Files:
        pingus_main.cxx worldobj_data_factory.cxx xml_helper.cxx 
        xml_helper.hxx xml_plf.cxx 
Log Message:
- fixed hammer
- added line numbers to a xml error message
- fixed trap parsing code


Index: pingus_main.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingus_main.cxx,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- pingus_main.cxx     28 Sep 2002 22:24:24 -0000      1.19
+++ pingus_main.cxx     1 Oct 2002 23:10:41 -0000       1.20
@@ -74,6 +74,7 @@
 #include "action_data.hxx"
 #include "fonts.hxx"
 #include "sound_real.hxx"
+#include "xml_helper.hxx"
 
 using EditorNS::Editor;
 
@@ -624,6 +625,7 @@
   Fonts::init_fonts ();
   fps_counter.init();
   console.init();
+  XMLhelper::init();
 
   pout.add (std::cerr);
   pout.add (console);

Index: worldobj_data_factory.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobj_data_factory.cxx,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- worldobj_data_factory.cxx   28 Sep 2002 19:31:06 -0000      1.27
+++ worldobj_data_factory.cxx   1 Oct 2002 23:10:41 -0000       1.28
@@ -21,6 +21,8 @@
 #include "pingus_error.hxx"
 #include "worldobj_data_factory.hxx"
 #include "xml_helper.hxx"
+#include "string_converter.hxx"
+
 #include "worldobjsdata/bumper_data.hxx"
 #include "worldobjsdata/conveyor_belt_data.hxx"
 #include "worldobjsdata/entrance_data.hxx"
@@ -108,7 +110,7 @@
 WorldObjData*
 WorldObjDataFactory::create (xmlDocPtr doc, xmlNodePtr cur)
 {
-  std::cout << "WorldObjDataFactory::create (xmlDocPtr doc, xmlNodePtr cur)" 
<< std::endl;
+  //std::cout << "WorldObjDataFactory::create (xmlDocPtr doc, xmlNodePtr cur)" 
<< std::endl;
 
   // Compatibility stuff
   if (XMLhelper::equal_str(cur->name, "hotspot"))
@@ -153,7 +155,8 @@
   std::map<std::string, WorldObjDataAbstractFactory*>::iterator it = 
factories.find(id);
   
   if (it == factories.end())
-    PingusError::raise("WorldObjDataFactory: Invalid id: " + id);
+    PingusError::raise("WorldObjDataFactory: Invalid id: '" + id + "' at line "
+                      + to_string(XML_GET_LINE(cur)));
   else 
     return it->second->create (doc, cur);
     

Index: xml_helper.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/xml_helper.cxx,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- xml_helper.cxx      30 Sep 2002 14:20:49 -0000      1.20
+++ xml_helper.cxx      1 Oct 2002 23:10:41 -0000       1.21
@@ -408,6 +408,12 @@
       << "  </position>\n";
 }
 
+void
+XMLhelper::init()
+{
+  xmlLineNumbersDefault(1);
+}
+
 /* EOF */
 
 

Index: xml_helper.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/xml_helper.hxx,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- xml_helper.hxx      30 Sep 2002 14:20:49 -0000      1.14
+++ xml_helper.hxx      1 Oct 2002 23:10:41 -0000       1.15
@@ -117,6 +117,8 @@
   /** Write a Vector to an xml stream */
   static void write_vector_xml (std::ostream& xml, const Vector& pos);
   //@}
+
+  static void init();
   
 private:
   XMLhelper ();

Index: xml_plf.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/xml_plf.cxx,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- xml_plf.cxx 30 Sep 2002 14:20:49 -0000      1.28
+++ xml_plf.cxx 1 Oct 2002 23:10:41 -0000       1.29
@@ -396,14 +396,14 @@
 void
 XMLPLF::parse_traps (xmlNodePtr cur)
 {
-  xmlNodePtr cur_ = XMLhelper::skip_blank(cur->children);
+  xmlNodePtr child_cur = XMLhelper::skip_blank(cur->children);
   
-  if (XMLhelper::equal_str(cur_->name, "type"))
+  if (XMLhelper::equal_str(child_cur->name, "type"))
     {
       std::string name;
-      if (XMLhelper::node_list_get_string(doc, cur->children, 1, name))
+      if (XMLhelper::node_list_get_string(doc, child_cur->children, 1, name))
        {
-         
worldobjs_data.push_back(WorldObjDataFactory::instance()->create(name, doc, 
XMLhelper::skip_blank(cur)));
+         
worldobjs_data.push_back(WorldObjDataFactory::instance()->create(name, doc, 
cur));
          return;
        }
     }





reply via email to

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