pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src/particles explosive_particle.cxx,1.1,


From: torangan
Subject: [Pingus-CVS] CVS: Games/Pingus/src/particles explosive_particle.cxx,1.1,1.2 particle.cxx,1.2,1.3 particle.hxx,1.3,1.4 pingu_particle.cxx,1.2,1.3 rain_particle.cxx,1.2,1.3 snow_particle.cxx,1.4,1.5
Date: 4 Sep 2002 14:55:14 -0000

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

Modified Files:
        explosive_particle.cxx particle.cxx particle.hxx 
        pingu_particle.cxx rain_particle.cxx snow_particle.cxx 
Log Message:
- removed traps
- various cleanup


Index: explosive_particle.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/particles/explosive_particle.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- explosive_particle.cxx      12 Jun 2002 19:11:31 -0000      1.1
+++ explosive_particle.cxx      4 Sep 2002 14:55:12 -0000       1.2
@@ -25,8 +25,8 @@
 #include "explosive_particle.hxx"
 
 ExplosiveParticle::ExplosiveParticle (int x, int y, float x_a, float y_a)
-  : Particle (x, y, x_a, y_a),
-    alive (true) 
+                                    : Particle (x, y, x_a, y_a),
+                                      alive (true) 
 {  
   sprite = Sprite (PingusResource::load_surface 
                   ("Particles/explosive",
@@ -53,14 +53,14 @@
       pos -= incr;
 
       if (pos.x < 0 || pos.y < 0 
-         || pos.x + 1 > world->get_width ()
-         || pos.y + 1 > world->get_height ())
+         || pos.x + 1 > WorldObj::get_world()->get_width ()
+         || pos.y + 1 > WorldObj::get_world()->get_height ())
        {
          alive = false;
          return;
        }
 
-      if (world->get_colmap ()->getpixel ((int) pos.x, (int) pos.y))
+      if (WorldObj::get_world()->get_colmap ()->getpixel ((int) pos.x, (int) 
pos.y))
        {
          detonate ();
        }
@@ -74,13 +74,13 @@
 {
   alive = false;
   CL_Surface bomber_radius = PingusResource::load_surface 
("Other/bomber_radius", "pingus");
-  world->get_particle_holder ()->add_pingu_explo((int)pos.x, (int)pos.y);
+  WorldObj::get_world()->get_particle_holder ()->add_pingu_explo((int)pos.x, 
(int)pos.y);
 
   // FIXME: Ugly do handle the colmap and the gfx map seperatly
-  world->get_colmap()->remove(bomber_radius,
+  WorldObj::get_world()->get_colmap()->remove(bomber_radius,
                              int(pos.x) - (bomber_radius.get_width()/2),
                              int(pos.y) - (bomber_radius.get_height()/2));
-  world->get_gfx_map()->remove(bomber_radius, 
+  WorldObj::get_world()->get_gfx_map()->remove(bomber_radius, 
                               int(pos.x) - (bomber_radius.get_width()/2),
                               int(pos.y) - (bomber_radius.get_height()/2));
 }

Index: particle.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/particles/particle.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- particle.cxx        13 Jun 2002 14:25:13 -0000      1.2
+++ particle.cxx        4 Sep 2002 14:55:12 -0000       1.3
@@ -26,9 +26,10 @@
 // Set all parameters to theire default value
 Particle::Particle(int x, int y, float x_a, float y_a)
   : pos (x, y),
-    velocity (x_a, y_a)
+    velocity (x_a, y_a),
+    livetime(50 + ( rand() % 25))
 {
-  livetime = 50 + ( rand() % 25);
+  
 }
 
 Particle::~Particle()

Index: particle.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/particles/particle.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- particle.hxx        23 Aug 2002 15:49:56 -0000      1.3
+++ particle.hxx        4 Sep 2002 14:55:12 -0000       1.4
@@ -24,9 +24,7 @@
 #include <ClanLib/Core/Math/cl_vector.h>
 #include <ClanLib/Display/Display/surface.h>
 
-#include "../worldobj.hxx"
-
-class Particle : public WorldObj
+class Particle
 {
 protected:
   CL_Surface surface;
@@ -39,25 +37,26 @@
 
   CL_Vector force;
   int livetime;
+  
 public:
-  Particle();
-  Particle(int x, int y, float x_a, float y_a);
-  virtual ~Particle();
+  Particle ();
+  Particle (int x, int y, float x_a, float y_a);
+  virtual ~Particle ();
 
   /// Reinit a allready created particle with now coordinates
-  virtual void init(int x, int y, float x_a, float y_a);
+  virtual void init (int x, int y, float x_a, float y_a);
 
   /** If false is returned the particle gets deleted by the
       ParticleHolder */
-  virtual bool is_alive(void);
+  virtual bool is_alive (void);
 
-  virtual float get_z_pos() const { return pos.z; }
+  float get_z_pos () const { return pos.z; }
 
   /// Let the particle move
-  virtual void update(float delta);
+  virtual void update (float delta);
 
   /// Draw the particle with the correct zoom resize
-  virtual void draw_offset(int, int, float);
+  virtual void draw_offset (int, int, float);
   
 private:
   Particle (const Particle&);

Index: pingu_particle.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/particles/pingu_particle.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- pingu_particle.cxx  28 Jun 2002 17:48:42 -0000      1.2
+++ pingu_particle.cxx  4 Sep 2002 14:55:12 -0000       1.3
@@ -21,6 +21,7 @@
 #include "../world.hxx"
 #include "../algo.hxx"
 #include "../pingus_resource.hxx"
+#include "../worldobj.hxx"
 #include "pingu_particle.hxx"
 
 static const float x_collision_decrease = 0.3f;
@@ -94,7 +95,7 @@
     {
       for (tmp_y_add = velocity.y; tmp_y_add >= 1.0; tmp_y_add -= 1.0)
        {
-         if (world->get_colmap()->getpixel((int)pos.x, (int)pos.y)) 
+         if (WorldObj::get_world()->get_colmap()->getpixel((int)pos.x, 
(int)pos.y)) 
            {
              velocity.y = velocity.y * -y_collision_decrease;
              tmp_y_add = -tmp_y_add;
@@ -109,7 +110,7 @@
     {
       for (tmp_y_add = velocity.y; tmp_y_add <= -1.0; tmp_y_add += 1.0)
        {
-         if (world->get_colmap()->getpixel((int)pos.x, (int)pos.y)) {
+         if (WorldObj::get_world()->get_colmap()->getpixel((int)pos.x, 
(int)pos.y)) {
            velocity.y = velocity.y * -y_collision_decrease;
            tmp_y_add = -tmp_y_add;
            pos.y += 1.0;
@@ -124,7 +125,7 @@
     {
       for (tmp_x_add = velocity.x; tmp_x_add >= 1.0; tmp_x_add -= 1.0)
        {
-         if (world->get_colmap()->getpixel((int)pos.x, (int)pos.y)) {
+         if (WorldObj::get_world()->get_colmap()->getpixel((int)pos.x, 
(int)pos.y)) {
            velocity.x = velocity.x * -x_collision_decrease;
            tmp_x_add = -tmp_x_add;
            pos.x -= 1.0;
@@ -138,7 +139,7 @@
     {
       for (tmp_x_add = velocity.x; tmp_x_add <= -1.0; tmp_x_add += 1.0)
        {
-         if (world->get_colmap()->getpixel((int)pos.x, (int)pos.y)) {
+         if (WorldObj::get_world()->get_colmap()->getpixel((int)pos.x, 
(int)pos.y)) {
            velocity.x = velocity.x * -x_collision_decrease;
            tmp_x_add = -tmp_x_add;
            pos.x += 1.0;

Index: rain_particle.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/particles/rain_particle.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- rain_particle.cxx   25 Jun 2002 18:15:18 -0000      1.2
+++ rain_particle.cxx   4 Sep 2002 14:55:12 -0000       1.3
@@ -21,6 +21,7 @@
 #include "../algo.hxx"
 #include "../pingus_resource.hxx"
 #include "../col_map.hxx"
+#include "../worldobj.hxx"
 #include "rain_particle.hxx"
 
 CL_Surface RainParticle::rain1_surf;
@@ -97,14 +98,14 @@
     }
   else
     {
-      if (world->get_colmap()->getpixel(int(pos.x), int(pos.y)) != 
GroundpieceData::GP_NOTHING
-         && world->get_colmap()->getpixel(int(pos.x), int(pos.y)) !=  
GroundpieceData::GP_OUTOFSCREEN)
+      if (WorldObj::get_world()->get_colmap()->getpixel(int(pos.x), 
int(pos.y)) != GroundpieceData::GP_NOTHING
+         && WorldObj::get_world()->get_colmap()->getpixel(int(pos.x), 
int(pos.y)) !=  GroundpieceData::GP_OUTOFSCREEN)
        {
          splash = true;
        }
       else
        {
-         if (pos.y > world->get_height())
+         if (pos.y > WorldObj::get_world()->get_height())
            alive = false;
     
          pos.x -= 5.0 * add;

Index: snow_particle.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/particles/snow_particle.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- snow_particle.cxx   25 Jun 2002 18:15:18 -0000      1.4
+++ snow_particle.cxx   4 Sep 2002 14:55:12 -0000       1.5
@@ -83,7 +83,7 @@
 bool
 SnowParticle::is_alive()
 {
-  if (pos.y < world->get_height())
+  if (pos.y < WorldObj::get_world()->get_height())
     return true;
   else
     return false;
@@ -114,13 +114,13 @@
   assert(ground_snow);
   SnowParticle::update(delta);
 
-  int pixel = world->get_colmap()->getpixel(int(pos.x), int(pos.y));
+  int pixel = WorldObj::get_world()->get_colmap()->getpixel(int(pos.x), 
int(pos.y));
 
   if (pixel != GroundpieceData::GP_NOTHING && pixel !=  
GroundpieceData::GP_WATER
       && pixel != GroundpieceData::GP_OUTOFSCREEN)
     {
       //std::cout << "Snow: touch down: " << x_pos << " " << y_pos << 
std::endl;
-      world->get_gfx_map()->put(ground_snow,
+      WorldObj::get_world()->get_gfx_map()->put(ground_snow,
                                (int)pos.x - 1,
                                (int)pos.y - 1);
       alive = false;





reply via email to

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