17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-30 10:50:28 +01:00

Copy the textures of the terrain layers again when the season or the weather changes

This commit is contained in:
2026-10-19 11:09:57 +02:00
parent b1f880b5a7
commit e7c65993d8
3 changed files with 68 additions and 16 deletions

View File

@@ -7417,11 +7417,18 @@ void opengl46_renderer::Update(double const Deltatime)
Global.Season
};
std::swap( m_simulationstate, simulationstate );
bool changed { false };
if( ( m_simulationstate.season != simulationstate.season ) && ( false == simulationstate.season.empty() ) ) {
m_materials.on_season_change();
changed = true;
}
if( ( m_simulationstate.weather != simulationstate.weather ) && ( false == simulationstate.weather.empty() ) ) {
m_materials.on_weather_change();
changed = true;
}
if( changed ) {
// the heightmap terrain keeps copies of the textures of its layer materials
m_terrainmaterials.on_environment_change();
}
}