Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 15, 2006, 9:50:56 PM (19 years ago)
Author:
bensch
Message:

merged the branche atmos back. no conflicts

File:
1 edited

Legend:

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

    r8316 r8495  
    5050                if (this->windBuffer != NULL)
    5151                        ResourceManager::getInstance()->unload(this->windBuffer);
    52                         this->windBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/wind.wav", WAV);
    53         }
    54 
    55         if(snowActivate)
     52                        this->windBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/wind.wav", WAV);
     53        }
     54
     55  if(snowActivate) {
    5656                this->activate();
     57    SnowEffect::snowParticles->precache((int) this->snowLife);
     58  } 
    5759}
    5860
     
    8789}
    8890
    89 bool SnowEffect::init()
     91void SnowEffect::init()
    9092{
    9193        this->emitter = new PlaneEmitter();
     
    9698        this->particles = 12000;
    9799        this->texture = "maps/snow_flake_01_32x32.png";
    98         this->life = 8;
     100        this->snowLife = 8;
    99101        this->randomLife = 2;
    100102        this->snowRadius = 3.5;
     
    111113        this->snowCoord = Vector(100,450,400);
    112114        this->snowWindForce = 1;
    113 
    114         return true;
    115 }
    116 
    117 bool SnowEffect::activate()
     115}
     116
     117void SnowEffect::activate()
    118118{
    119119        PRINTF(0)("Activating SnowEffect\n");
     
    124124        SnowEffect::snowParticles->setName("SnowEffectTrailParticles");
    125125        SnowEffect::snowParticles->setMaterialTexture(texture);
    126         SnowEffect::snowParticles->setLifeSpan(life, randomLife);
     126        SnowEffect::snowParticles->setLifeSpan(snowLife, randomLife);
    127127        SnowEffect::snowParticles->setRadius(0.0, snowRadius, randomRadius);
    128128        SnowEffect::snowParticles->setRadius(0.2, snowRadius, randomRadius*0.8);
     
    141141        this->emitter->setSize(snowSize);
    142142
    143         // SnowEffect::snowParticles->precache(8);
    144 
    145         if (this->snowWindForce > 1)
    146                 this->soundSource.loop(this->windBuffer);
    147 
    148         return true;
    149 }
    150 
    151 
    152 bool SnowEffect::deactivate()
     143  if (this->snowWindForce != 0)
     144    this->soundSource.play(this->windBuffer, 0.1f * this->snowWindForce, true);
     145 
     146}
     147
     148
     149void SnowEffect::deactivate()
    153150{
    154151        PRINTF(0)("Deactivating SnowEffect\n");
     
    159156        if (this->windBuffer != NULL)
    160157                ResourceManager::getInstance()->unload(this->windBuffer);
    161 
    162         return true;
    163158}
    164159
Note: See TracChangeset for help on using the changeset viewer.