[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src/particles pingu_particle_holder.cxx,
From: |
torangan |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src/particles pingu_particle_holder.cxx,NONE,1.1 pingu_particle_holder.hxx,NONE,1.1 rain_particle_holder.cxx,NONE,1.1 rain_particle_holder.hxx,NONE,1.1 smoke_particle_holder.cxx,NONE,1.1smoke_particle_holder.hxx,NONE,1.1 snow_particle_holder.cxx,NONE,1.1 snow_particle_holder.hxx,NONE,1.1 Makefile.am,1.8,1.9 explosive_particle.cxx,1.4,1.5 explosive_particle.hxx,1.4,1.5 ground_particle.cxx,1.2,1.3 ground_particle.hxx,1.4,1.5 particle.cxx,1.4,NONE particle.hxx,1.7,NONE particle_cache.cxx,1.4,NONE particle_cache.hxx,1.5,NONE particle_holder.cxx,1.7,NONE particle_holder.hxx,1.6,NONE pingu_particle.cxx,1.4,NONE pingu_particle.hxx,1.6,NONE rain_particle.cxx,1.5,NONE rain_particle.hxx,1.5,NONE smoke_particle.cxx,1.4,NONE smoke_particle.hxx,1.5,NONE snow_particle.cxx,1.6,NONE snow_particle.hxx,1.4,NONE |
Date: |
28 Dec 2002 16:10:20 -0000 |
Update of /usr/local/cvsroot/Games/Pingus/src/particles
In directory dark:/tmp/cvs-serv31100/particles
Modified Files:
Makefile.am explosive_particle.cxx explosive_particle.hxx
ground_particle.cxx ground_particle.hxx
Added Files:
pingu_particle_holder.cxx pingu_particle_holder.hxx
rain_particle_holder.cxx rain_particle_holder.hxx
smoke_particle_holder.cxx smoke_particle_holder.hxx
snow_particle_holder.cxx snow_particle_holder.hxx
Removed Files:
particle.cxx particle.hxx particle_cache.cxx
particle_cache.hxx particle_holder.cxx particle_holder.hxx
pingu_particle.cxx pingu_particle.hxx rain_particle.cxx
rain_particle.hxx smoke_particle.cxx smoke_particle.hxx
snow_particle.cxx snow_particle.hxx
Log Message:
rewrite of particle system
--- NEW FILE: pingu_particle_holder.cxx ---
// $Id: pingu_particle_holder.cxx,v 1.1 2002/12/28 16:10:18 torangan Exp $
//
// Pingus - A free Lemmings clone
// Copyright (C) 1999 Ingo Ruhnke <address@hidden>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "../algo.hxx"
#include "../col_map.hxx"
#include "../graphic_context.hxx"
#include "../pingus_resource.hxx"
#include "../world.hxx"
#include "pingu_particle_holder.hxx"
const float x_collision_decrease = 0.3f;
const float y_collision_decrease = 0.6f;
PinguParticleHolder::PinguParticle::PinguParticle (int x, int y)
: livetime(50 + (rand() % 50)),
pos(Vector(x, y)),
velocity(Vector(frand() * 7 - 3.5, frand() * -7))
{
}
PinguParticleHolder::PinguParticleHolder ()
: surface(PingusResource::load_surface("Particles/particle", "pingus"))
{
}
void
PinguParticleHolder::add_particle (int x, int y)
{
int i = 0;
// fill gaps from dead entries
for (std::vector<PinguParticle>::iterator it=particles.begin(); i < 50 && it
!= particles.end(); ++i, ++it)
{
if (!it->livetime)
{
*it = PinguParticle(x, y);
break;
}
}
// create remaining entries
for (; i < 50; ++i)
particles.push_back(PinguParticle(x, y));
}
void
PinguParticleHolder::update ()
{
// update all contained particles
for (std::vector<PinguParticle>::iterator it=particles.begin(); it !=
particles.end(); ++it)
{
// skip dead particles
if (!it->livetime)
continue;
float tmp_x_add = 0.0f;
float tmp_y_add = 0.0f;
// Simulated gravity
it->velocity.y += 0.2f;
if (it->velocity.y > 0)
{
for (tmp_y_add = it->velocity.y; tmp_y_add >= 1.0; --tmp_y_add)
{
if (world->get_colmap()->getpixel(static_cast<int>(it->pos.x),
static_cast<int>(it->pos.y)))
{
it->velocity.y *= -y_collision_decrease;
tmp_y_add = -tmp_y_add;
--it->pos.y;
break;
}
++it->pos.y;
}
it->pos.y += tmp_y_add;
}
else
{
for (tmp_y_add = it->velocity.y; tmp_y_add <= -1.0; ++tmp_y_add)
{
if (world->get_colmap()->getpixel(static_cast<int>(it->pos.x),
static_cast<int>(it->pos.y)))
{
it->velocity.y *= -y_collision_decrease;
tmp_y_add = -tmp_y_add;
++it->pos.y;
break;
}
--it->pos.y;
}
it->pos.y += tmp_y_add;
}
if (it->velocity.x > 0)
{
for (tmp_x_add = it->velocity.x; tmp_x_add >= 1.0; --tmp_x_add)
{
if (world->get_colmap()->getpixel(static_cast<int>(it->pos.x),
static_cast<int>(it->pos.y)))
{
it->velocity.x *= -x_collision_decrease;
tmp_x_add = -tmp_x_add;
--it->pos.x;
break;
}
++it->pos.x;
}
it->pos.x += tmp_x_add;
}
else
{
for (tmp_x_add = it->velocity.x; tmp_x_add <= -1.0; ++tmp_x_add)
{
if (world->get_colmap()->getpixel(static_cast<int>(it->pos.x),
static_cast<int>(it->pos.y)))
{
it->velocity.x *= -x_collision_decrease;
tmp_x_add = -tmp_x_add;
++it->pos.x;
break;
}
--it->pos.x;
}
it->pos.x += tmp_x_add;
}
--it->livetime;
}
}
void
PinguParticleHolder::draw (GraphicContext& gc)
{
for (std::vector<PinguParticle>::iterator it=particles.begin(); it !=
particles.end(); ++it)
{
// skip dead particles
if (!it->livetime)
continue;
gc.draw(surface, it->pos);
}
}
/* EOF */
--- NEW FILE: pingu_particle_holder.hxx ---
// $Id: pingu_particle_holder.hxx,v 1.1 2002/12/28 16:10:18 torangan Exp $
//
// Pingus - A free Lemmings clone
// Copyright (C) 1999 Ingo Ruhnke <address@hidden>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef HEADER_PINGUS_PARTICLES_PINGU_PARTICLE_HOLDER_HXX
#define HEADER_PINGUS_PARTICLES_PINGU_PARTICLE_HOLDER_HXX
#include <vector>
#include <ClanLib/Display/Display/surface.h>
#include "../vector.hxx"
#include "../worldobj.hxx"
class GraphicContext;
class PinguParticleHolder : public WorldObj
{
struct PinguParticle {
int livetime;
/// The current position of the particle
Vector pos;
/// The velocity of the particle
Vector velocity;
PinguParticle (int x, int y);
};
private:
CL_Surface surface;
std::vector<PinguParticle> particles;
public:
PinguParticleHolder ();
void add_particle (int x, int y);
float get_z_pos () const { return 1000.0f; }
/// Let the particle move
void update ();
/// Draw the particle with the correct zoom resize
void draw (GraphicContext& gc);
private:
PinguParticleHolder (const PinguParticleHolder&);
PinguParticleHolder& operator= (const PinguParticleHolder&);
};
#endif
/* EOF */
--- NEW FILE: rain_particle_holder.cxx ---
// $Id: rain_particle_holder.cxx,v 1.1 2002/12/28 16:10:18 torangan Exp $
//
// Pingus - A free Lemmings clone
// Copyright (C) 1999 Ingo Ruhnke <address@hidden>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "../algo.hxx"
#include "../col_map.hxx"
#include "../globals.hxx"
#include "../graphic_context.hxx"
#include "../pingus_resource.hxx"
#include "../world.hxx"
#include "rain_particle_holder.hxx"
RainParticleHolder::RainParticle::RainParticle(int x, int y)
: alive(true), splash(false), use_rain2_surf(false), splash_counter(0),
splash_frame(0), pos(Vector(x, y))
{
use_rain2_surf = ((rand() % 3) == 0);
pos.z = 1.0 + frand() * 3.0;
}
RainParticleHolder::RainParticleHolder ()
: rain1_surf (PingusResource::load_surface("Particles/rain1", "pingus")),
rain2_surf (PingusResource::load_surface("Particles/rain2", "pingus")),
rain_splash(PingusResource::load_surface("Particles/rain_splash", "pingus"))
{
}
void
RainParticleHolder::add_particle (int x, int y)
{
// search for dead entry to replace
for (std::vector<RainParticle>::iterator it=particles.begin(); it !=
particles.end(); ++it)
if (!it->alive)
{
*it = RainParticle(x, y);
return;
}
// create new entry
particles.push_back(RainParticle(x, y));
}
void
RainParticleHolder::update ()
{
// update all contained particles
for (std::vector<RainParticle>::iterator it=particles.begin(); it !=
particles.end(); ++it)
{
// skip dead particles
if (!it->alive)
continue;
if (it->splash)
{
if (it->splash_frame >= rain_splash.get_num_frames())
{
it->alive = false;
continue;
}
it->splash_frame += 10 * game_speed / 1000.0f;
(it->splash_counter == 3) ? it->alive = false :
++it->splash_counter;
}
else
{
if ( world->get_colmap()->getpixel(static_cast<int>(it->pos.x),
static_cast<int>(it->pos.y)) != Groundtype::GP_NOTHING
&& world->get_colmap()->getpixel(static_cast<int>(it->pos.x),
static_cast<int>(it->pos.y)) != Groundtype::GP_OUTOFSCREEN
&& ((rand() % 2) == 0))
{
it->splash = true;
}
else
{
if (it->pos.y > world->get_height())
{
it->alive = false;
continue;
}
it->pos.x -= 5 * it->pos.z;
it->pos.y += 16 * it->pos.z;
}
}
}
}
void
RainParticleHolder::draw (GraphicContext& gc)
{
for (std::vector<RainParticle>::iterator it=particles.begin(); it !=
particles.end(); ++it)
{
// skip dead particles
if (!it->alive)
continue;
if (it->splash)
gc.draw(rain_splash, it->pos, static_cast<int>(it->splash_frame));
else
if (it->use_rain2_surf)
gc.draw(rain2_surf, static_cast<int>(it->pos.x),
static_cast<int>(it->pos.y - rain1_surf.get_height()));
else
gc.draw(rain1_surf, static_cast<int>(it->pos.x),
static_cast<int>(it->pos.y - rain1_surf.get_height()));
}
}
/* EOF */
--- NEW FILE: rain_particle_holder.hxx ---
// $Id: rain_particle_holder.hxx,v 1.1 2002/12/28 16:10:18 torangan Exp $
//
// Pingus - A free Lemmings clone
// Copyright (C) 1999 Ingo Ruhnke <address@hidden>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef HEADER_PINGUS_PARTICLES_RAIN_PARTICLE_HOLDER_HXX
#define HEADER_PINGUS_PARTICLES_RAIN_PARTICLE_HOLDER_HXX
#include <vector>
#include <ClanLib/Display/Display/surface.h>
#include "../vector.hxx"
#include "../worldobj.hxx"
class GraphicContext;
class RainParticleHolder : public WorldObj
{
struct RainParticle {
bool alive;
bool splash;
bool use_rain2_surf;
int splash_counter;
float splash_frame;
// pos.z contains a modificator for x and y pos
Vector pos;
RainParticle(int x, int y);
};
private:
CL_Surface rain1_surf;
CL_Surface rain2_surf;
CL_Surface rain_splash;
std::vector<RainParticle> particles;
public:
RainParticleHolder ();
void add_particle(int x, int y);
float get_z_pos () const { return 1000.0f; }
/// Let the particle move
void update ();
/// Draw the particle with the correct zoom resize
void draw (GraphicContext& gc);
private:
RainParticleHolder (const RainParticleHolder&);
RainParticleHolder& operator= (const RainParticleHolder&);
};
#endif
/* EOF */
--- NEW FILE: smoke_particle_holder.cxx ---
// $Id: smoke_particle_holder.cxx,v 1.1 2002/12/28 16:10:18 torangan Exp $
//
// Pingus - A free Lemmings clone
// Copyright (C) 1999 Ingo Ruhnke <address@hidden>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "../globals.hxx"
#include "../graphic_context.hxx"
#include "../pingus_resource.hxx"
#include "smoke_particle_holder.hxx"
SmokeParticleHolder::SmokeParticle::SmokeParticle (int x, int y, float vel_x,
float vel_y)
: pos(Vector(x,y)), velocity(Vector(vel_x, vel_y))
{
time = livetime = 25 + (rand() % 10);
use_surf2 = rand() % 2;
}
SmokeParticleHolder::SmokeParticleHolder ()
: surf1(PingusResource::load_surface("Particles/smoke", "pingus")),
surf2(PingusResource::load_surface("Particles/smoke2", "pingus"))
{
}
void
SmokeParticleHolder::add_particle (int x, int y, float vel_x, float vel_y)
{
// search for dead entry to replace
for (std::vector<SmokeParticle>::iterator it=particles.begin(); it !=
particles.end(); ++it)
if (!it->livetime)
{
*it = SmokeParticle(x, y, vel_x, vel_y);
return;
}
// create new entry
particles.push_back(SmokeParticle(x, y, vel_x, vel_y));
}
void
SmokeParticleHolder::update ()
{
// update all contained particles
for (std::vector<SmokeParticle>::iterator it=particles.begin(); it !=
particles.end(); ++it)
{
// skip dead particles
if (!it->livetime)
continue;
it->pos.x += it->velocity.x;
it->pos.y += it->velocity.y;
--it->livetime;
}
}
void
SmokeParticleHolder::draw (GraphicContext& gc)
{
for (std::vector<SmokeParticle>::iterator it=particles.begin(); it !=
particles.end(); ++it)
{
if (!it->livetime)
continue;
if (!it->use_surf2)
gc.draw(surf1, it->pos);
else
gc.draw(surf2, it->pos);
}
}
/* EOF */
--- NEW FILE: smoke_particle_holder.hxx ---
// $Id: smoke_particle_holder.hxx,v 1.1 2002/12/28 16:10:18 torangan Exp $
//
// Pingus - A free Lemmings clone
// Copyright (C) 1999 Ingo Ruhnke <address@hidden>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef HEADER_PINGUS_PARTICLES_SMOKE_PARTICLE_HOLDER_HXX
#define HEADER_PINGUS_PARTICLES_SMOKE_PARTICLE_HOLDER_HXX
#include <vector>
#include <ClanLib/Display/Display/surface.h>
#include "../vector.hxx"
#include "../worldobj.hxx"
class GraphicContext;
class SmokeParticleHolder : public WorldObj
{
struct SmokeParticle {
int time;
int livetime;
bool use_surf2;
Vector pos;
Vector velocity;
SmokeParticle(int x, int y, float vel_x, float vel_y);
};
private:
CL_Surface surf1;
CL_Surface surf2;
std::vector<SmokeParticle> particles;
public:
SmokeParticleHolder ();
void add_particle (int x, int y, float vel_x, float vel_y);
float get_z_pos () const { return 1000.0f; }
/// Let the particle move
void update ();
/// Draw the particle with the correct zoom resize
void draw (GraphicContext& gc);
private:
SmokeParticleHolder (const SmokeParticleHolder&);
SmokeParticleHolder& operator= (const SmokeParticleHolder&);
};
#endif
/* EOF */
--- NEW FILE: snow_particle_holder.cxx ---
// $Id: snow_particle_holder.cxx,v 1.1 2002/12/28 16:10:18 torangan Exp $
//
// Pingus - A free Lemmings clone
// Copyright (C) 1999 Ingo Ruhnke <address@hidden>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <assert.h>
#include "../algo.hxx"
#include "../col_map.hxx"
#include "../graphic_context.hxx"
#include "../pingu_map.hxx"
#include "../pingus_resource.hxx"
#include "../world.hxx"
#include "snow_particle_holder.hxx"
SnowParticleHolder::SnowParticle::SnowParticle (int x, int y, bool colliding_)
: alive(true),
colliding(colliding_),
pos(Vector(x,y)),
velocity(Vector(0, 1 + (frand() * 3.5)))
{
switch (rand() % 10)
{
case 0:
type = Snow1;
break;
case 1:
type = Snow2;
break;
case 2:
case 3:
type = Snow3;
break;
case 5:
case 6:
type = Snow4;
default:
type = Snow5;
break;
}
}
SnowParticleHolder::SnowParticleHolder ()
: snow1 (PingusResource::load_surface("Particles/snow1", "pingus")),
snow2 (PingusResource::load_surface("Particles/snow2", "pingus")),
snow3 (PingusResource::load_surface("Particles/snow3", "pingus")),
snow4 (PingusResource::load_surface("Particles/snow4", "pingus")),
snow5 (PingusResource::load_surface("Particles/snow5", "pingus")),
ground(PingusResource::load_surface("Particles/ground_snow", "pingus"))
{
}
void
SnowParticleHolder::add_particle (int x, int y, bool colliding)
{
// search for dead entry to replace
for (std::vector<SnowParticle>::iterator it=particles.begin(); it !=
particles.end(); ++it)
if (!it->alive)
{
*it = SnowParticle(x, y, colliding);
return;
}
// create new entry
particles.push_back(SnowParticle(x, y, colliding));
}
void
SnowParticleHolder::update ()
{
// update all contained particles
for (std::vector<SnowParticle>::iterator it=particles.begin(); it !=
particles.end(); ++it)
{
// skip dead particles
if (!it->alive)
continue;
it->pos.x += it->velocity.x;
it->pos.y += it->velocity.y;
if (it->pos.y > world->get_height())
{
it->alive = false;
continue;
}
it->velocity.x += (frand() - 0.5) / 10;
if (it->colliding)
{
int pixel =
world->get_colmap()->getpixel(static_cast<int>(it->pos.x),
static_cast<int>(it->pos.y));
if ( pixel != Groundtype::GP_NOTHING
&& pixel != Groundtype::GP_WATER
&& pixel != Groundtype::GP_OUTOFSCREEN)
{
world->get_gfx_map()->put(ground, static_cast<int>(it->pos.x -
1), static_cast<int>(it->pos.y - 1));
it->alive = false;
}
}
}
}
void
SnowParticleHolder::draw (GraphicContext& gc)
{
for (std::vector<SnowParticle>::iterator it=particles.begin(); it !=
particles.end(); ++it)
{
if (!it->alive)
continue;
switch (it->type)
{
case Snow1:
gc.draw(snow1, it->pos);
break;
case Snow2:
gc.draw(snow2, it->pos);
break;
case Snow3:
gc.draw(snow3, it->pos);
break;
case Snow4:
gc.draw(snow4, it->pos);
break;
case Snow5:
gc.draw(snow5, it->pos);
break;
default:
assert(!"Invalid Snow-Type");
}
}
}
/* EOF */
--- NEW FILE: snow_particle_holder.hxx ---
// $Id: snow_particle_holder.hxx,v 1.1 2002/12/28 16:10:18 torangan Exp $
//
// Pingus - A free Lemmings clone
// Copyright (C) 1999 Ingo Ruhnke <address@hidden>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef HEADER_PINGUS_PARTICLES_SNOW_PARTICLE_HOLDER_HXX
#define HEADER_PINGUS_PARTICLES_SNOW_PARTICLE_HOLDER_HXX
#include <vector>
#include <ClanLib/Display/Display/surface.h>
#include "../vector.hxx"
#include "../worldobj.hxx"
class GraphicContext;
class SnowParticleHolder : public WorldObj
{
private:
enum ParticleType { Snow1, Snow2, Snow3, Snow4, Snow5 };
struct SnowParticle {
bool alive;
bool colliding;
ParticleType type;
Vector pos;
Vector velocity;
SnowParticle(int x, int y, bool colliding_);
};
private:
CL_Surface snow1;
CL_Surface snow2;
CL_Surface snow3;
CL_Surface snow4;
CL_Surface snow5;
CL_Surface ground;
std::vector<SnowParticle> particles;
public:
SnowParticleHolder ();
void add_particle (int x, int y, bool colliding = false);
float get_z_pos () const { return 1000.0f; }
/// Let the particle move
void update ();
/// Draw the particle with the correct zoom resize
void draw (GraphicContext& gc);
private:
SnowParticleHolder (const SnowParticleHolder&);
SnowParticleHolder& operator= (const SnowParticleHolder&);
};
#endif
/* EOF */
Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/particles/Makefile.am,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- Makefile.am 16 Sep 2002 15:47:35 -0000 1.8
+++ Makefile.am 28 Dec 2002 16:10:18 -0000 1.9
@@ -18,13 +18,9 @@
noinst_LIBRARIES = libpingus_particle.a
libpingus_particle_a_SOURCES = \
-explosive_particle.hxx particle_holder.hxx smoke_particle.hxx \
-ground_particle.hxx pingu_particle.hxx \
-particle.hxx snow_particle.hxx \
-particle_cache.hxx rain_particle.hxx \
-explosive_particle.cxx particle_holder.cxx smoke_particle.cxx \
-ground_particle.cxx pingu_particle.cxx \
-particle.cxx snow_particle.cxx \
-particle_cache.cxx rain_particle.cxx
+pingu_particle_holder.cxx pingu_particle_holder.hxx \
+ rain_particle_holder.cxx rain_particle_holder.hxx \
+smoke_particle_holder.cxx smoke_particle_holder.hxx \
+ snow_particle_holder.cxx snow_particle_holder.hxx
## EOF ##
Index: explosive_particle.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/particles/explosive_particle.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- explosive_particle.cxx 4 Oct 2002 11:38:29 -0000 1.4
+++ explosive_particle.cxx 28 Dec 2002 16:10:18 -0000 1.5
@@ -16,7 +16,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
+#if 0
#include "../col_map.hxx"
#include "../pingu_map.hxx"
#include "../world.hxx"
@@ -28,9 +28,9 @@
: Particle (x, y, x_a, y_a),
alive (true)
{
- sprite = Sprite (PingusResource::load_surface
- ("Particles/explosive",
- "pingus"));
+// sprite = Sprite (PingusResource::load_surface
+// ("Particles/explosive",
+// "pingus"));
}
ExplosiveParticle::~ExplosiveParticle ()
@@ -86,11 +86,12 @@
int(pos.y) - (bomber_radius.get_height()/2));
}
-void
-ExplosiveParticle::draw_offset(int ofx, int ofy, float /*s*/)
-{
- sprite.put_screen (int(pos.x + ofx), int(pos.y + ofy));
-}
+//void
+//ExplosiveParticle::draw_offset(int ofx, int ofy, float /*s*/)
+//{
+// sprite.put_screen (int(pos.x + ofx), int(pos.y + ofy));
+//}
+
bool
ExplosiveParticle::is_alive(void)
@@ -99,3 +100,4 @@
}
/* EOF */
+#endif
Index: explosive_particle.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/particles/explosive_particle.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- explosive_particle.hxx 27 Sep 2002 11:26:49 -0000 1.4
+++ explosive_particle.hxx 28 Dec 2002 16:10:18 -0000 1.5
@@ -16,7 +16,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
+#if 0
#ifndef HEADER_PINGUS_PARTICLES_EXPLOSIVE_PARTICLE_HXX
#define HEADER_PINGUS_PARTICLES_EXPLOSIVE_PARTICLE_HXX
@@ -27,7 +27,7 @@
: public Particle
{
private:
- Sprite sprite;
+ //Sprite sprite;
bool alive;
public:
@@ -36,7 +36,7 @@
///
void update(float delta);
///
- void draw_offset(int ofx, int ofy, float s);
+ //void draw_offset(int ofx, int ofy, float s);
///
bool is_alive(void);
void detonate ();
@@ -49,3 +49,4 @@
#endif
/* EOF */
+#endif
Index: ground_particle.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/particles/ground_particle.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- ground_particle.cxx 4 Oct 2002 11:38:29 -0000 1.2
+++ ground_particle.cxx 28 Dec 2002 16:10:18 -0000 1.3
@@ -16,7 +16,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
+#if 0
#include "../globals.hxx"
#include "../pingus_resource.hxx"
#include "ground_particle.hxx"
@@ -61,3 +61,4 @@
}
/* EOF */
+#endif
Index: ground_particle.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/particles/ground_particle.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- ground_particle.hxx 27 Sep 2002 11:26:49 -0000 1.4
+++ ground_particle.hxx 28 Dec 2002 16:10:18 -0000 1.5
@@ -16,7 +16,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
+#if 0
#ifndef HEADER_PINGUS_PARTICLES_GROUND_PARTICLE_HXX
#define HEADER_PINGUS_PARTICLES_GROUND_PARTICLE_HXX
@@ -41,3 +41,4 @@
#endif
/* EOF */
+#endif
--- particle.cxx DELETED ---
--- particle.hxx DELETED ---
--- particle_cache.cxx DELETED ---
--- particle_cache.hxx DELETED ---
--- particle_holder.cxx DELETED ---
--- particle_holder.hxx DELETED ---
--- pingu_particle.cxx DELETED ---
--- pingu_particle.hxx DELETED ---
--- rain_particle.cxx DELETED ---
--- rain_particle.hxx DELETED ---
--- smoke_particle.cxx DELETED ---
--- smoke_particle.hxx DELETED ---
--- snow_particle.cxx DELETED ---
--- snow_particle.hxx DELETED ---
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src/particles pingu_particle_holder.cxx,NONE,1.1 pingu_particle_holder.hxx,NONE,1.1 rain_particle_holder.cxx,NONE,1.1 rain_particle_holder.hxx,NONE,1.1 smoke_particle_holder.cxx,NONE,1.1smoke_particle_holder.hxx,NONE,1.1 snow_particle_holder.cxx,NONE,1.1 snow_particle_holder.hxx,NONE,1.1 Makefile.am,1.8,1.9 explosive_particle.cxx,1.4,1.5 explosive_particle.hxx,1.4,1.5 ground_particle.cxx,1.2,1.3 ground_particle.hxx,1.4,1.5 particle.cxx,1.4,NONE particle.hxx,1.7,NONE particle_cache.cxx,1.4,NONE particle_cache.hxx,1.5,NONE particle_holder.cxx,1.7,NONE particle_holder.hxx,1.6,NONE pingu_particle.cxx,1.4,NONE pingu_particle.hxx,1.6,NONE rain_particle.cxx,1.5,NONE rain_particle.hxx,1.5,NONE smoke_particle.cxx,1.4,NONE smoke_particle.hxx,1.5,NONE snow_particle.cxx,1.6,NONE snow_particle.hxx,1.4,NONE,
torangan <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/src/actions bomber.cxx,1.25,1.26 rocket_launcher.cxx,1.12,1.13
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/src sprite.cxx,1.12,1.13
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/src/actions bomber.cxx,1.25,1.26 rocket_launcher.cxx,1.12,1.13
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/src sprite.cxx,1.12,1.13
- Index(es):