Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 18, 2006, 4:25:18 PM (18 years ago)
Author:
amaechler
Message:

branches/atmospheric_engine: bug fixes and cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/atmospheric_engine/src/lib/graphics/effects/snow_effect.cc

    r7683 r7696  
    1717#include "util/loading/load_param.h"
    1818#include "util/loading/factory.h"
     19#include "util/loading/resource_manager.h"
    1920
    2021#include "glincl.h"
     
    4445        if (root != NULL)
    4546                this->loadParams(root);
     47
     48        //load wind sound
     49        if (this->snowWindForce > 1) {
     50                if (this->windBuffer != NULL)
     51                        ResourceManager::getInstance()->unload(this->windBuffer);
     52                this->windBuffer = (SoundBuffer*)ResourceManager::getInstance()->load("sound/wind.wav", WAV);
     53        }
    4654
    4755        this->activate();
     
    7785
    7886        // Default values
    79         particles = 12000;
    80         texture = "maps/snow_flake_01_32x32.png";
    81         life = 8;
    82         randomLife = 2;
    83         snowRadius = 3.5;
    84         randomRadius = 1;
    85         snowMass = 1.0;
    86         randomMass = 0.3;
    87         rate = 900;
    88         velocity = -100;
    89         randomVelocity = 5;
    90         angle = 0.5;
    91         randomAngle = 0.2;
    92         alpha = 0.5;
    93         snowSize = Vector2D(2500, 2500);
    94   snowCoord = Vector(100,450,400);
    95 
    96         activated = false;
     87        this->particles = 12000;
     88        this->texture = "maps/snow_flake_01_32x32.png";
     89        this->life = 8;
     90        this->randomLife = 2;
     91        this->snowRadius = 3.5;
     92        this->randomRadius = 1;
     93        this->snowMass = 1.0;
     94        this->randomMass = 0.3;
     95        this->rate = 900;
     96        this->velocity = -100;
     97        this->randomVelocity = 5;
     98        this->angle = 0.5;
     99        this->randomAngle = 0.2;
     100        this->alpha = 0.5;
     101        this->snowSize = Vector2D(2500, 2500);
     102  this->snowCoord = Vector(100,450,400);
     103        this->snowWindForce = 1;
     104
     105        this->activated = false;
    97106}
    98107
     
    119128        this->emitter->setEmissionRate(rate);
    120129        this->emitter->setEmissionVelocity(velocity, randomVelocity);
    121         this->emitter->setSpread(angle, randomAngle);
     130        this->emitter->setSpread(angle * this->snowWindForce , randomAngle * this->snowWindForce);
    122131        this->emitter->setSize(snowSize);
    123  
     132
    124133  //SnowEffect::snowParticles->precache(8);
     134
     135        if (this->snowWindForce > 1)
     136                this->soundSource.loop(this->windBuffer);
    125137}
    126138
     
    132144
    133145        this->emitter->setSystem(NULL);
     146
     147        if (this->windBuffer != NULL)
     148                ResourceManager::getInstance()->unload(this->windBuffer);
     149
    134150}
    135151
Note: See TracChangeset for help on using the changeset viewer.