1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-30 10:15:36 +01:00

Fix OpenGL invalidation breaking for weather effects, they start before

This commit is contained in:
ζeh Matt
2025-04-26 23:31:36 +03:00
parent a59582493b
commit 6ff5841fb1
3 changed files with 9 additions and 1 deletions

View File

@@ -362,7 +362,7 @@ public:
{
WindowResetVisibilities();
if (ClimateIsRaining() || ClimateIsSnowing() || ClimateIsSnowingHeavily())
if (ClimateHasWeatherEffect())
{
WindowUpdateAllViewports();
// OpenGL doesn't support restoring pixels, always redraw.

View File

@@ -288,6 +288,13 @@ bool WeatherIsDry(WeatherType weather)
return weather == WeatherType::Sunny || weather == WeatherType::PartiallyCloudy || weather == WeatherType::Cloudy;
}
bool ClimateHasWeatherEffect()
{
const auto& weatherCurrent = getGameState().weatherCurrent;
// The game starts drawing rain whenever this level is not none.
return weatherCurrent.level != WeatherLevel::None;
}
FilterPaletteID ClimateGetWeatherGloomPaletteId(const WeatherState& state)
{
auto paletteId = FilterPaletteID::PaletteNull;

View File

@@ -92,5 +92,6 @@ bool ClimateTransitioningToSnow();
bool ClimateIsSnowing();
bool ClimateIsSnowingHeavily();
bool WeatherIsDry(WeatherType);
bool ClimateHasWeatherEffect();
FilterPaletteID ClimateGetWeatherGloomPaletteId(const WeatherState& state);
uint32_t ClimateGetWeatherSpriteId(const WeatherType weatherType);