pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src CaptureRectangle.hh,1.14,1.15 EditorH


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src CaptureRectangle.hh,1.14,1.15 EditorHotspot.hh,1.3,1.4 EntranceData.cc,1.5,1.6 Exit.cc,1.30,1.31 ExitData.cc,1.8,1.9 HotspotData.cc,1.5,1.6 LiquidData.cc,1.7,1.8 Makefile.am,1.75,1.76 Playfield.cc,1.34,1.35 Playfield.hh,1.24,1.25 SmallMap.cc,1.41,1.42 TrapData.cc,1.9,1.10 View.hh,1.11,1.12 XMLPLF.cc,1.43,1.44 XMLhelper.cc,1.16,1.17 XMLhelper.hh,1.17,1.18
Date: 8 Jun 2002 21:43:39 -0000

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

Modified Files:
        CaptureRectangle.hh EditorHotspot.hh EntranceData.cc Exit.cc 
        ExitData.cc HotspotData.cc LiquidData.cc Makefile.am 
        Playfield.cc Playfield.hh SmallMap.cc TrapData.cc View.hh 
        XMLPLF.cc XMLhelper.cc XMLhelper.hh 
Log Message:
Removed Position and all references to operator<<(ostream, CL_Vector) since 
thats buggy in ClanLib

Index: CaptureRectangle.hh
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/CaptureRectangle.hh,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- CaptureRectangle.hh 8 Jun 2002 18:39:57 -0000       1.14
+++ CaptureRectangle.hh 8 Jun 2002 21:43:36 -0000       1.15
@@ -22,6 +22,7 @@
 
 #include "Sprite.hh"
 
+class Pingu;
 class PinguAction;
 class CL_Font;
 

Index: EditorHotspot.hh
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/EditorHotspot.hh,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- EditorHotspot.hh    24 Jan 2002 23:07:37 -0000      1.3
+++ EditorHotspot.hh    8 Jun 2002 21:43:36 -0000       1.4
@@ -40,7 +40,10 @@
     return boost::shared_ptr<EditorObj>(new 
EditorHotspot(static_cast<HotspotData>(*this)));
   }
 
-  std::string status_line () { return "Hotspot: " + to_string(pos); }
+  std::string status_line () { return "Hotspot: " 
+                                + to_string(pos.x) + ", "
+                                + to_string(pos.y) + ", "
+                                + to_string(pos.z); }
 };
 
 

Index: EntranceData.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/EntranceData.cc,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- EntranceData.cc     8 Jun 2002 20:19:53 -0000       1.5
+++ EntranceData.cc     8 Jun 2002 21:43:36 -0000       1.6
@@ -25,8 +25,6 @@
 #include "PingusError.hh"
 #include "StringConverter.hh"
 #include "XMLhelper.hh"
-#include "Position.hh"
-
 
 boost::shared_ptr<WorldObjData> 
 EntranceData::create(xmlDocPtr doc, xmlNodePtr cur)
@@ -104,7 +102,7 @@
     }
 
   (*xml) << "<entrance>\n";
-  XMLhelper::write_position_xml(xml, pos);
+  XMLhelper::write_vector_xml(xml, pos);
   (*xml) << "  <type>" << type << "</type>\n"
         << "  <direction>" << dir_str << "</direction>\n"
         << "  <release-rate>" << release_rate << "</release-rate>\n"

Index: Exit.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/Exit.cc,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- Exit.cc     20 Jan 2002 19:29:38 -0000      1.30
+++ Exit.cc     8 Jun 2002 21:43:36 -0000       1.31
@@ -47,7 +47,6 @@
     pos.x = pos.x + (sprite.get_width() / 2);
     pos.y = pos.y + sprite.get_height();
     use_old_pos_handling = false;
-    std::cout << "Exit:pos: " << pos << std::endl;
   }
 }
 

Index: ExitData.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/ExitData.cc,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- ExitData.cc 8 Jun 2002 20:19:53 -0000       1.8
+++ ExitData.cc 8 Jun 2002 21:43:36 -0000       1.9
@@ -22,7 +22,6 @@
 #include "ExitData.hh"
 #include "StringConverter.hh"
 #include "XMLhelper.hh"
-#include "Position.hh"
 
 void 
 ExitData::write_xml(std::ofstream* xml)
@@ -32,7 +31,7 @@
   // FIXME: Repair me
   //pos.x += surf.get_width ()/2;
   //pos.y += surf.get_height ();
-  XMLhelper::write_position_xml(xml, pos);
+  XMLhelper::write_vector_xml(xml, pos);
   
   XMLhelper::write_desc_xml(xml, desc);
   (*xml) << "  <owner-id>" << owner_id << "</owner-id>"

Index: HotspotData.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/HotspotData.cc,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- HotspotData.cc      8 Jun 2002 20:19:53 -0000       1.5
+++ HotspotData.cc      8 Jun 2002 21:43:36 -0000       1.6
@@ -21,14 +21,13 @@
 #include "EditorHotspot.hh"
 #include "HotspotData.hh"
 #include "XMLhelper.hh"
-#include "Position.hh"
 
 void 
 HotspotData::write_xml(std::ofstream* xml)
 {
   (*xml) << "<hotspot>\n";
   XMLhelper::write_desc_xml(xml, desc);
-  XMLhelper::write_position_xml(xml, pos);
+  XMLhelper::write_vector_xml(xml, pos);
   (*xml) << "  <speed>" << speed << "</speed>\n"
         << "  <parallax>" << para << "</parallax>\n"
         << "</hotspot>\n"

Index: LiquidData.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/LiquidData.cc,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- LiquidData.cc       8 Jun 2002 20:19:53 -0000       1.7
+++ LiquidData.cc       8 Jun 2002 21:43:36 -0000       1.8
@@ -23,7 +23,6 @@
 #include "StringConverter.hh"
 #include "LiquidData.hh"
 #include "XMLhelper.hh"
-#include "Position.hh"
 
 void 
 LiquidData::write_xml(std::ofstream* xml)
@@ -31,7 +30,7 @@
   std::cout << "LiquidData::write_xml(std::ofstream* xml)" << std::endl;
   (*xml) << "<liquid use-old-width-handling=\"" << int(old_width_handling) << 
"\">\n";
   XMLhelper::write_desc_xml(xml, desc);
-  XMLhelper::write_position_xml(xml, pos);
+  XMLhelper::write_vector_xml(xml, pos);
   (*xml) << "  <width>" << width << "</width>\n"
         << "  <speed>" << speed << "</speed>\n"
         << "</liquid>\n" << std::endl;

Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/Makefile.am,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -d -r1.75 -r1.76
--- Makefile.am 7 Jun 2002 19:10:33 -0000       1.75
+++ Makefile.am 8 Jun 2002 21:43:36 -0000       1.76
@@ -169,7 +169,6 @@
                  TargetProvider.hh    TargetProvider.cc \
                  PingusMapManager.hh  PingusMapManager.cc \
                  Color.hh              \
-                 Position.cc          Position.hh \
                  LayerManager.cc      LayerManager.hh \
                  Sprite.cc            Sprite.hh \
                  DeltaManager.hh \

Index: Playfield.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/Playfield.cc,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- Playfield.cc        8 Jun 2002 20:19:54 -0000       1.34
+++ Playfield.cc        8 Jun 2002 21:43:36 -0000       1.35
@@ -33,6 +33,7 @@
 #include "boost/smart_ptr.hpp"
 #include "PinguHolder.hh"
 #include "World.hh"
+#include "Server.hh"
 
 using boost::shared_ptr;
 

Index: Playfield.hh
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/Playfield.hh,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- Playfield.hh        8 Jun 2002 20:19:54 -0000       1.24
+++ Playfield.hh        8 Jun 2002 21:43:36 -0000       1.25
@@ -28,6 +28,7 @@
 #include "Client.hh"
 #include "Controller.hh"
 
+class Pingu;
 class World;
 class Server;
 class PinguInfo;

Index: SmallMap.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/SmallMap.cc,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- SmallMap.cc 8 Jun 2002 18:39:57 -0000       1.41
+++ SmallMap.cc 8 Jun 2002 21:43:36 -0000       1.42
@@ -33,6 +33,7 @@
 #include "SmallMap.hh"
 #include "PLF.hh"
 #include "ColMap.hh"
+#include "Server.hh"
 
 using namespace std;
 

Index: TrapData.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/TrapData.cc,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- TrapData.cc 8 Jun 2002 20:19:54 -0000       1.9
+++ TrapData.cc 8 Jun 2002 21:43:36 -0000       1.10
@@ -30,14 +30,13 @@
 #include "editor/PLFObj.hh"
 #include "XMLhelper.hh"
 #include "TrapData.hh"
-#include "Position.hh"
 
 void
 TrapData::write_xml(std::ofstream* xml)
 {
     (*xml) << "<trap>\n"
         << "  <type>" << type << "</type>\n";
-  XMLhelper::write_position_xml(xml, pos);
+  XMLhelper::write_vector_xml(xml, pos);
   (*xml) << "</trap>\n"
         << std::endl;
 }

Index: View.hh
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/View.hh,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- View.hh     8 Jun 2002 20:19:54 -0000       1.11
+++ View.hh     8 Jun 2002 21:43:36 -0000       1.12
@@ -24,6 +24,8 @@
 #include "Controller.hh"
 #include "CaptureRectangle.hh"
 
+class Pingu;
+
 class World;
 
 /** A class to controll the rentering of the playfield, each display on 

Index: XMLPLF.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/XMLPLF.cc,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- XMLPLF.cc   8 Jun 2002 20:19:54 -0000       1.43
+++ XMLPLF.cc   8 Jun 2002 21:43:36 -0000       1.44
@@ -32,7 +32,6 @@
 #include "TrapData.hh"
 #include "HotspotData.hh"
 #include "LiquidData.hh"
-#include "Position.hh"
 
 using namespace std;
 
@@ -176,9 +175,9 @@
       
       if (strcmp((char*)cur->name, "position") == 0)
        {
-         Position pos = XMLhelper::parse_position(doc, cur);
-         start_x_pos = pos.x_pos;
-         start_y_pos = pos.y_pos;
+         CL_Vector pos = XMLhelper::parse_vector(doc, cur);
+         start_x_pos = int(pos.x);
+         start_y_pos = int(pos.y);
        }
       else
        {

Index: XMLhelper.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/XMLhelper.cc,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- XMLhelper.cc        8 Jun 2002 20:19:54 -0000       1.16
+++ XMLhelper.cc        8 Jun 2002 21:43:36 -0000       1.17
@@ -17,10 +17,10 @@
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
+#include <ClanLib/Core/Math/cl_vector.h>
 #include <fstream>
 #include "StringConverter.hh"
 #include "XMLhelper.hh"
-#include "Position.hh"
 #include "Color.hh"
 #include "ResDescriptor.hh"
 
@@ -50,42 +50,6 @@
   return str;
 }
 
-
-
-Position
-XMLhelper::parse_position(xmlDocPtr doc, xmlNodePtr cur)
-{
-  Position pos;
-  cur = cur->children;  
-  while (cur != NULL)
-    {
-      if (xmlIsBlankNode(cur)) 
-       {
-         cur = cur->next;
-         continue;
-       }
-
-      char* ident = (char*)xmlNodeListGetString(doc, cur->children, 1);
-
-      if (ident)
-       {
-         //std::cout << "parse_position: ident = " << ident << std::endl;
-         if (strcmp((char*)cur->name, "x-pos") == 0) {
-           from_string (ident, pos.x_pos);
-         } else if (strcmp((char*)cur->name, "y-pos") == 0) {
-           from_string (ident, pos.y_pos);
-         } else if (strcmp((char*)cur->name, "z-pos") == 0) {
-           from_string (ident, pos.z_pos);
-         } else {
-           std::cout << "Unhandled position ident: " << ident << std::endl;
-         }
-         free(ident);
-       }
-      cur = cur->next;
-    }
-  return pos;
-}
-
 CL_Vector
 XMLhelper::parse_vector(xmlDocPtr doc, xmlNodePtr cur)
 {
@@ -329,16 +293,6 @@
     }
   
   (*xml) << "  </resource></surface>" << std::endl;
-}
-
-void
-XMLhelper::write_position_xml(std::ofstream* xml, Position pos)
-{
-  (*xml) << "  <position>\n"
-        << "    <x-pos>" << pos.x_pos << "</x-pos>\n"
-        << "    <y-pos>" << pos.y_pos << "</y-pos>\n"
-        << "    <z-pos>" << pos.z_pos << "</z-pos>\n"
-        << "  </position>\n";
 }
 
 void 

Index: XMLhelper.hh
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/XMLhelper.hh,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- XMLhelper.hh        8 Jun 2002 20:19:54 -0000       1.17
+++ XMLhelper.hh        8 Jun 2002 21:43:36 -0000       1.18
@@ -55,7 +55,6 @@
 
 class CL_Vector;
 class Color;
-class Position;
 class ResDescriptor;
 
 class XMLhelper
@@ -67,7 +66,6 @@
   /// A set of function to parse an xml file
   //@{
   static ResDescriptor parse_surface(xmlDocPtr doc, xmlNodePtr cur);
-  static Position      parse_position(xmlDocPtr doc, xmlNodePtr cur);
   static CL_Vector     parse_vector(xmlDocPtr doc, xmlNodePtr cur);
   static std::string   parse_string(xmlDocPtr doc, xmlNodePtr cur);
   static int           parse_int(xmlDocPtr doc, xmlNodePtr cur);
@@ -79,8 +77,6 @@
   //@{
   /** Writes the given res_desc to the ofstream */
   static void write_desc_xml(std::ofstream* xml, ResDescriptor desc);
-  /** Write a position to the xml ofstream */
-  static void write_position_xml(std::ofstream* xml, Position pos);
   /** Write a CL_Vector to an xml stream */
   static void write_vector_xml(std::ofstream* xml, const CL_Vector& pos);
   //@}




reply via email to

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