diff --git a/Driver.cpp b/Driver.cpp index db67dc91..28a7adc3 100644 --- a/Driver.cpp +++ b/Driver.cpp @@ -5557,19 +5557,20 @@ TController::UpdateSituation(double dt) { VelDesired, VelforDriver ); } + // recalculate potential load exchange duration + ExchangeTime = 0.f; if( fStopTime < 0 ) { // czas postoju przed dalszą jazdą (np. na przystanku) VelDesired = 0.0; // jak ma czekać, to nie ma jazdy // verify progress of load exchange - auto exchangetime { 0.f }; auto *vehicle { pVehicles[ 0 ] }; while( vehicle != nullptr ) { - exchangetime = std::max( exchangetime, vehicle->LoadExchangeTime() ); + ExchangeTime = std::max( ExchangeTime, vehicle->LoadExchangeTime() ); vehicle = vehicle->Next(); } - if( ( exchangetime > 0 ) + if( ( ExchangeTime > 0 ) || ( mvOccupied->Vel > 2.0 ) ) { // HACK: force timer reset if the load exchange is cancelled due to departure - WaitingSet( exchangetime ); + WaitingSet( ExchangeTime ); } } diff --git a/Driver.h b/Driver.h index 4e3037e0..592b044f 100644 --- a/Driver.h +++ b/Driver.h @@ -311,6 +311,7 @@ private: double WaitingExpireTime = 31.0; // tyle ma czekać, zanim się ruszy // maksymlany czas oczekiwania do samoistnego ruszenia double IdleTime {}; // keeps track of time spent at a stop double fStopTime = 0.0; // czas postoju przed dalszą jazdą (np. na przystanku) + float ExchangeTime{ 0.0 }; // time needed to finish current load exchange double fShuntVelocity = 40.0; // maksymalna prędkość manewrowania, zależy m.in. od składu // domyślna prędkość manewrowa int iDrivigFlags = // flagi bitowe ruchu moveStopPoint | // podjedź do W4 możliwie blisko diff --git a/Globals.cpp b/Globals.cpp index 17441c7a..598c5c12 100644 --- a/Globals.cpp +++ b/Globals.cpp @@ -467,6 +467,11 @@ global_settings::ConfigParse(cParser &Parser) { iConvertModels - 128 : 0 ); } + else if( token == "file.binary.terrain" ) { + // binary terrain (de)serialization + Parser.getTokens( 1, false ); + Parser >> file_binary_terrain; + } else if (token == "inactivepause") { // automatyczna pauza, gdy okno nieaktywne diff --git a/Globals.h b/Globals.h index f48eed03..58d8ff0f 100644 --- a/Globals.h +++ b/Globals.h @@ -64,6 +64,7 @@ struct global_settings { std::string SceneryFile{ "td.scn" }; std::string asHumanCtrlVehicle{ "EU07-424" }; int iConvertModels{ 0 }; // tworzenie plików binarnych + bool file_binary_terrain{ true }; // enable binary terrain (de)serialization // logs int iWriteLogEnabled{ 3 }; // maska bitowa: 1-zapis do pliku, 2-okienko, 4-nazwy torów bool MultipleLogs{ false }; diff --git a/Train.cpp b/Train.cpp index ce8983e1..f43bce83 100644 --- a/Train.cpp +++ b/Train.cpp @@ -4713,6 +4713,7 @@ void TTrain::OnCommand_doortoggleleft( TTrain *Train, command_data const &Comman void TTrain::OnCommand_doorpermitleft( TTrain *Train, command_data const &Command ) { if( Command.action == GLFW_REPEAT ) { return; } + if( false == Train->mvOccupied->Doors.permit_presets.empty() ) { return; } if( Command.action == GLFW_PRESS ) { @@ -4749,6 +4750,7 @@ void TTrain::OnCommand_doorpermitleft( TTrain *Train, command_data const &Comman void TTrain::OnCommand_doorpermitright( TTrain *Train, command_data const &Command ) { if( Command.action == GLFW_REPEAT ) { return; } + if( false == Train->mvOccupied->Doors.permit_presets.empty() ) { return; } if( Command.action == GLFW_PRESS ) { diff --git a/driveruipanels.cpp b/driveruipanels.cpp index ca9e422b..412e485f 100644 --- a/driveruipanels.cpp +++ b/driveruipanels.cpp @@ -119,7 +119,7 @@ drivingaid_panel::update() { { // alerter, hints std::string expandedtext; if( is_expanded ) { - auto const stoptime { static_cast( std::ceil( -1.0 * owner->fStopTime ) ) }; + auto const stoptime { static_cast( owner->ExchangeTime ) }; if( stoptime > 0 ) { std::snprintf( m_buffer.data(), m_buffer.size(), diff --git a/opengl33renderer.cpp b/opengl33renderer.cpp index 86c86370..7545a65b 100644 --- a/opengl33renderer.cpp +++ b/opengl33renderer.cpp @@ -3147,7 +3147,8 @@ void opengl33_renderer::Render_Alpha(TAnimModel *Instance) return; } - Instance->RaPrepare(); + Instance->RaAnimate( m_framestamp ); // jednorazowe przeliczenie animacji + Instance->RaPrepare(); if (Instance->pModel) { // renderowanie rekurencyjne submodeli diff --git a/openglrenderer.cpp b/openglrenderer.cpp index 2a966ff5..b4477df2 100644 --- a/openglrenderer.cpp +++ b/openglrenderer.cpp @@ -3194,6 +3194,7 @@ opengl_renderer::Render_Alpha( TAnimModel *Instance ) { return; } + Instance->RaAnimate( m_framestamp ); // jednorazowe przeliczenie animacji Instance->RaPrepare(); if( Instance->pModel ) { // renderowanie rekurencyjne submodeli diff --git a/simulationstateserializer.cpp b/simulationstateserializer.cpp index 0215603a..aca525e0 100644 --- a/simulationstateserializer.cpp +++ b/simulationstateserializer.cpp @@ -42,7 +42,8 @@ state_serializer::deserialize( std::string const &Scenariofile ) { // if this fails, fall back on the legacy text format scene::scratch_data importscratchpad; importscratchpad.name = Scenariofile; - if( Scenariofile != "$.scn" ) { + if( ( true == Global.file_binary_terrain ) + && ( Scenariofile != "$.scn" ) ) { // compilation to binary file isn't supported for rainsted-created overrides // NOTE: we postpone actual loading of the scene until we process time, season and weather data importscratchpad.binary.terrain = Region->is_scene( Scenariofile ) ; @@ -53,7 +54,8 @@ state_serializer::deserialize( std::string const &Scenariofile ) { if( false == scenarioparser.ok() ) { return false; } deserialize( scenarioparser, importscratchpad ); - if( ( false == importscratchpad.binary.terrain ) + if( ( true == Global.file_binary_terrain ) + && ( false == importscratchpad.binary.terrain ) && ( Scenariofile != "$.scn" ) ) { // if we didn't find usable binary version of the scenario files, create them now for future use // as long as the scenario file wasn't rainsted-created base file override diff --git a/version.h b/version.h index af0c2a45..3609970e 100644 --- a/version.h +++ b/version.h @@ -1,5 +1,5 @@ #pragma once #define VERSION_MAJOR 19 -#define VERSION_MINOR 1115 +#define VERSION_MINOR 1117 #define VERSION_REVISION 0