From d3ac394a43b3976e920674e27e1b872cbf3d39e8 Mon Sep 17 00:00:00 2001 From: maj00r Date: Sat, 17 Oct 2026 23:39:23 +0200 Subject: [PATCH] feat(track): frogs cut from the rails and 3D sleepers switched off in the build track_features::crossings and track_features::sleepers, both off: the rails of plain tracks and of switches with the key frogs are laid whole as before, and no sleepers or timbers are laid whatever sleepers3d in eu07.ini sets, the ballast kept --- world/RailCrossings.cpp | 4 +++- world/TrackFeatures.h | 21 +++++++++++++++++++++ world/TrackSleepers.cpp | 4 ++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 world/TrackFeatures.h 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 ); }