pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src/worldmap Makefile.am,1.5,1.6 dot_fact


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src/worldmap Makefile.am,1.5,1.6 dot_factory.cxx,1.1,1.2 graph.cxx,1.9,1.10 graph.hxx,1.14,1.15
Date: 12 Oct 2002 23:43:23 -0000

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

Modified Files:
        Makefile.am dot_factory.cxx graph.cxx graph.hxx 
Log Message:
- started with the worldmap rewirte, worldmap is now broken and will not work 
for the next few days

Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldmap/Makefile.am,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- Makefile.am 12 Oct 2002 23:34:43 -0000      1.5
+++ Makefile.am 12 Oct 2002 23:43:20 -0000      1.6
@@ -28,7 +28,8 @@
 sprite_drawable.hxx sprite_drawable.cxx \
 surface_drawable.hxx surface_drawable.cxx \
 drawable_factory.hxx drawable_factory.cxx \
-path_graph.hxx path_graph.cxx
+path_graph.hxx path_graph.cxx \
+dot_factory.hxx dot_factory.cxx
 
 #node.cxx
 #node.hxx

Index: dot_factory.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldmap/dot_factory.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- dot_factory.cxx     12 Oct 2002 23:34:43 -0000      1.1
+++ dot_factory.cxx     12 Oct 2002 23:43:20 -0000      1.2
@@ -17,9 +17,12 @@
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
+#include "../pingus_error.hxx"
 #include "../xml_helper.hxx"
 #include "dot_factory.hxx"
 
+namespace WorldMapNS {
+
 Dot*
 DotFactory::create(xmlDocPtr doc, xmlNodePtr cur)
 {
@@ -33,8 +36,11 @@
     }
   else
     {
-      PingusError::raise("DotFactory: unknown tag: " + cur->name);
+      PingusError::raise("DotFactory: unknown tag: ");
     }
+  return 0;
 }
+
+} // namespace WorldMapNS
 
 /* EOF */

Index: graph.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldmap/graph.cxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- graph.cxx   28 Sep 2002 19:31:06 -0000      1.9
+++ graph.cxx   12 Oct 2002 23:43:20 -0000      1.10
@@ -17,185 +17,11 @@
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
-#include <iostream>
-#include <ClanLib/Display/Display/display.h>
-#include "../my_gettext.hxx"
-#include "../pingus_error.hxx"
-#include "../xml_helper.hxx"
 #include "graph.hxx"
 
 namespace WorldMapNS {
 
-Graph::Graph ()
-{
-  music = "pingus-1.it";
-  //graph = 0;
-}
-
-Graph::~Graph ()
-{
-  //llif (graph) delete graph;
-}
- 
-void
-Graph::parse_file (std::string filename)
-{
-  doc = xmlParseFile(filename.c_str());
-
-  if (!doc) {
-    PingusError::raise (_("Graph: File not found: ") + filename);
-  }    
-
-  xmlNodePtr cur = doc->ROOT;
-
-  if (cur && XMLhelper::equal_str(cur->name, "pingus-worldmap"))
-    {
-      cur = cur->children;
-      
-      while (cur)
-       {
-         if (xmlIsBlankNode(cur)) 
-           {
-             cur = cur->next;
-             continue;
-           }
-
-         if (XMLhelper::equal_str(cur->name, "node-list"))
-           {
-             parse_node_list (cur);
-           }
-         else if (XMLhelper::equal_str(cur->name, "surface"))
-           {
-             parse_background (cur);
-           }
-         else if (XMLhelper::equal_str(cur->name, "music"))
-           {
-             parse_music (cur);
-           }
-         else
-           {
-             printf("Graph: Unhandled: %s\n", (const char*)cur->name);
-           }
-         cur = cur->next;
-       }      
-    }
-  
-  xmlFreeDoc(doc);
-}
-
-void
-Graph::parse_node_list (xmlNodePtr cur)
-{
-  cur = cur->children;
-  while (cur)
-    {
-      if (xmlIsBlankNode(cur)) 
-       {
-         cur = cur->next;
-         continue;
-       }
-
-      if (XMLhelper::equal_str(cur->name, "empty"))
-       {
-         NodeData* data = EmptyNodeData::create (doc, cur);
-         nodes.push_back (boost::shared_ptr<class Node>
-                          (data->create ()));
-         delete data;
-       }
-      else if (XMLhelper::equal_str(cur->name, "level"))
-       {
-         NodeData* data = LevelNodeData::create (doc, cur);
-         nodes.push_back (boost::shared_ptr<class Node>
-                          (data->create ()));
-         delete data;
-       }
-      else if (XMLhelper::equal_str(cur->name, "tube"))
-       {
-         NodeData* data = TubeNodeData::create (doc, cur);
-         nodes.push_back (boost::shared_ptr<class Node>
-                          (data->create ()));
-         delete data;
-       }
-      else
-       {
-         printf("Graph:parse_node_list: Unhandled: %s\n", (char*)cur->name);   
  
-       }
-      cur = cur->next;
-    } 
-}
-
-void
-Graph::parse_background (xmlNodePtr cur)
-{
-  bg_desc = XMLhelper::parse_surface(doc, cur);
-}
-
-void
-Graph::parse_music (xmlNodePtr cur)
-{
-  if (!XMLhelper::get_prop(cur, "file", music))
-    std::cout << "Graph: No music file given" << std::endl;
-}
-
-ResDescriptor 
-Graph::get_background ()
-{
-  return bg_desc;
-}
-
-std::string 
-Graph::get_music ()
-{
-  return music;
-}
-
-/*Graph<PingusWorldMapNode>* 
-  Graph::get_graph ()
-  {
-  return graph;
-  }*/
-
-void
-Graph::draw (const Vector& offset)
-{
-  for (iterator i = nodes.begin();
-       i != nodes.end();
-       ++i)
-    {
-      for (iterator j = nodes.begin();
-          j != nodes.end();
-          ++j)
-       {
-         Vector i_pos = (*i)->get_pos ();
-         Vector j_pos = (*j)->get_pos ();
-
-         for (std::list<int>::iterator k = (*i)->get_links ().begin();
-              k != (*i)->get_links ().end();
-              ++k)
-           if ((*j)->get_id () == *k)
-             CL_Display::draw_line ((int)(j_pos.x + offset.x), (int)(j_pos.y + 
offset.y),
-                                    (int)(i_pos.x + offset.x), (int)(i_pos.y + 
offset.y),
-                                    1.0, 1.0, 1.0, 1.0);
-       }
-    }
-}
-
-/* Fade out, fixme, doesn't work at the moment 
-   CL_SurfaceProvider* provider = new TargetProvider (target);
-   CL_Surface* sur = CL_Surface::create (provider);
-
-   for (int y = 0; y < CL_Display::get_height(); 
-   y += CL_Display::get_height() / 40)
-   {
-   CL_System::keep_alive ();
-   CL_Display::clear_display ();
-   sur->put_screen (0, y);
-   Display::flip_display ();
-   }
-                     
-   delete sur;
-   delete provider;
-*/
+const NodeId NoNode = -1;
 
 } // namespace WorldMapNS
 

Index: graph.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldmap/graph.hxx,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- graph.hxx   12 Oct 2002 23:34:43 -0000      1.14
+++ graph.hxx   12 Oct 2002 23:43:20 -0000      1.15
@@ -28,7 +28,7 @@
 typedef int NodeId;
 typedef int EdgeId;
 
-extern const NodeId NoNode = -1;
+extern const NodeId NoNode;
 
 template<class NodeType>
 class Node 





reply via email to

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