16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 01:19:18 +02:00

electro-pneumatic brake operation ai logic tweak, pantograph compressor valve state commands, automatic material update switch, train lights state readout for python scripts, minor bug fixes

This commit is contained in:
tmj-fstate
2020-04-21 16:09:30 +02:00
parent f7d2b8bb7f
commit 17b545e88a
13 changed files with 145 additions and 61 deletions

View File

@@ -4078,17 +4078,19 @@ opengl_renderer::Update( double const Deltatime ) {
}
}
if( Global.UpdateMaterials ) {
// update resources if there was environmental change
simulation_state simulationstate {
Global.Weather,
Global.Season
};
std::swap( m_simulationstate, simulationstate );
if( ( m_simulationstate.season != simulationstate.season ) && ( false == simulationstate.season.empty() ) ) {
m_materials.on_season_change();
}
if( ( m_simulationstate.weather != simulationstate.weather ) && ( false == simulationstate.weather.empty() ) ) {
m_materials.on_weather_change();
simulation_state simulationstate{
Global.Weather,
Global.Season
};
std::swap( m_simulationstate, simulationstate );
if( ( m_simulationstate.season != simulationstate.season ) && ( false == simulationstate.season.empty() ) ) {
m_materials.on_season_change();
}
if( ( m_simulationstate.weather != simulationstate.weather ) && ( false == simulationstate.weather.empty() ) ) {
m_materials.on_weather_change();
}
}
if( ( true == Global.ResourceSweep )