[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src prefab.cxx,1.5,1.6 worldobj_data_fact
From: |
grumbel |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src prefab.cxx,1.5,1.6 worldobj_data_factory.cxx,1.31,1.32 xml_plf.cxx,1.34,1.35 |
Date: |
5 Mar 2003 19:55:16 -0000 |
Update of /usr/local/cvsroot/Games/Pingus/src
In directory dark:/tmp/cvs-serv18052
Modified Files:
prefab.cxx worldobj_data_factory.cxx xml_plf.cxx
Log Message:
fixed prefab support a bit, still broken, but at least loading works kind of
Index: prefab.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/prefab.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- prefab.cxx 5 Mar 2003 19:13:59 -0000 1.5
+++ prefab.cxx 5 Mar 2003 19:55:14 -0000 1.6
@@ -43,8 +43,6 @@
while (cur)
{
- cur = XMLhelper::skip_blank (cur);
-
if (XMLhelper::equal_str (cur->name, "name"))
{
name = XMLhelper::parse_string (doc, cur);
@@ -69,7 +67,11 @@
delete data;
}
- data = WorldObjDataFactory::instance ()->create (doc,
cur->children);
+ std::cout << "XXX Prefab Object is a: "
+ << XMLhelper::skip_blank(cur->children)->name
+ << std::endl;
+ data = WorldObjDataFactory::instance ()->create (doc,
+
XMLhelper::skip_blank(cur->children));
}
else
{
@@ -77,7 +79,8 @@
}
cur = cur->next;
- }
+ cur = XMLhelper::skip_blank (cur);
+ }
}
else
{
@@ -89,6 +92,9 @@
{
std::cout << "ObjectManager::add_prefab_from_file: read error: " <<
filename << std::endl;
}
+
+ if (data == 0)
+ PingusError::raise ("Prefab: Object section empty");
}
Prefab::~Prefab ()
@@ -99,7 +105,7 @@
Prefab*
Prefab::create (const std::string& type)
{
- return new Prefab (path_manager.complete ("prefab/") + type);
+ return new Prefab (path_manager.complete ("prefabs/") + type + ".xml");
}
std::string
Index: worldobj_data_factory.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobj_data_factory.cxx,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- worldobj_data_factory.cxx 5 Mar 2003 19:13:59 -0000 1.31
+++ worldobj_data_factory.cxx 5 Mar 2003 19:55:14 -0000 1.32
@@ -47,6 +47,7 @@
#include "worldobjsdata/teleporter_data.hxx"
#include "worldobjsdata/thunderstorm_background_data.hxx"
#include "worldobjsdata/worldobj_group_data.hxx"
+#include "worldobjsdata/prefab_obj_data.hxx"
using namespace WorldObjsData;
@@ -69,6 +70,7 @@
new WorldObjDataFactoryImpl<HotspotData>("hotspot");
new WorldObjDataFactoryImpl<EntranceData>("entrance");
new WorldObjDataFactoryImpl<ExitData>("exit");
+ new WorldObjDataFactoryImpl<PrefabObjData>("prefab");
new WorldObjDataFactoryImpl<WorldObjGroupData>("group");
// traps
@@ -132,6 +134,10 @@
else if (XMLhelper::equal_str(cur->name, "group"))
{
return create ("group", doc, cur);
+ }
+ else if (XMLhelper::equal_str(cur->name, "prefab"))
+ {
+ return create ("prefab", doc, cur);
}
else
{
Index: xml_plf.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/xml_plf.cxx,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- xml_plf.cxx 5 Mar 2003 19:13:59 -0000 1.34
+++ xml_plf.cxx 5 Mar 2003 19:55:14 -0000 1.35
@@ -148,6 +148,10 @@
{
worldobjs_data.push_back(WorldObjDataFactory::instance()->create(doc, cur));
}
+ else if (XMLhelper::equal_str(cur->name, "prefab"))
+ {
+
worldobjs_data.push_back(WorldObjDataFactory::instance()->create(doc, cur));
+ }
else if (XMLhelper::equal_str(cur->name, "group"))
{
worldobjs_data.push_back(WorldObjDataFactory::instance()->create(doc, cur));
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src prefab.cxx,1.5,1.6 worldobj_data_factory.cxx,1.31,1.32 xml_plf.cxx,1.34,1.35,
grumbel <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/src/worldobjsdata prefab_obj_data.cxx,1.10,1.11 prefab_obj_data.hxx,1.7,1.8
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/data/levels/wip snow20-grumbel.xml,NONE,1.1
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/src/worldobjsdata prefab_obj_data.cxx,1.10,1.11 prefab_obj_data.hxx,1.7,1.8
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/data/levels/wip snow20-grumbel.xml,NONE,1.1
- Index(es):