pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src Makefile.am,1.99,1.100 exit.cxx,1.6,1


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src Makefile.am,1.99,1.100 exit.cxx,1.6,1.7 exit.hxx,1.4,1.5 groundpiece_data.hxx,1.12,1.13 hotspot_data.hxx,1.5,1.6 liquid.cxx,1.5,1.6 liquid.hxx,1.4,1.5 plf.cxx,1.7,1.8 plf.hxx,1.5,1.6 spot_map.cxx,1.13,1.14 world.cxx,1.23,1.24 worldobj.cxx,1.7,1.8 worldobj.hxx,1.6,1.7 worldobj_data_factory.cxx,1.14,1.15 xml_plf.cxx,1.17,1.18
Date: 16 Sep 2002 15:47:37 -0000

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

Modified Files:
        Makefile.am exit.cxx exit.hxx groundpiece_data.hxx 
        hotspot_data.hxx liquid.cxx liquid.hxx plf.cxx plf.hxx 
        spot_map.cxx world.cxx worldobj.cxx worldobj.hxx 
        worldobj_data_factory.cxx xml_plf.cxx 
Log Message:
- made weather thingies real worldobjs

Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/Makefile.am,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -d -r1.99 -r1.100
--- Makefile.am 15 Sep 2002 20:33:45 -0000      1.99
+++ Makefile.am 16 Sep 2002 15:47:35 -0000      1.100
@@ -327,8 +327,6 @@
 view.hxx \
 wav_provider.cxx \
 wav_provider.hxx \
-weather_data.cxx \
-weather_data.hxx \
 world.cxx \
 world.hxx \
 world_impl.hxx \

Index: exit.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/exit.cxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- exit.cxx    4 Sep 2002 19:40:19 -0000       1.6
+++ exit.cxx    16 Sep 2002 15:47:35 -0000      1.7
@@ -56,7 +56,7 @@
 }
 
 void
-Exit::draw_colmap()
+Exit::on_startup()
 {
   world->get_colmap()->remove(sprite.get_surface (), 
                              int(pos.x) - sprite.get_width ()/2,

Index: exit.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/exit.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- exit.hxx    4 Sep 2002 19:40:19 -0000       1.4
+++ exit.hxx    16 Sep 2002 15:47:35 -0000      1.5
@@ -35,7 +35,7 @@
   Exit(const ExitData& data);
   ~Exit();
   
-  void  draw_colmap();
+  void  on_startup();
   void  draw (GraphicContext& gc);
   void  update (float delta);
   float get_z_pos() const { return (int) pos.z; }

Index: groundpiece_data.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/groundpiece_data.hxx,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- groundpiece_data.hxx        4 Sep 2002 14:55:11 -0000       1.12
+++ groundpiece_data.hxx        16 Sep 2002 15:47:35 -0000      1.13
@@ -27,8 +27,9 @@
 #include "worldobj_data.hxx"
 
 class EditorObj;
+class WorldObj;
 
-class GroundpieceData 
+class GroundpieceData : public WorldObjData
 {
 public:
   CL_Surface surface;
@@ -55,9 +56,11 @@
   GroundpieceData (const GroundpieceData& old);
   GroundpieceData operator= (const GroundpieceData& old);
 
-  virtual ~GroundpieceData ();
+  ~GroundpieceData ();
 
+  WorldObj*    create_WorldObj() { return 0; }
   EditorObjLst create_EditorObj();
+
   void write_xml(std::ostream& xml);
 
   static GPType string_to_type(const std::string& arg_type);

Index: hotspot_data.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/hotspot_data.hxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- hotspot_data.hxx    23 Aug 2002 15:49:49 -0000      1.5
+++ hotspot_data.hxx    16 Sep 2002 15:47:35 -0000      1.6
@@ -43,7 +43,6 @@
   HotspotData (const HotspotData& old);
   HotspotData operator= (const HotspotData& old);
 
-
   void clean() {
     pos.x = 0;
     pos.y = 0;

Index: liquid.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/liquid.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- liquid.cxx  14 Sep 2002 19:06:33 -0000      1.5
+++ liquid.cxx  16 Sep 2002 15:47:35 -0000      1.6
@@ -43,7 +43,7 @@
 }
 
 void
-Liquid::draw_colmap()
+Liquid::on_startup()
 {
   CL_Surface sur = PingusResource::load_surface("Liquid/water_cmap", "global");
 

Index: liquid.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/liquid.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- liquid.hxx  4 Sep 2002 19:40:19 -0000       1.4
+++ liquid.hxx  16 Sep 2002 15:47:35 -0000      1.5
@@ -36,11 +36,11 @@
   CL_Surface colmap_sur;
 
   Liquid(const LiquidData&);
-  virtual ~Liquid();
+  ~Liquid();
 
-  float get_z_pos() const { return (int) pos.z; }
-  void draw_colmap();
-  void draw (GraphicContext& gc);
+  float get_z_pos () const { return (int) pos.z; }
+  void  on_startup();
+  void  draw      (GraphicContext& gc);
   
 private:
   Liquid (const Liquid&);

Index: plf.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/plf.cxx,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- plf.cxx     14 Sep 2002 23:46:58 -0000      1.7
+++ plf.cxx     16 Sep 2002 15:47:35 -0000      1.8
@@ -151,13 +151,6 @@
   return groundpieces;
 }
 
-std::vector<WeatherData>   
-PLF::get_weather(void)
-{
-  return weathers;
-}
-
-///
 std::vector<WorldObjData*> 
 PLF::get_worldobjs_data ()
 {

Index: plf.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/plf.hxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- plf.hxx     14 Sep 2002 23:40:35 -0000      1.5
+++ plf.hxx     16 Sep 2002 15:47:35 -0000      1.6
@@ -22,7 +22,6 @@
 
 #include <map>
 #include "action_data.hxx"
-#include "weather_data.hxx"
 #include "groundpiece_data.hxx"
 
 class WorldObjData;
@@ -86,9 +85,8 @@
   /** levels flagged with playable=false are not playable or havn't been yet 
tested */
   bool playable;
   
-  std::vector<ActionData>   actions;
+  std::vector<ActionData>       actions;
   std::vector<GroundpieceData>  groundpieces;
-  std::vector<WeatherData>  weathers;
 
   /** FIXME: PLF should probally become and interface only, it currently is a
       bit overfull */
@@ -146,9 +144,8 @@
   /** Returns the name of the author, who creates this level */
   std::string get_author();
 
-  std::vector<ActionData>    get_actions(void);
-  std::vector<GroundpieceData>   get_groundpieces(void);
-  std::vector<WeatherData>   get_weather(void);
+  std::vector<ActionData>      get_actions(void);
+  std::vector<GroundpieceData> get_groundpieces(void);
 
   /** Return a access to the worldobj_data, the caller must not delete
       anything in this vector */

Index: spot_map.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/spot_map.cxx,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- spot_map.cxx        14 Sep 2002 23:31:12 -0000      1.13
+++ spot_map.cxx        16 Sep 2002 15:47:35 -0000      1.14
@@ -78,6 +78,7 @@
 void
 MapTileSurface::check_empty()
 {
+  // FIXME: obsolete
   CL_SurfaceProvider* provider = surface.get_provider();
   unsigned char* buffer;
   int lenght;

Index: world.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/world.cxx,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- world.cxx   14 Sep 2002 22:41:31 -0000      1.23
+++ world.cxx   16 Sep 2002 15:47:35 -0000      1.24
@@ -27,7 +27,6 @@
 #include "view.hxx"
 #include "world.hxx"
 #include "particles/particle_holder.hxx"
-#include "particles/weather_generator.hxx"
 #include "pingu.hxx"
 #include "game_time.hxx"
 
@@ -88,16 +87,8 @@
 void
 World::init_worldobjs(PLF* plf)
 {
-  vector<WeatherData>   weather_d  = plf->get_weather();
   vector<WorldObjData*> worldobj_d = plf->get_worldobjs_data ();
 
-  for(vector<WeatherData>::iterator i = weather_d.begin();
-      i != weather_d.end();
-      ++i)
-    {
-      world_obj.push_back(WeatherGenerator::create(*i));
-    }
-
   for (vector<WorldObjData*>::iterator i = worldobj_d.begin ();
        i != worldobj_d.end ();
        ++i)
@@ -118,9 +109,10 @@
    //world_obj->sort(WorldObj_less);
    std::stable_sort (world_obj.begin (), world_obj.end (), WorldObj_less);
 
-  // Drawing all world objs to the colmap
+  // Drawing all world objs to the colmap, gfx, or what ever the
+  // objects want to do
   for(WorldObjIter obj = world_obj.begin(); obj != world_obj.end(); ++obj)
-    (*obj)->draw_colmap();
+    (*obj)->on_startup();
 
   // Setup the gravity force
   // Clear all old forces
@@ -361,12 +353,12 @@
   double distance = -1.0;
 
   for (PinguIter i = pingus->begin (); i != pingus->end (); ++i) {
-    if ((*i)->is_over (int(pos.x), int(pos.y)))
+    if ((*i)->is_over(int(pos.x), int(pos.y)))
       {
-       if (distance == -1.0f || distance >= (*i)->dist ((int) pos.x, 
(int)pos.y))
+       if (distance == -1.0f || distance >= (*i)->dist((int) pos.x, 
(int)pos.y))
          {
            current_pingu = (*i);
-           distance = (*i)->dist ((int)pos.x, (int)pos.y);
+           distance = (*i)->dist((int)pos.x, (int)pos.y);
          }
       }
   }

Index: worldobj.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobj.cxx,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- worldobj.cxx        14 Sep 2002 19:06:33 -0000      1.7
+++ worldobj.cxx        16 Sep 2002 15:47:35 -0000      1.8
@@ -42,7 +42,7 @@
 }
 
 void
-WorldObj::draw_colmap()
+WorldObj::on_startup()
 {
   // do nothing
 }

Index: worldobj.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobj.hxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- worldobj.hxx        4 Sep 2002 17:49:48 -0000       1.6
+++ worldobj.hxx        16 Sep 2002 15:47:35 -0000      1.7
@@ -69,9 +69,9 @@
   /** Draw the WorldObj to the given GraphicContext */
   virtual void draw (GraphicContext& gc);
 
-  /** Draws the objects collision map to the main collision map, this
-   *  can be used for traps which need a solid ground. */
-  virtual void draw_colmap ();
+  /** Draws the objects collision map to the main collision map, draws
+      stuff onto the gfx map or do other manipulations to the World */
+  virtual void on_startup ();
 
   /** The update function is called once a game loop, the delta
    * specifies how much time is passed since the last update

Index: worldobj_data_factory.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobj_data_factory.cxx,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- worldobj_data_factory.cxx   15 Sep 2002 21:21:47 -0000      1.14
+++ worldobj_data_factory.cxx   16 Sep 2002 15:47:35 -0000      1.15
@@ -46,6 +46,8 @@
 #include "worldobjsdata/spike_data.hxx"
 #include "worldobjsdata/switch_door_data.hxx"
 #include "worldobjsdata/teleporter_data.hxx"
+#include "worldobjsdata/rain_generator_data.hxx"
+#include "worldobjsdata/snow_generator_data.hxx"
 
 using namespace WorldObjsData;
 
@@ -91,6 +93,13 @@
       new 
WorldObjDataFactoryImpl<StarfieldBackgroundData>("starfield-background");
       new 
WorldObjDataFactoryImpl<SolidColorBackgroundData>("solidcolor-background");
       new 
WorldObjDataFactoryImpl<ThunderstormBackgroundData>("thunderstorm-background");
+
+      // Weather
+      new WorldObjDataFactoryImpl<SnowGeneratorData>("snow-generator");
+      new WorldObjDataFactoryImpl<RainGeneratorData>("rain-generator");
+      // Weather-Backward compability
+      new WorldObjDataFactoryImpl<SnowGeneratorData>("rain");
+      new WorldObjDataFactoryImpl<RainGeneratorData>("snow");
     }
 
   return instance_;

Index: xml_plf.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/xml_plf.cxx,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- xml_plf.cxx 16 Sep 2002 10:18:51 -0000      1.17
+++ xml_plf.cxx 16 Sep 2002 15:47:35 -0000      1.18
@@ -148,7 +148,7 @@
            }
          else if (XMLhelper::equal_str(cur->name, "weather"))
            {
-             parse_weather(cur);
+             worldobjs_data.push_back(WorldObjDataFactory::instance()->create 
(doc, cur));
            }     
          else
            {
@@ -212,8 +212,8 @@
        }
       else if (XMLhelper::equal_str(cur->name, "weather"))
        {
-         parse_weather(cur);
-       }         
+         worldobjs_data.push_back(WorldObjDataFactory::instance()->create 
(doc, cur));
+       }
       else
        {
          printf("XMLPLF: Unhandled parse_group: %s\n", reinterpret_cast<const 
char*>(cur->name));
@@ -247,34 +247,6 @@
        }
       cur = cur->next;
     }
-}
-
-void
-XMLPLF::parse_weather (xmlNodePtr cur)
-{
-  WeatherData weather;
-  cur = cur->children;
-
-  while (cur)
-    {
-      if (xmlIsBlankNode(cur)) 
-       {
-         cur = cur->next;
-         continue;
-       }
-      
-      if (XMLhelper::equal_str(cur->name, "type"))
-       {
-         weather.type = XMLhelper::parse_string(doc, cur);
-       }
-      else
-       {
-         std::cout << "XMLPLF: Unhandled: " << cur->name << std::endl;
-       }
-      cur = cur->next;
-    }
-    
-  weathers.push_back(weather);
 }
 
 void 





reply via email to

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