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 graph.cxx,1.7,1.8 graph.hxx,


From: torangan
Subject: [Pingus-CVS] CVS: Games/Pingus/src/worldmap graph.cxx,1.7,1.8 graph.hxx,1.11,1.12 manager.cxx,1.12,1.13 node.cxx,1.9,1.10 node.hxx,1.8,1.9 node_data.cxx,1.6,1.7 node_data.hxx,1.9,1.10 pingus.cxx,1.9,1.10 pingus.hxx,1.12,1.13 worldmap.cxx,1.13,1.14 worldmap.hxx,1.12,1.13
Date: 28 Sep 2002 11:52:28 -0000

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

Modified Files:
        graph.cxx graph.hxx manager.cxx node.cxx node.hxx 
        node_data.cxx node_data.hxx pingus.cxx pingus.hxx worldmap.cxx 
        worldmap.hxx 
Log Message:
replaced CL_Vector with a smaller Vector class


Index: graph.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldmap/graph.cxx,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- graph.cxx   11 Sep 2002 12:45:58 -0000      1.7
+++ graph.cxx   28 Sep 2002 11:52:26 -0000      1.8
@@ -17,6 +17,7 @@
 //  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"
@@ -161,7 +162,7 @@
   }*/
 
 void
-Graph::draw (const CL_Vector& offset)
+Graph::draw (const Vector& offset)
 {
   for (iterator i = nodes.begin();
        i != nodes.end();
@@ -171,8 +172,8 @@
           j != nodes.end();
           ++j)
        {
-         CL_Vector i_pos = (*i)->get_pos ();
-         CL_Vector j_pos = (*j)->get_pos ();
+         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();

Index: graph.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldmap/graph.hxx,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- graph.hxx   27 Sep 2002 11:26:49 -0000      1.11
+++ graph.hxx   28 Sep 2002 11:52:26 -0000      1.12
@@ -77,7 +77,7 @@
 
   /** Draw the edges of the graph to the screen
       @param offset FIXME: should be handled by GraphicContext instead */
-  void draw (const CL_Vector& offset);
+  void draw (const Vector& offset);
 
   /** Some functions to parse the data out of an xml file.
       For syntax description see doc/worldmap.xml

Index: manager.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldmap/manager.cxx,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- manager.cxx 14 Sep 2002 19:06:34 -0000      1.12
+++ manager.cxx 28 Sep 2002 11:52:26 -0000      1.13
@@ -17,6 +17,7 @@
 //  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 "../screen_manager.hxx"
 #include "../path_manager.hxx"
 #include "worldmap.hxx"
@@ -24,7 +25,7 @@
 
 namespace WorldMapNS {
 
-WorldMapManager* WorldMapManager::instance_ = 0;
+WorldMapManager* WorldMapManager::instance_(0);
 
 WorldMapManager::WorldMapManager ()
 {

Index: node.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldmap/node.cxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- node.cxx    14 Sep 2002 19:06:34 -0000      1.9
+++ node.cxx    28 Sep 2002 11:52:26 -0000      1.10
@@ -17,6 +17,7 @@
 //  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 "manager.hxx"
 #include "../my_gettext.hxx"
 #include "../path_manager.hxx"
@@ -48,7 +49,7 @@
 }
 
 void 
-TubeNode::draw (CL_Vector offset)
+TubeNode::draw (Vector offset)
 {
   tube.put_screen (pos + offset);
 }
@@ -134,7 +135,7 @@
 }
 
 void 
-LevelNode::draw (CL_Vector offset)
+LevelNode::draw (Vector offset)
 {
   if (!levelname.empty())
     {

Index: node.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldmap/node.hxx,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- node.hxx    27 Sep 2002 11:26:49 -0000      1.8
+++ node.hxx    28 Sep 2002 11:52:26 -0000      1.9
@@ -23,7 +23,7 @@
 #include "../sprite.hxx"
 #include "node_data.hxx"
 
-class CL_Vector;
+class Vector;
 class PLF;
 
 namespace WorldMapNS {
@@ -40,11 +40,11 @@
   
   virtual void on_click () =0;
   virtual void mark (bool /*value*/) {}
-  virtual void draw (CL_Vector /*offset*/) {}
+  virtual void draw (Vector /*offset*/) {}
   virtual std::string get_string () =0;
 
   virtual int  get_id () =0;
-  virtual CL_Vector get_pos () =0;
+  virtual Vector get_pos () =0;
   virtual std::list<int>& get_links () =0;
       
 private:
@@ -64,11 +64,11 @@
 public:  
   TubeNode (const TubeNodeData&);
   void on_click ();
-  void draw (CL_Vector offset);
+  void draw (Vector offset);
   std::string get_string ();
 
   int  get_id ()               { return NodeData::get_id();    }
-  CL_Vector get_pos ()         { return NodeData::get_pos();   }
+  Vector get_pos ()         { return NodeData::get_pos();   }
   std::list<int>& get_links () { return NodeData::get_links(); }
 
 private:
@@ -102,11 +102,11 @@
   virtual ~LevelNode ();
   void on_click ();
   void mark (bool value);
-  void draw (CL_Vector offset);
+  void draw (Vector offset);
   std::string get_string ();
 
   int  get_id ()               { return NodeData::get_id(); }
-  CL_Vector get_pos ()         { return NodeData::get_pos(); }
+  Vector get_pos ()         { return NodeData::get_pos(); }
   std::list<int>& get_links () { return NodeData::get_links(); }
       
 private:

Index: node_data.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldmap/node_data.cxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- node_data.cxx       27 Sep 2002 11:26:49 -0000      1.6
+++ node_data.cxx       28 Sep 2002 11:52:26 -0000      1.7
@@ -17,6 +17,7 @@
 //  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 "../string_converter.hxx"
 #include "../xml_helper.hxx"
 #include "node.hxx"

Index: node_data.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldmap/node_data.hxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- node_data.hxx       27 Sep 2002 11:26:49 -0000      1.9
+++ node_data.hxx       28 Sep 2002 11:52:26 -0000      1.10
@@ -23,7 +23,7 @@
 #include <iosfwd>
 #include <list>
 #include <string>
-#include <ClanLib/Core/Math/cl_vector.h>
+#include "../vector.hxx"
 
 #include "../libxmlfwd.hxx"
 
@@ -64,7 +64,7 @@
 
   /** The position of the node in the worldmap, pos.z is used for
       z-sorting */
-  CL_Vector pos;
+  Vector pos;
 
 public:
   NodeData () { }
@@ -75,7 +75,7 @@
   virtual ~NodeData () { }
 
   int       get_id () { return id; } 
-  CL_Vector get_pos () { return pos; } 
+  Vector get_pos () { return pos; } 
   std::list<int>& get_links () { return links; } 
 
   void assign (const NodeData& data) 

Index: pingus.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldmap/pingus.cxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- pingus.cxx  11 Sep 2002 12:45:58 -0000      1.9
+++ pingus.cxx  28 Sep 2002 11:52:26 -0000      1.10
@@ -48,7 +48,7 @@
 }
 
 void
-Pingus::draw (const CL_Vector& offset)
+Pingus::draw (const Vector& offset)
 {
   sprite.set_direction (is_left ? Sprite::LEFT : Sprite::RIGHT);
   if (!targets.empty ())
@@ -74,7 +74,7 @@
 
   if (!targets.empty ())
     {
-      CL_Vector t_pos = targets.front ()->get_pos ();
+      Vector t_pos = targets.front ()->get_pos ();
 
       // Pingus found the target node
       if (pos.x > t_pos.x - 3

Index: pingus.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldmap/pingus.hxx,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- pingus.hxx  27 Sep 2002 11:26:49 -0000      1.12
+++ pingus.hxx  28 Sep 2002 11:52:26 -0000      1.13
@@ -55,7 +55,7 @@
   std::vector<Node*> node_path;
 
   /** The path which represents an edge between two nodes */
-  std::vector<CL_Vector> edge_path;
+  std::vector<Vector> edge_path;
   
   /** The length of the edge_path in pixels */
   float edge_path_length;
@@ -67,7 +67,7 @@
   float edge_path_position;
 
   /** Current position of the pingu, only for caching purpose */
-  CL_Vector pos;
+  Vector pos;
 
   void draw (GraphicContext& gc);
 
@@ -128,7 +128,7 @@
   }
   
   /** calculate the position of the pingu */
-  CL_Vector calc_pos ()
+  Vector calc_pos ()
   {
     if (current_node) // pingu stands still
       {
@@ -182,7 +182,7 @@
 #endif 
 
   Sprite sprite;
-  CL_Vector pos;
+  Vector pos;
   std::queue<Node*> targets;
   bool is_left;
   Node* current_node;
@@ -191,7 +191,7 @@
   Pingus ();
   ~Pingus ();
 
-  void draw (const CL_Vector& offset);
+  void draw (const Vector& offset);
   void update (float delta);
 
   /** Let the pingu walk to the given node
@@ -206,7 +206,7 @@
   void set_position (boost::shared_ptr<Node> node);
 
   /** @return Current position of the pingu on the screen */
-  CL_Vector get_pos () { return pos; }
+  Vector get_pos () { return pos; }
 
   /** @return The node where the pingu is current on 
 

Index: worldmap.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldmap/worldmap.cxx,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- worldmap.cxx        14 Sep 2002 19:06:34 -0000      1.13
+++ worldmap.cxx        28 Sep 2002 11:52:26 -0000      1.14
@@ -18,6 +18,7 @@
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #include <assert.h>
+#include <iostream>
 #include <ClanLib/Core/System/system.h>
 #include <ClanLib/Display/Display/display.h>
 #include <ClanLib/Display/Input/mouse.h>
@@ -86,13 +87,13 @@
   stat->save (graph_data.nodes);
 }
 
-CL_Vector 
+Vector 
 WorldMap::get_offset ()
 {
   // FIXME: Handling of background smaller than screen isn't handled
   assert (pingu);
 
-  CL_Vector offset = pingu->get_pos ();
+  Vector offset = pingu->get_pos ();
   offset *= -1.0;
 
   if (CL_Display::get_width () <= int(background.get_width ()))
@@ -135,7 +136,7 @@
 void 
 WorldMap::on_primary_button_press (int x, int y)
 {
-  CL_Vector offset = get_offset ();
+  Vector offset = get_offset ();
 
   {      
     NodePtr node
@@ -205,7 +206,7 @@
 void
 WorldMap::draw (GraphicContext& gc)
 {
-  CL_Vector offset = get_offset ();
+  Vector offset = get_offset ();
   
   if (offset.x > 0)
     CL_Display::clear_display ();
@@ -265,7 +266,7 @@
        i != graph_data.nodes.end ();
        i++)
     {
-      CL_Vector pos = (*i)->get_pos ();
+      Vector pos = (*i)->get_pos ();
 
       if (   pos.x - (int)(red_dot.get_width()/2) - 3 < x
             && pos.x + (int)(red_dot.get_width()/2) + 3 > x

Index: worldmap.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldmap/worldmap.hxx,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- worldmap.hxx        27 Sep 2002 11:26:49 -0000      1.12
+++ worldmap.hxx        28 Sep 2002 11:52:26 -0000      1.13
@@ -139,7 +139,7 @@
       FIXME: collision handling should be done in world-co's
 
       @return the currently used draw offset */
-  CL_Vector get_offset ();
+  Vector get_offset ();
 
   /** Set the pingu to the given node with 'id' */
   void set_pingus (int node_id);





reply via email to

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