From 57240124baf80c783a57ce831e4bff94f9f865cf Mon Sep 17 00:00:00 2001 From: Deve Date: Mon, 1 Sep 2014 20:17:38 +0200 Subject: [PATCH] Rename rain class to weather --- src/graphics/{rain.cpp => weather.cpp} | 14 +++++++------- src/graphics/{rain.hpp => weather.hpp} | 10 +++++----- src/modes/world.cpp | 12 ++++++------ src/modes/world.hpp | 10 +++++----- src/modes/world_status.cpp | 4 ++-- 5 files changed, 25 insertions(+), 25 deletions(-) rename src/graphics/{rain.cpp => weather.cpp} (92%) rename src/graphics/{rain.hpp => weather.hpp} (88%) diff --git a/src/graphics/rain.cpp b/src/graphics/weather.cpp similarity index 92% rename from src/graphics/rain.cpp rename to src/graphics/weather.cpp index 19951312d..2f62e4f06 100644 --- a/src/graphics/rain.cpp +++ b/src/graphics/weather.cpp @@ -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) { diff --git a/src/graphics/rain.hpp b/src/graphics/weather.hpp similarity index 88% rename from src/graphics/rain.hpp rename to src/graphics/weather.hpp index cd874fa52..d6fb1b135 100644 --- a/src/graphics/rain.hpp +++ b/src/graphics/weather.hpp @@ -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(); diff --git a/src/modes/world.cpp b/src/modes/world.cpp index e9d579f48..8f9214593 100644 --- a/src/modes/world.cpp +++ b/src/modes/world.cpp @@ -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); diff --git a/src/modes/world.hpp b/src/modes/world.hpp index ee2dc9077..2c26c3268 100644 --- a/src/modes/world.hpp +++ b/src/modes/world.hpp @@ -28,7 +28,7 @@ #include #include -#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 diff --git a/src/modes/world_status.cpp b/src/modes/world_status.cpp index 1bbee9b31..c7a841f89 100644 --- a/src/modes/world_status.cpp +++ b/src/modes/world_status.cpp @@ -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;