diff --git a/world/RailCrossings.cpp b/world/RailCrossings.cpp index 3d596e70..1b94e94c 100644 --- a/world/RailCrossings.cpp +++ b/world/RailCrossings.cpp @@ -10,6 +10,7 @@ http://mozilla.org/MPL/2.0/. #include "stdafx.h" #include "world/TrackRails.h" +#include "world/TrackFeatures.h" #include "simulation/simulation.h" #include "scene/scene.h" @@ -87,7 +88,8 @@ double check_length( double const Slope ) { // the rails of the track are cut where they cross other rails: plain tracks, and switches whose frog is made from the rails bool cut_rails( TTrack const &Track ) { - return ( Track.iCategoryFlag & 15 ) == 1 + return track_features::crossings + && ( Track.iCategoryFlag & 15 ) == 1 && Track.m_material1 != null_handle && false == Track.m_editorremoved && ( Track.eType == tt_Normal ? Track.Segment != nullptr : diff --git a/world/TrackFeatures.h b/world/TrackFeatures.h new file mode 100644 index 00000000..e9b13768 --- /dev/null +++ b/world/TrackFeatures.h @@ -0,0 +1,21 @@ +/* +This Source Code Form is subject to the +terms of the Mozilla Public License, v. +2.0. If a copy of the MPL was not +distributed with this file, You can +obtain one at +http://mozilla.org/MPL/2.0/. +*/ + +#pragma once + +// features of the tracks built into the simulator but switched off in it as a whole, whatever the scenery or eu07.ini sets +namespace track_features { + +// the rails cut where they cross other rails into frogs, wing rails and check rails; off, the rails of plain tracks and of +// switches with the key frogs are laid whole, as before +bool constexpr crossings { false }; +// the 3D sleepers and switch timbers of sleepers3d; off, the tracks keep their ballast whatever eu07.ini sets +bool constexpr sleepers { false }; + +} // namespace track_features diff --git a/world/TrackSleepers.cpp b/world/TrackSleepers.cpp index 3c7c05ef..7dd55340 100644 --- a/world/TrackSleepers.cpp +++ b/world/TrackSleepers.cpp @@ -10,6 +10,7 @@ http://mozilla.org/MPL/2.0/. #include "stdafx.h" #include "world/TrackSleepers.h" +#include "world/TrackFeatures.h" #include "world/Track.h" #include "model/Model3d.h" #include "model/MdlMngr.h" @@ -1125,6 +1126,9 @@ std::pair panel_off_plane( TTrack &Track ) { beam_model const *timber_model() { + if( false == track_features::sleepers ) { + return nullptr; + } return find_model( Global.Sleepers3D, std::string {}, -1.f ); }