summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/config.h1
-rw-r--r--src/render/Weather.cpp20
2 files changed, 21 insertions, 0 deletions
diff --git a/src/core/config.h b/src/core/config.h
index 9f4ccd1f..8b18ffef 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -361,6 +361,7 @@ enum Config {
#undef NO_ISLAND_LOADING
#define PC_PARTICLE
#define VC_PED_PORTS // To not process collisions always. But should be tested if that's really beneficial
+ #define VC_RAIN_NERF // Reduces number of rain particles
#endif
#ifdef LIBRW
diff --git a/src/render/Weather.cpp b/src/render/Weather.cpp
index bf3e51b4..771f85de 100644
--- a/src/render/Weather.cpp
+++ b/src/render/Weather.cpp
@@ -202,6 +202,7 @@ void CWeather::Update(void)
}
// Rain
+#ifndef VC_RAIN_NERF
float fNewRain;
if (NewWeatherType == WEATHER_RAINY) {
// if raining for >1 hour, values: 0, 0.33, 0.66, 0.99, switching every ~16.5s
@@ -223,6 +224,25 @@ void CWeather::Update(void)
else
Rain = Max(fNewRain, Rain - RAIN_CHANGE_SPEED * CTimer::GetTimeStep());
}
+#else
+ float fNewRain;
+ if (NewWeatherType == WEATHER_RAINY) {
+ // if raining for >1 hour, values: 0, 0.33, switching every ~16.5s
+ fNewRain = (((uint16)CTimer::GetTimeInMilliseconds() >> 14) & 1) * 0.33f;
+ if (OldWeatherType != WEATHER_RAINY) {
+ if (InterpolationValue < 0.4f)
+ // if rain has just started (<24 minutes), always 0.5
+ fNewRain = 0.5f;
+ else
+ // if rain is ongoing for >24 minutes, values: 0.25, 0.5, switching every ~16.5s
+ fNewRain = 0.25f + (((uint16)CTimer::GetTimeInMilliseconds() >> 14) & 1) * 0.25f;
+ }
+ fNewRain = Max(fNewRain, 0.5f);
+ }
+ else
+ fNewRain = 0.0f;
+ Rain = fNewRain;
+#endif
// Clouds
if (OldWeatherType != WEATHER_SUNNY)