pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src/worldobjs snow_generator.cxx,1.2,1.3


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src/worldobjs snow_generator.cxx,1.2,1.3 snow_generator.hxx,1.2,1.3
Date: 16 Sep 2002 17:17:19 -0000

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

Modified Files:
        snow_generator.cxx snow_generator.hxx 
Log Message:
fixed snow/rain in the editor

Index: snow_generator.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/snow_generator.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- snow_generator.cxx  16 Sep 2002 16:04:58 -0000      1.2
+++ snow_generator.cxx  16 Sep 2002 17:17:17 -0000      1.3
@@ -40,6 +40,20 @@
   world->get_particle_holder()->add_particle(new CollidingSnowParticle(rand() 
% world->get_width(), -32));
 }
 
+void
+SnowGenerator::on_startup()
+{
+  for (int i = 0; i < 500; ++i) // FIXME: 500 is a random value, doesn't work 
very often
+    {
+      world->get_particle_holder()->add_particle(new SnowParticle(rand() % 
world->get_width(), 
+                                                                 rand() % 
world->get_height()));
+      world->get_particle_holder()->add_particle(new SnowParticle(rand() % 
world->get_width(), 
+                                                                 rand() % 
world->get_height()));
+      world->get_particle_holder()->add_particle(new 
CollidingSnowParticle(rand() % world->get_width(), 
+                                                                          
rand() % world->get_height())); 
+    }
+}
+
 } // namespace WorldObjs
 
 /* EOF */

Index: snow_generator.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/snow_generator.hxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- snow_generator.hxx  16 Sep 2002 16:04:58 -0000      1.2
+++ snow_generator.hxx  16 Sep 2002 17:17:17 -0000      1.3
@@ -30,10 +30,13 @@
 
 public:
   SnowGenerator ();
-  virtual ~SnowGenerator ();
+  ~SnowGenerator ();
 
-  virtual void update (float delta);
-  float get_z_pos () const { return 1000; }
+  /** fill the screen with snow flocks */
+  void on_startup();
+  void draw(GraphicContext&) {}
+  void update(float delta);
+  float get_z_pos() const { return 1000; }
 private:
   SnowGenerator (const SnowGenerator&);
   SnowGenerator operator= (const SnowGenerator&);





reply via email to

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