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;
|
||||
|
||||
float WeatherParticle::Transparency()
|
||||
float WeatherParticle::Transparency() const
|
||||
{
|
||||
float result = WEATHER_PARTICLES_TRANSPARENCY;
|
||||
|
||||
|
@ -210,10 +210,8 @@ namespace Environment
|
|||
|
||||
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;
|
||||
|
||||
if (!p.Stopped)
|
||||
|
|
|
@ -18,7 +18,6 @@ namespace Environment
|
|||
constexpr auto WEATHER_PARTICLES_TRANSPARENCY = 0.8f;
|
||||
constexpr auto WEATHER_PARTICLES_NEAR_DEATH_LIFE_VALUE = 16;
|
||||
|
||||
|
||||
constexpr auto SKY_POSITION_LIMIT = 9728;
|
||||
|
||||
enum class WeatherType
|
||||
|
@ -43,10 +42,9 @@ namespace Environment
|
|||
bool Enabled;
|
||||
bool Stopped;
|
||||
|
||||
float Transparency();
|
||||
float Transparency() const;
|
||||
};
|
||||
|
||||
|
||||
class EnvironmentController
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -417,7 +417,7 @@ namespace TEN::Renderer
|
|||
|
||||
void Renderer11::drawWeatherParticles(RenderView& view)
|
||||
{
|
||||
for (auto p : Weather.GetParticles())
|
||||
for (auto& p : Weather.GetParticles())
|
||||
{
|
||||
if (!p.Enabled)
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue