Changeset 8495 in orxonox.OLD for trunk/src/lib/graphics/effects/snow_effect.cc
- Timestamp:
- Jun 15, 2006, 9:50:56 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/effects/snow_effect.cc
r8316 r8495 50 50 if (this->windBuffer != NULL) 51 51 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) { 56 56 this->activate(); 57 SnowEffect::snowParticles->precache((int) this->snowLife); 58 } 57 59 } 58 60 … … 87 89 } 88 90 89 boolSnowEffect::init()91 void SnowEffect::init() 90 92 { 91 93 this->emitter = new PlaneEmitter(); … … 96 98 this->particles = 12000; 97 99 this->texture = "maps/snow_flake_01_32x32.png"; 98 this-> life = 8;100 this->snowLife = 8; 99 101 this->randomLife = 2; 100 102 this->snowRadius = 3.5; … … 111 113 this->snowCoord = Vector(100,450,400); 112 114 this->snowWindForce = 1; 113 114 return true; 115 } 116 117 bool SnowEffect::activate() 115 } 116 117 void SnowEffect::activate() 118 118 { 119 119 PRINTF(0)("Activating SnowEffect\n"); … … 124 124 SnowEffect::snowParticles->setName("SnowEffectTrailParticles"); 125 125 SnowEffect::snowParticles->setMaterialTexture(texture); 126 SnowEffect::snowParticles->setLifeSpan( life, randomLife);126 SnowEffect::snowParticles->setLifeSpan(snowLife, randomLife); 127 127 SnowEffect::snowParticles->setRadius(0.0, snowRadius, randomRadius); 128 128 SnowEffect::snowParticles->setRadius(0.2, snowRadius, randomRadius*0.8); … … 141 141 this->emitter->setSize(snowSize); 142 142 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 149 void SnowEffect::deactivate() 153 150 { 154 151 PRINTF(0)("Deactivating SnowEffect\n"); … … 159 156 if (this->windBuffer != NULL) 160 157 ResourceManager::getInstance()->unload(this->windBuffer); 161 162 return true;163 158 } 164 159
Note: See TracChangeset
for help on using the changeset viewer.