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


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src/worldobjsdata smasher_data.cxx,1.1,1.2
Date: 10 Sep 2002 14:33:10 -0000

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

Modified Files:
        smasher_data.cxx 
Log Message:
well, not a nice fix for the SpriteObj reference problem, but a working one.
a better solution might be to sync the position data of spriteobj and the 
editorobj on a write call, since its not needed before

Index: smasher_data.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjsdata/smasher_data.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- smasher_data.cxx    4 Sep 2002 14:55:13 -0000       1.1
+++ smasher_data.cxx    10 Sep 2002 14:33:08 -0000      1.2
@@ -26,52 +26,52 @@
 
 namespace WorldObjsData {
 
-  SmasherData::SmasherData ()
-  {
-  }
+SmasherData::SmasherData ()
+{
+}
 
-  SmasherData::SmasherData (xmlDocPtr doc, xmlNodePtr cur) : 
surface(PingusResource::load_surface("Traps/smasher", "traps"))
-  {
-    cur = cur->children;
-    while (cur)
-      {
-        XMLhelper::skip_blank(cur);
+SmasherData::SmasherData (xmlDocPtr doc, xmlNodePtr cur) : 
surface(PingusResource::load_surface("Traps/smasher", "traps"))
+{
+  cur = cur->children;
+  while (cur)
+    {
+      XMLhelper::skip_blank(cur);
 
-        if (strcmp(reinterpret_cast<const char*>(cur->name), "position") == 0) 
-         {
-           pos = XMLhelper::parse_vector(doc, cur);
-         }
+      if (strcmp(reinterpret_cast<const char*>(cur->name), "position") == 0) 
+       {
+         pos = XMLhelper::parse_vector(doc, cur);
+       }
          
-       cur = cur->next;
-      }
-  }
-
-  SmasherData::SmasherData (const SmasherData& old) : WorldObjData(old),
-                                                      surface(old.surface),
-                                                     pos(old.pos)
-  {
-  }
+      cur = cur->next;
+    }
+}
 
-  void
-  SmasherData::write_xml (std::ostream& xml)
-  {
-    xml << "<worldobj name=\"smasher\">\n\t";
-    XMLhelper::write_vector_xml(xml, pos);
-    xml << "</worldobj>\n\n";
-  }
+SmasherData::SmasherData (const SmasherData& old) : WorldObjData(old),
+                                                   surface(old.surface),
+                                                   pos(old.pos)
+{
+}
 
-  WorldObj*
-  SmasherData::create_WorldObj ()
-  {
-    return new WorldObjs::Smasher(this);
-  }
+void
+SmasherData::write_xml (std::ostream& xml)
+{
+  xml << "<worldobj name=\"smasher\">\n\t";
+  XMLhelper::write_vector_xml(xml, pos);
+  xml << "</worldobj>\n\n";
+}
 
-  EditorObjLst
-  SmasherData::create_EditorObj ()
-  {
-    return EditorObjLst(1, new EditorObjs::SmasherObj(this));
-  }
+WorldObj*
+SmasherData::create_WorldObj ()
+{
+  return new WorldObjs::Smasher(this);
+}
 
+EditorObjLst
+SmasherData::create_EditorObj ()
+{
+  return EditorObjLst(1, new EditorObjs::SmasherObj(*this));
 }
+
+} // namespace WorldObjsData
 
 /* EOF */





reply via email to

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