pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src xml_plf.cxx,1.16,1.17 xml_plf.hxx,1.7


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src xml_plf.cxx,1.16,1.17 xml_plf.hxx,1.7,1.8
Date: 16 Sep 2002 10:18:53 -0000

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

Modified Files:
        xml_plf.cxx xml_plf.hxx 
Log Message:
- fixed grouping support in the world, WorldObjGroup didn't work out as expected

Index: xml_plf.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/xml_plf.cxx,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- xml_plf.cxx 15 Sep 2002 21:21:47 -0000      1.16
+++ xml_plf.cxx 16 Sep 2002 10:18:51 -0000      1.17
@@ -139,7 +139,8 @@
            }
          else if (XMLhelper::equal_str(cur->name, "group"))
            {
-             worldobjs_data.push_back (new WorldObjsData::WorldObjGroupData 
(doc, cur));
+             //worldobjs_data.push_back (new WorldObjsData::WorldObjGroupData 
(doc, cur));
+             parse_group (cur);
            }
          else if (XMLhelper::equal_str(cur->name, "start-position"))
            {
@@ -158,6 +159,66 @@
       //puts("global done");
     } else {
       PingusError::raise("XMLPLF: This is no valid Pingus level");
+    }
+}
+
+void
+XMLPLF::parse_group (xmlNodePtr cur)
+{
+  cur = cur->children;
+  
+  while (cur)
+    {
+      if (XMLhelper::equal_str(cur->name, "background"))
+       {
+         parse_background(cur);
+       }
+      else if (XMLhelper::equal_str(cur->name, "groundpiece"))
+       {
+         parse_groundpiece(cur);
+       }
+      else if (XMLhelper::equal_str(cur->name, "exit"))
+       {
+         worldobjs_data.push_back (new ExitData (doc, cur));
+       }
+      else if (XMLhelper::equal_str(cur->name, "entrance"))
+       {
+         worldobjs_data.push_back (new EntranceData (doc, cur));
+       }
+      else if (XMLhelper::equal_str(cur->name, "trap"))
+       {
+         parse_traps(cur);
+       }
+      else if (XMLhelper::equal_str(cur->name, "hotspot"))
+       {
+         worldobjs_data.push_back(new HotspotData (doc, cur));
+       }
+      else if (XMLhelper::equal_str(cur->name, "liquid"))
+       {
+         worldobjs_data.push_back(new LiquidData (doc, cur));
+       }
+      else if (XMLhelper::equal_str(cur->name, "worldobj"))
+       {
+         worldobjs_data.push_back(WorldObjDataFactory::instance()->create 
(doc, cur));
+       }
+      else if (XMLhelper::equal_str(cur->name, "group"))
+       {
+         //worldobjs_data.push_back (new WorldObjsData::WorldObjGroupData 
(doc, cur));
+         parse_group (cur);
+       }
+      else if (XMLhelper::equal_str(cur->name, "start-position"))
+       {
+         parse_start_pos(cur);
+       }
+      else if (XMLhelper::equal_str(cur->name, "weather"))
+       {
+         parse_weather(cur);
+       }         
+      else
+       {
+         printf("XMLPLF: Unhandled parse_group: %s\n", reinterpret_cast<const 
char*>(cur->name));
+       }
+      cur = cur->next;
     }
 }
 

Index: xml_plf.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/xml_plf.hxx,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- xml_plf.hxx 15 Sep 2002 20:33:45 -0000      1.7
+++ xml_plf.hxx 16 Sep 2002 10:18:51 -0000      1.8
@@ -30,6 +30,7 @@
 
   void parse_file ();
 
+  void parse_group       (xmlNodePtr cur);
   void parse_background  (xmlNodePtr cur);
   void parse_actions     (xmlNodePtr cur);
   void parse_global      (xmlNodePtr cur);





reply via email to

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