Changeset 9118 in orxonox.OLD
- Timestamp:
- Jul 4, 2006, 1:21:52 PM (18 years ago)
- Location:
- branches/presentation/src/lib/graphics/effects
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/presentation/src/lib/graphics/effects/rain_effect.cc
r9112 r9118 187 187 // If we're not fading, change color immediately 188 188 if (!this->rainFadeInActivate || !this->rainFadeOutActivate) { 189 CloudEffect::changeCloudColor(this->cloudColor, 0 );190 CloudEffect::changeSkyColor(this->skyColor, 0 );189 CloudEffect::changeCloudColor(this->cloudColor, 0.2); 190 CloudEffect::changeSkyColor(this->skyColor, 0.2); 191 191 } 192 192 } … … 208 208 209 209 // Restore the old cloud- and sky color 210 CloudEffect::changeCloudColor(this->oldCloudColor, 0 );211 CloudEffect::changeSkyColor(this->oldSkyColor, 0 );210 CloudEffect::changeCloudColor(this->oldCloudColor, 0.2); 211 CloudEffect::changeSkyColor(this->oldSkyColor, 0.2); 212 212 } 213 213 -
branches/presentation/src/lib/graphics/effects/snow_effect.cc
r9112 r9118 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" … … 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 -
branches/presentation/src/lib/graphics/effects/snow_effect.h
r8495 r9118 16 16 class PlaneEmitter; 17 17 class PNode; 18 class CloudEffect; 18 19 19 20 #include "sound_source.h" … … 77 78 this->snowWindForce = force; 78 79 } 80 inline void setCloudColor(float colorX, float colorY, float colorZ) 81 { 82 this->cloudColor = Vector(colorX, colorY, colorZ); 83 } 84 inline void setSkyColor(float colorX, float colorY, float colorZ) 85 { 86 this->skyColor = Vector(colorX, colorY, colorZ); 87 } 88 inline void setFadeTime(float time) 89 { 90 this->fadeTime = time; 91 } 79 92 80 93 inline void setSnowOption(const std::string& option) { … … 97 110 float angle, randomAngle; 98 111 float alpha; 112 float fadeTime; 99 113 Vector snowCoord; 100 114 Vector2D snowSize; … … 110 124 OrxSound::SoundBuffer* windBuffer; 111 125 126 Vector oldSkyColor; 127 Vector oldCloudColor; 128 Vector skyColor; 129 Vector cloudColor; 112 130 }; 113 131
Note: See TracChangeset
for help on using the changeset viewer.