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 entrance_data.cxx,1.4,1


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src/worldobjsdata entrance_data.cxx,1.4,1.5 liquid_data.cxx,1.7,1.8 snow_generator_data.cxx,1.4,1.5 snow_generator_data.hxx,1.5,1.6
Date: 19 Feb 2003 17:17:04 -0000

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

Modified Files:
        entrance_data.cxx liquid_data.cxx snow_generator_data.cxx 
        snow_generator_data.hxx 
Log Message:
- added intesity to snow generator
- misc other stuff


Index: entrance_data.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjsdata/entrance_data.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- entrance_data.cxx   18 Feb 2003 01:23:52 -0000      1.4
+++ entrance_data.cxx   19 Feb 2003 17:17:01 -0000      1.5
@@ -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 "../editorobjs/entrance_obj.hxx"
 #include "../worldobjs/entrances/woodthing.hxx"
 #include "../worldobjs/entrances/cloud.hxx"
@@ -47,7 +48,7 @@
   reader.read_int("release-rate", release_rate);
   
   std::string direction_str;
-  reader.read_string("directorion-rate", direction_str);
+  reader.read_string("direction", direction_str);
 
   if (direction_str == "left")
     direction = EntranceData::LEFT;
@@ -56,16 +57,20 @@
   else if (direction_str == "misc")
     direction = EntranceData::MISC;
   else
-    direction = EntranceData::MISC;
+    {
+      std::cout << "EntranceData: Unknown direction: '" << direction_str << 
"'" << std::endl;
+      direction = EntranceData::MISC;
+    }
 }
 
-EntranceData::EntranceData (const EntranceData& old) : WorldObjData(old),
-                                                       
direction(old.direction),
-                                                      desc(old.desc),
-                                                      pos(old.pos),
-                                                      
release_rate(old.release_rate),
-                                                      owner_id(old.owner_id),
-                                                      type(old.type)
+EntranceData::EntranceData (const EntranceData& old)
+  : WorldObjData(old),
+    direction(old.direction),
+    desc(old.desc),
+    pos(old.pos),
+    release_rate(old.release_rate),
+    owner_id(old.owner_id),
+    type(old.type)
 {
 }
 

Index: liquid_data.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjsdata/liquid_data.cxx,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- liquid_data.cxx     18 Feb 2003 17:04:13 -0000      1.7
+++ liquid_data.cxx     19 Feb 2003 17:17:01 -0000      1.8
@@ -30,14 +30,14 @@
 LiquidData::LiquidData () 
   : old_width_handling(true),
     width(0),
-    speed(0)
+    speed(20)
 {
 }
 
 LiquidData::LiquidData (xmlDocPtr doc, xmlNodePtr cur)
   : old_width_handling(true),
     width(0),
-    speed(0)
+    speed(20)
 {
   if (XMLhelper::get_prop(cur, "use-old-width-handling", old_width_handling))
     {

Index: snow_generator_data.cxx
===================================================================
RCS file: 
/usr/local/cvsroot/Games/Pingus/src/worldobjsdata/snow_generator_data.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- snow_generator_data.cxx     28 Sep 2002 11:52:27 -0000      1.4
+++ snow_generator_data.cxx     19 Feb 2003 17:17:01 -0000      1.5
@@ -18,22 +18,32 @@
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #include <iostream>
+#include "../xml_file_reader.hxx"
 #include "../editor/weather_obj.hxx"
 #include "../worldobjs/snow_generator.hxx"
 #include "snow_generator_data.hxx"
 
 namespace WorldObjsData {
 
+SnowGeneratorData::SnowGeneratorData(xmlDocPtr doc, xmlNodePtr cur)
+{
+  XMLFileReader reader(doc, cur);
+  reader.read_float("intensity", intensity);
+}
+
 void
 SnowGeneratorData::write_xml(std::ostream& xml)
 {
-  xml << "<worldobj type=\"snow-generator\"/>" << std::endl;
+  xml << "<worldobj type=\"snow-generator\">"
+      << "  <intensity>" << intensity << "</intensity>\n"
+      << "</worldobj>\n"
+      << std::endl;
 }
 
 WorldObj*
 SnowGeneratorData::create_WorldObj ()
 {
-  return new WorldObjs::SnowGenerator();
+  return new WorldObjs::SnowGenerator(*this);
 }
 
 EditorObjLst

Index: snow_generator_data.hxx
===================================================================
RCS file: 
/usr/local/cvsroot/Games/Pingus/src/worldobjsdata/snow_generator_data.hxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- snow_generator_data.hxx     12 Oct 2002 00:49:11 -0000      1.5
+++ snow_generator_data.hxx     19 Feb 2003 17:17:01 -0000      1.6
@@ -28,9 +28,10 @@
 /** */
 class SnowGeneratorData : public WorldObjData
 {
-private:
 public:
-  SnowGeneratorData(xmlDocPtr doc, xmlNodePtr cur) { UNUSED_ARG(doc); 
UNUSED_ARG(cur); }
+  float intensity;
+public:
+  SnowGeneratorData(xmlDocPtr doc, xmlNodePtr cur);
   
   WorldObj* create_WorldObj ();
   EditorObjLst create_EditorObj ();





reply via email to

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