Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 5, 2006, 4:39:02 PM (18 years ago)
Author:
bensch
Message:

merged the presentation back

File:
1 edited

Legend:

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

    r9112 r9235  
    2828#include "shell_command.h"
    2929#include "script_class.h"
     30#include "cloud_effect.h"
    3031
    3132#include "parser/tinyxml/tinyxml.h"
     
    5354
    5455        //load wind sound
    55         if (this->snowWindForce > 1) {
     56        if (this->snowWindForce >= 1) {
    5657                if (this->windBuffer != NULL)
    5758                        ResourceManager::getInstance()->unload(this->windBuffer);
    58                         this->windBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/wind.wav", WAV);
     59          this->windBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/wind.wav", WAV);
    5960        }
    6061
     
    8788        LoadParam(root, "size", this, SnowEffect, size);
    8889        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);
    8993
    9094        LOAD_PARAM_START_CYCLE(root, element);
     
    119123        this->snowCoord = Vector(100,450,400);
    120124        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);
    121129}
    122130
     
    149157  if (this->snowWindForce != 0)
    150158    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);
    151167
    152168}
     
    162178        if (this->windBuffer != NULL)
    163179                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);
    164184}
    165185
Note: See TracChangeset for help on using the changeset viewer.