X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fparticlesystem.cpp;h=b82152a13f4a3c8ef55962facfdc5069c184f42c;hb=5a542dea3c6043703683b68fcaa774f6cb0d9127;hp=c21d109b9df0c55a23e1a5ee465f3b76def60b49;hpb=2074a5e3f8167dec24989c008ddadda14687a3a6;p=supertux.git diff --git a/src/particlesystem.cpp b/src/particlesystem.cpp index c21d109b9..b82152a13 100644 --- a/src/particlesystem.cpp +++ b/src/particlesystem.cpp @@ -17,14 +17,17 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -#include "particlesystem.h" + +#include #include -#include -#include "globals.h" -#include "lispreader.h" -#include "lispwriter.h" -#include "screen/drawing_context.h" +#include + +#include "particlesystem.h" +#include "app/globals.h" +#include "utils/lispreader.h" +#include "utils/lispwriter.h" +#include "video/drawing_context.h" ParticleSystem::ParticleSystem() { @@ -70,9 +73,9 @@ void ParticleSystem::draw(DrawingContext& context) SnowParticleSystem::SnowParticleSystem() { - snowimages[0] = new Surface(datadir+"/images/shared/snow0.png", USE_ALPHA); - snowimages[1] = new Surface(datadir+"/images/shared/snow1.png", USE_ALPHA); - snowimages[2] = new Surface(datadir+"/images/shared/snow2.png", USE_ALPHA); + snowimages[0] = new Surface(datadir+"/images/shared/snow0.png", true); + snowimages[1] = new Surface(datadir+"/images/shared/snow1.png", true); + snowimages[2] = new Surface(datadir+"/images/shared/snow2.png", true); virtual_width = screen->w * 2; @@ -85,8 +88,9 @@ SnowParticleSystem::SnowParticleSystem() int snowsize = rand() % 3; particle->texture = snowimages[snowsize]; do { - particle->speed = snowsize/60.0 + (float(rand()%10)/300.0); - } while(particle->speed < 0.01); + particle->speed = snowsize*.2 + (float(rand()%10)*.4); + } while(particle->speed < 1); + particle->speed *= 10; // gravity particles.push_back(particle); } @@ -127,7 +131,7 @@ void SnowParticleSystem::action(float elapsed_time) CloudParticleSystem::CloudParticleSystem() { - cloudimage = new Surface(datadir + "/images/shared/cloud.png", USE_ALPHA); + cloudimage = new Surface(datadir + "/images/shared/cloud.png", true); virtual_width = 2000.0; @@ -137,7 +141,7 @@ CloudParticleSystem::CloudParticleSystem() particle->pos.x = rand() % int(virtual_width); particle->pos.y = rand() % int(virtual_height); particle->texture = cloudimage; - particle->speed = -float(250 + rand() % 200) / 1000.0; + particle->speed = -float(25 + rand() % 30); particles.push_back(particle); }