Changeset 7696 in orxonox.OLD for branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.cc
- Timestamp:
- May 18, 2006, 4:25:18 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.cc
r7691 r7696 24 24 #include "spark_particles.h" 25 25 #include "plane_emitter.h" 26 #include "shell_command.h" 26 27 27 28 #include "parser/tinyxml/tinyxml.h" 28 29 29 //SHELL_COMMAND(activate, RainEffect, activateRain);30 //SHELL_COMMAND(deactivate, RainEffect, deactivateRain);30 SHELL_COMMAND(activate, RainEffect, activateRain); 31 SHELL_COMMAND(deactivate, RainEffect, deactivateRain); 31 32 32 33 using namespace std; … … 43 44 this->loadParams(root); 44 45 45 //load sound46 //load rain sound 46 47 if (this->rainBuffer != NULL) 47 48 ResourceManager::getInstance()->unload(this->rainBuffer); 48 49 this->rainBuffer = (SoundBuffer*)ResourceManager::getInstance()->load("sound/rain.wav", WAV); 50 51 //load wind sound 52 if (this->rainWindForce > 0) { 53 if (this->windBuffer != NULL) 54 ResourceManager::getInstance()->unload(this->windBuffer); 55 this->windBuffer = (SoundBuffer*)ResourceManager::getInstance()->load("sound/wind.wav", WAV); 56 } 49 57 50 58 this->activate(); … … 54 62 { 55 63 this->deactivate(); 64 65 if (this->rainBuffer != NULL) 66 ResourceManager::getInstance()->unload(this->rainBuffer); 67 68 if (this->windBuffer != NULL) 69 ResourceManager::getInstance()->unload(this->windBuffer); 56 70 } 57 71 … … 114 128 115 129 this->emitter->setSpread(this->rainWindForce / 50, 0.2); 116 130 117 131 this->soundSource.loop(this->rainBuffer); 118 PRINTF(0)( "Playing RainSound\n" ); 132 if (this->rainWindForce > 0) 133 this->soundSource.loop(this->windBuffer); 119 134 } 120 135 … … 123 138 { 124 139 PRINTF(0)("Deactivating RainEffect\n"); 140 this->emitter->setSystem(NULL); 125 141 126 this-> emitter->setSystem(NULL);142 this->soundSource.stop(); 127 143 } 144 145 void RainEffect::activateRain() 146 { 147 this->activate(); 148 } 149 150 void RainEffect::deactivateRain() 151 { 152 this->deactivate(); 153 } 154 128 155 129 156 void RainEffect::tick (float dt)
Note: See TracChangeset
for help on using the changeset viewer.