17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 03:59:19 +02:00

feat(track): frogs, crossings and shared running surfaces only for the rail profiles the sceneries of the package use: tracks without a profile, default, s60, uic60 and s39; rails of other profiles are laid whole again

This commit is contained in:
maj00r
2026-10-14 00:03:06 +02:00
parent 592d1687d5
commit a6e39ba77f

View File

@@ -94,6 +94,12 @@ gauge_line make_gauge_line( TSegment const &Segment, double const Offset, double
return line;
}
bool cut_profile( std::string Profile ) {
std::transform( Profile.begin(), Profile.end(), Profile.begin(), []( unsigned char const Char ) { return static_cast<char>( std::tolower( Char ) ); } );
return Profile.empty() || Profile == "default" || Profile == "s60" || Profile == "uic60" || Profile == "s39";
}
bool joined( TTrack const &Track, TTrack const &Other ) {
auto const next = []( TTrack const &From, TTrack const &To ) {
@@ -176,6 +182,7 @@ bool cut_rails( TTrack const &Track ) {
return ( Track.iCategoryFlag & 15 ) == 1
&& Track.m_material1 != null_handle
&& false == Track.m_editorremoved
&& cut_profile( Track.m_profile1.first )
&& ( Track.eType == tt_Normal ? Track.Segment != nullptr :
Track.eType == tt_Switch && Track.SwitchExtension && Track.SwitchExtension->m_frogs && Track.SwitchExtension->Segments[ 0 ] && Track.SwitchExtension->Segments[ 1 ] );
}