17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-20 12:44:52 +02:00

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
This commit is contained in:
maj00r
2026-10-17 23:39:23 +02:00
parent d25f20a56c
commit d3ac394a43
3 changed files with 28 additions and 1 deletions

View File

@@ -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 :

21
world/TrackFeatures.h Normal file
View File

@@ -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

View File

@@ -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<double, double> 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 );
}