From 55abd24eadf83e5bf995934ccab21a9afaf234d0 Mon Sep 17 00:00:00 2001 From: maj00r Date: Wed, 14 Oct 2026 13:09:44 +0200 Subject: [PATCH] fix(track): at a crossing at nearly a right angle the tip of a guard rail under the wheels of the other track takes their rolling surface on its top, bright under a used track and rusty under an unused one, with the sides staying matte, instead of the whole tip going matte because the plain span of the tread was laid as a band between two lines it does not have; plain spans of treads are painted in the debug colour of EU07_EDITOR_TREADS too --- world/RailLayer.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/world/RailLayer.cpp b/world/RailLayer.cpp index a8a18312..cb9dd0fe 100644 --- a/world/RailLayer.cpp +++ b/world/RailLayer.cpp @@ -299,6 +299,8 @@ struct grooved_profile { float wallu { -1.f }; }; +glm::vec3 const plain_mark { 0.f, 1.f, 1.f }; + bool treads_marked() { static auto const marked { std::getenv( "EU07_EDITOR_TREADS" ) != nullptr }; @@ -480,6 +482,7 @@ private: grooved_profile split_grooved( gfx::vertex_array const &Outline ) const; std::vector top_cuts( gfx::vertex_array const &Top ) const; void running( rail_piece const &Whole, knots::line const &Rolled, piece_ends const &Ends ); + void plain( rail_piece Whole, rail_tread const &Tread, piece_ends const &Ends ); void treaded( rail_piece Whole, rail_tread const &Tread, piece_ends const &Ends ); gfx::vertex_array lay_sides( rail_piece const &Whole, piece_ends const &Ends ); void lay_top( gfx::vertex_array const &Top, rail_piece const &Whole, glm::dvec2 const &Reach, std::vector const &Splits, std::vector const &Bands, std::function( double )> const &Edges, piece_ends const &Ends ); @@ -640,7 +643,10 @@ void TTrack::rail_layer::lay_treads( rail_piece const &Whole, std::vectoredge.empty() ) { + plain( part, *tread, ends ); + } + else if( tread != nullptr && m_topfirst < m_toplast ) { treaded( part, *tread, ends ); } else { @@ -717,7 +723,7 @@ void TTrack::rail_layer::lay_cuts( gfx::vertex_array const &Shape, std::vectormaterial, plain_mark ) : tread_material( tread ) ), .from = splits[ k - 1 ], .to = splits[ k ], .offsets = pieceoffsets, @@ -946,6 +952,17 @@ void TTrack::rail_layer::running( rail_piece const &Whole, knots::line const &Ro Ends ); } +void TTrack::rail_layer::plain( rail_piece Whole, rail_tread const &Tread, piece_ends const &Ends ) { + + Whole.material = null_handle; + auto const top { lay_sides( Whole, Ends ) }; + Whole.material = ( treads_marked() ? paint( Tread.material, plain_mark ) : Tread.material ); + Whole.capfrom = false; + Whole.capto = false; + Whole.rolled = true; + piece( top, Whole, Ends ); +} + void TTrack::rail_layer::treaded( rail_piece Whole, rail_tread const &Tread, piece_ends const &Ends ) { Whole.material = null_handle;