#include <wind.h>
Public Types | |
typedef std::list< WindParticle >::iterator | iterator |
Public Member Functions | |
Wind () | |
double | GetStrength () const |
void | ChooseRandomVal () |
void | SetVal (long val) |
void | Refresh () |
void | Reset () |
void | DrawParticles () |
void | RandomizeParticlesPos () |
Public Attributes | |
std::list< WindParticle > | particles |
Private Attributes | |
long | m_val |
long | m_nv_val |
uint | m_last_move |
uint | m_last_part_mvt |
Definition at line 53 of file wind.h.
typedef std::list<WindParticle>::iterator Wind::iterator |
void Wind::ChooseRandomVal | ( | ) |
Definition at line 167 of file wind.cpp.
00167 { 00168 int val = randomObj.GetLong(-100, 100); 00169 ActionHandler::GetInstance()->NewAction (new Action(Action::ACTION_WIND, val)); 00170 }
Here is the call graph for this function:
Here is the caller graph for this function:
void Wind::DrawParticles | ( | ) |
double Wind::GetStrength | ( | ) | const |
void Wind::RandomizeParticlesPos | ( | ) |
Definition at line 196 of file wind.cpp.
00197 { 00198 iterator it=particles.begin(), end=particles.end(); 00199 for (; it != end; ++it) 00200 { 00201 if(!camera.IsVisible(*it)) 00202 it -> SetXY( Point2i( randomObj.GetLong(camera.GetPositionX(), camera.GetPositionX()+camera.GetSizeX()), 00203 randomObj.GetLong(camera.GetPositionY(), camera.GetPositionY()+camera.GetSizeY()))); 00204 } 00205 }
Here is the call graph for this function:
Here is the caller graph for this function:
void Wind::Refresh | ( | ) |
Definition at line 181 of file wind.cpp.
00181 { 00182 if(m_last_move + bar_speed < Time::GetInstance()->Read()){ 00183 if(m_val>m_nv_val) 00184 --m_val; 00185 else 00186 if(m_val<m_nv_val) 00187 ++m_val; 00188 m_last_move = Time::GetInstance()->Read(); 00189 Interface::GetInstance()->UpdateWindIndicator(m_val); 00190 } 00191 00192 iterator it=particles.begin(), end=particles.end(); 00193 for (; it != end; ++it) it -> Refresh(); 00194 }
Here is the call graph for this function:
Here is the caller graph for this function:
void Wind::Reset | ( | ) |
Definition at line 138 of file wind.cpp.
00138 { 00139 m_last_move = 0; 00140 m_last_part_mvt = 0; 00141 m_val = m_nv_val = 0; 00142 Interface::GetInstance()->UpdateWindIndicator(m_val); 00143 00144 particles.clear(); 00145 00146 if (!Config::GetInstance()->GetDisplayWindParticles()) 00147 return ; 00148 00149 uint nb = ActiveMap().wind.nb_sprite; 00150 00151 if(!nb) return; 00152 00153 std::string config_file = ActiveMap().m_directory + PATH_SEPARATOR + "config.xml"; 00154 00155 for (uint i=0; i<nb; ++i){ 00156 WindParticle tmp = WindParticle(config_file); 00157 tmp.Resize( (double)i / nb ); 00158 particles.push_back( tmp ); 00159 } 00160 RandomizeParticlesPos(); 00161 }
Here is the call graph for this function:
Here is the caller graph for this function:
void Wind::SetVal | ( | long | val | ) |
uint Wind::m_last_move [private] |
uint Wind::m_last_part_mvt [private] |
long Wind::m_nv_val [private] |
long Wind::m_val [private] |
std::list<WindParticle> Wind::particles |