mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-11 04:56:49 +03:00
Use ref in weather iterators
This commit is contained in:
parent
e0e456c8db
commit
f7545612c9
3 changed files with 4 additions and 8 deletions
|
@ -17,7 +17,7 @@ namespace Environment
|
||||||
{
|
{
|
||||||
EnvironmentController Weather;
|
EnvironmentController Weather;
|
||||||
|
|
||||||
float WeatherParticle::Transparency()
|
float WeatherParticle::Transparency() const
|
||||||
{
|
{
|
||||||
float result = WEATHER_PARTICLES_TRANSPARENCY;
|
float result = WEATHER_PARTICLES_TRANSPARENCY;
|
||||||
|
|
||||||
|
@ -210,10 +210,8 @@ namespace Environment
|
||||||
|
|
||||||
void EnvironmentController::UpdateWeather(GameScriptLevel* level)
|
void EnvironmentController::UpdateWeather(GameScriptLevel* level)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < Particles.size(); i++)
|
for (auto& p : Particles)
|
||||||
{
|
{
|
||||||
auto& p = Particles[i];
|
|
||||||
|
|
||||||
auto oldPos = p.Position;
|
auto oldPos = p.Position;
|
||||||
|
|
||||||
if (!p.Stopped)
|
if (!p.Stopped)
|
||||||
|
|
|
@ -18,7 +18,6 @@ namespace Environment
|
||||||
constexpr auto WEATHER_PARTICLES_TRANSPARENCY = 0.8f;
|
constexpr auto WEATHER_PARTICLES_TRANSPARENCY = 0.8f;
|
||||||
constexpr auto WEATHER_PARTICLES_NEAR_DEATH_LIFE_VALUE = 16;
|
constexpr auto WEATHER_PARTICLES_NEAR_DEATH_LIFE_VALUE = 16;
|
||||||
|
|
||||||
|
|
||||||
constexpr auto SKY_POSITION_LIMIT = 9728;
|
constexpr auto SKY_POSITION_LIMIT = 9728;
|
||||||
|
|
||||||
enum class WeatherType
|
enum class WeatherType
|
||||||
|
@ -43,10 +42,9 @@ namespace Environment
|
||||||
bool Enabled;
|
bool Enabled;
|
||||||
bool Stopped;
|
bool Stopped;
|
||||||
|
|
||||||
float Transparency();
|
float Transparency() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class EnvironmentController
|
class EnvironmentController
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -417,7 +417,7 @@ namespace TEN::Renderer
|
||||||
|
|
||||||
void Renderer11::drawWeatherParticles(RenderView& view)
|
void Renderer11::drawWeatherParticles(RenderView& view)
|
||||||
{
|
{
|
||||||
for (auto p : Weather.GetParticles())
|
for (auto& p : Weather.GetParticles())
|
||||||
{
|
{
|
||||||
if (!p.Enabled)
|
if (!p.Enabled)
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue