Changeset 9235 in orxonox.OLD for trunk/src/lib/graphics/effects/snow_effect.cc
- Timestamp:
- Jul 5, 2006, 4:39:02 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/effects/snow_effect.cc
r9112 r9235 28 28 #include "shell_command.h" 29 29 #include "script_class.h" 30 #include "cloud_effect.h" 30 31 31 32 #include "parser/tinyxml/tinyxml.h" … … 53 54 54 55 //load wind sound 55 if (this->snowWindForce > 1) {56 if (this->snowWindForce >= 1) { 56 57 if (this->windBuffer != NULL) 57 58 ResourceManager::getInstance()->unload(this->windBuffer); 58 59 this->windBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/wind.wav", WAV); 59 60 } 60 61 … … 87 88 LoadParam(root, "size", this, SnowEffect, size); 88 89 LoadParam(root, "coord", this, SnowEffect, coord); 90 LoadParam(root, "cloudcolor", this, SnowEffect, setCloudColor); 91 LoadParam(root, "skycolor", this, SnowEffect, setSkyColor); 92 LoadParam(root, "fadetime", this, SnowEffect, setFadeTime); 89 93 90 94 LOAD_PARAM_START_CYCLE(root, element); … … 119 123 this->snowCoord = Vector(100,450,400); 120 124 this->snowWindForce = 1; 125 126 this->fadeTime = 10; 127 this->cloudColor = Vector(0.2f, 0.2f, 0.2f); 128 this->skyColor = Vector(0.0f, 0.0f, 0.0f); 121 129 } 122 130 … … 149 157 if (this->snowWindForce != 0) 150 158 this->soundSource.play(this->windBuffer, 0.1f * this->snowWindForce, true); 159 160 // Store cloud- and sky color before the snow 161 this->oldCloudColor = CloudEffect::cloudColor; 162 this->oldSkyColor = CloudEffect::skyColor; 163 164 // Change the colors 165 CloudEffect::changeCloudColor(this->cloudColor, this->fadeTime); 166 CloudEffect::changeSkyColor(this->skyColor, this->fadeTime); 151 167 152 168 } … … 162 178 if (this->windBuffer != NULL) 163 179 ResourceManager::getInstance()->unload(this->windBuffer); 180 181 // Restore the old cloud- and sky color 182 CloudEffect::changeCloudColor(this->oldCloudColor, this->fadeTime); 183 CloudEffect::changeSkyColor(this->oldSkyColor, this->fadeTime); 164 184 } 165 185
Note: See TracChangeset
for help on using the changeset viewer.