Rename rain class to weather
This commit is contained in:
parent
7d0dec5c49
commit
57240124ba
@ -18,15 +18,15 @@
|
||||
|
||||
#include "audio/sfx_base.hpp"
|
||||
#include "audio/sfx_manager.hpp"
|
||||
#include "graphics/rain.hpp"
|
||||
#include "graphics/weather.hpp"
|
||||
#include "modes/world.hpp"
|
||||
#include "states_screens/race_gui.hpp"
|
||||
#include "utils/random_generator.hpp"
|
||||
|
||||
|
||||
// The rain manager
|
||||
// The weather manager
|
||||
|
||||
Rain::Rain(bool lightning, std::string sound)
|
||||
Weather::Weather(bool lightning, std::string sound)
|
||||
{
|
||||
m_lightning = lightning;
|
||||
m_thunder_sound = NULL;
|
||||
@ -44,11 +44,11 @@ Rain::Rain(bool lightning, std::string sound)
|
||||
|
||||
RandomGenerator g;
|
||||
m_next_lightning = (float)g.get(35);
|
||||
} // Rain
|
||||
} // Weather
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
Rain::~Rain()
|
||||
Weather::~Weather()
|
||||
{
|
||||
if (m_thunder_sound != NULL)
|
||||
sfx_manager->deleteSFX(m_thunder_sound);
|
||||
@ -59,7 +59,7 @@ Rain::~Rain()
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void Rain::update(float dt)
|
||||
void Weather::update(float dt)
|
||||
{
|
||||
if (m_lightning)
|
||||
{
|
||||
@ -87,7 +87,7 @@ void Rain::update(float dt)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void Rain::playSound()
|
||||
void Weather::playSound()
|
||||
{
|
||||
if (m_weather_sound)
|
||||
{
|
@ -16,12 +16,12 @@
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#ifndef HEADER_RAIN_HPP
|
||||
#define HEADER_RAIN_HPP
|
||||
#ifndef HEADER_WEATHER_HPP
|
||||
#define HEADER_WEATHER_HPP
|
||||
|
||||
class SFXBase;
|
||||
|
||||
class Rain
|
||||
class Weather
|
||||
{
|
||||
bool m_lightning;
|
||||
float m_next_lightning;
|
||||
@ -30,8 +30,8 @@ class Rain
|
||||
SFXBase* m_weather_sound;
|
||||
|
||||
public:
|
||||
Rain(bool lightning, std::string sound);
|
||||
virtual ~Rain();
|
||||
Weather(bool lightning, std::string sound);
|
||||
virtual ~Weather();
|
||||
|
||||
void update(float dt);
|
||||
void playSound();
|
@ -121,7 +121,7 @@ World::World() : WorldStatus(), m_clear_color(255,100,101,140)
|
||||
m_self_destruct = false;
|
||||
m_schedule_tutorial = false;
|
||||
m_is_network_world = false;
|
||||
m_rain = NULL;
|
||||
m_weather = NULL;
|
||||
|
||||
m_stop_music_when_dialog_open = true;
|
||||
|
||||
@ -199,7 +199,7 @@ void World::init()
|
||||
|
||||
if (UserConfigParams::m_weather_effects)
|
||||
{
|
||||
m_rain = new Rain(m_track->getWeatherLightning(),
|
||||
m_weather = new Weather(m_track->getWeatherLightning(),
|
||||
m_track->getWeatherSound());
|
||||
}
|
||||
} // init
|
||||
@ -383,8 +383,8 @@ World::~World()
|
||||
delete m_race_gui;
|
||||
}
|
||||
|
||||
if (m_rain != NULL)
|
||||
delete m_rain;
|
||||
if (m_weather != NULL)
|
||||
delete m_weather;
|
||||
|
||||
for ( unsigned int i = 0 ; i < m_karts.size() ; i++ )
|
||||
delete m_karts[i];
|
||||
@ -935,9 +935,9 @@ void World::update(float dt)
|
||||
Camera::getCamera(i)->update(dt);
|
||||
}
|
||||
|
||||
if (UserConfigParams::m_graphical_effects && m_rain)
|
||||
if (UserConfigParams::m_graphical_effects && m_weather)
|
||||
{
|
||||
m_rain->update(dt);
|
||||
m_weather->update(dt);
|
||||
}
|
||||
|
||||
projectile_manager->update(dt);
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include <vector>
|
||||
#include <stdexcept>
|
||||
|
||||
#include "graphics/rain.hpp"
|
||||
#include "graphics/weather.hpp"
|
||||
#include "modes/world_status.hpp"
|
||||
#include "race/highscores.hpp"
|
||||
#include "states_screens/race_gui_base.hpp"
|
||||
@ -163,8 +163,8 @@ protected:
|
||||
/** Set when the world is online and counts network players. */
|
||||
bool m_is_network_world;
|
||||
|
||||
/** Used to show rain graphical effects. */
|
||||
Rain* m_rain;
|
||||
/** Used to show weather graphical effects. */
|
||||
Weather* m_weather;
|
||||
|
||||
|
||||
virtual void onGo();
|
||||
@ -349,8 +349,8 @@ public:
|
||||
|
||||
bool isNetworkWorld() const { return m_is_network_world; }
|
||||
|
||||
/** Returns a pointer to the rain. */
|
||||
Rain* getRain() {return m_rain;}
|
||||
/** Returns a pointer to the weather. */
|
||||
Weather* getWeather() {return m_weather;}
|
||||
}; // World
|
||||
|
||||
#endif
|
||||
|
@ -140,9 +140,9 @@ void WorldStatus::update(const float dt)
|
||||
m_track_intro_sound->play();
|
||||
}
|
||||
|
||||
if (World::getWorld()->getRain() != NULL)
|
||||
if (World::getWorld()->getWeather() != NULL)
|
||||
{
|
||||
World::getWorld()->getRain()->playSound();
|
||||
World::getWorld()->getWeather()->playSound();
|
||||
}
|
||||
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user