mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 17:29:18 +02:00
light state readout for python scripts, reflection map calculation fix
This commit is contained in:
@@ -468,6 +468,8 @@ dictionary_source *TTrain::GetTrainState() {
|
|||||||
dict->insert( "converter", mvControlled->ConverterFlag );
|
dict->insert( "converter", mvControlled->ConverterFlag );
|
||||||
dict->insert( "converter_overload", mvControlled->ConvOvldFlag );
|
dict->insert( "converter_overload", mvControlled->ConvOvldFlag );
|
||||||
dict->insert( "compress", mvControlled->CompressorFlag );
|
dict->insert( "compress", mvControlled->CompressorFlag );
|
||||||
|
dict->insert( "lights_front", mvOccupied->iLights[ end::front ] );
|
||||||
|
dict->insert( "lights_rear", mvOccupied->iLights[ end::rear ] );
|
||||||
// reverser
|
// reverser
|
||||||
dict->insert( "direction", mover->ActiveDir );
|
dict->insert( "direction", mover->ActiveDir );
|
||||||
// throttle
|
// throttle
|
||||||
|
|||||||
@@ -943,12 +943,7 @@ opengl_renderer::Render_reflections() {
|
|||||||
|
|
||||||
if( Global.ReflectionUpdatesPerSecond == 0 ) { return false; }
|
if( Global.ReflectionUpdatesPerSecond == 0 ) { return false; }
|
||||||
|
|
||||||
auto const &time = simulation::Time.data();
|
auto const timestamp { static_cast<int>( Timer::GetTime() * 1000 ) };
|
||||||
auto const timestamp =
|
|
||||||
time.wMilliseconds
|
|
||||||
+ time.wSecond * 1000
|
|
||||||
+ time.wMinute * 1000 * 60
|
|
||||||
+ time.wHour * 1000 * 60 * 60;
|
|
||||||
if( ( timestamp - m_environmentupdatetime < Global.ReflectionUpdatesPerSecond )
|
if( ( timestamp - m_environmentupdatetime < Global.ReflectionUpdatesPerSecond )
|
||||||
&& ( glm::length( m_renderpass.camera.position() - m_environmentupdatelocation ) < 1000.0 ) ) {
|
&& ( glm::length( m_renderpass.camera.position() - m_environmentupdatelocation ) < 1000.0 ) ) {
|
||||||
// run update every 5+ mins of simulation time, or at least 1km from the last location
|
// run update every 5+ mins of simulation time, or at least 1km from the last location
|
||||||
|
|||||||
Reference in New Issue
Block a user