mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-08 19:52:47 +01:00
Merge branch 'master' into feat/renderers-cleanup
This commit is contained in:
@@ -530,7 +530,7 @@ bool editor_track::can_edit_geometry(TTrack const &Track, std::string &Reason)
|
||||
return true;
|
||||
}
|
||||
|
||||
void editor_track::commit(std::vector<TTrack *> const &Tracks)
|
||||
void editor_track::commit(std::vector<TTrack *> const &Tracks, bool const Dragging)
|
||||
{
|
||||
if (Tracks.empty())
|
||||
return;
|
||||
@@ -566,6 +566,8 @@ void editor_track::commit(std::vector<TTrack *> const &Tracks)
|
||||
add_unique(affected, neighbour);
|
||||
for (auto *track : affected)
|
||||
update_transition(*track);
|
||||
if (false == Dragging)
|
||||
add_followers(affected);
|
||||
for (auto *track : affected)
|
||||
rebuild_geometry(*track);
|
||||
for (auto *track : Tracks)
|
||||
@@ -590,6 +592,7 @@ void editor_track::commit_parameters(TTrack &Track)
|
||||
add_unique(affected, neighbour);
|
||||
for (auto *track : affected)
|
||||
update_transition(*track);
|
||||
add_followers(affected);
|
||||
for (auto *track : affected)
|
||||
rebuild_geometry(*track);
|
||||
Track.mark_dirty();
|
||||
@@ -3764,10 +3767,11 @@ void editor_track::retire(TTrack &Track)
|
||||
// the name is free for the path laid in its place, as the switches of a crossover laid again keep theirs
|
||||
simulation::Paths.rename(&Track, std::string{});
|
||||
for (auto *neighbour : adjoining)
|
||||
{
|
||||
update_transition(*neighbour);
|
||||
rebuild_geometry(*neighbour);
|
||||
}
|
||||
auto affected{adjoining};
|
||||
add_followers(affected);
|
||||
for (auto *track : affected)
|
||||
rebuild_geometry(*track);
|
||||
auto crossings{Track.m_crossings};
|
||||
for (auto *crossing : Track.m_crossings)
|
||||
for (auto *neighbour : neighbours(*crossing))
|
||||
@@ -3785,6 +3789,16 @@ void editor_track::revive(TTrack &Track)
|
||||
WriteLog("Editor: the path " + Track.name() + " came back, but another one has its name now", logtype::generic);
|
||||
}
|
||||
|
||||
void editor_track::add_followers(std::vector<TTrack *> &Tracks)
|
||||
{
|
||||
++TTrack::s_layoutstamp;
|
||||
for (auto *track : TTrack::switch_followers(Tracks))
|
||||
add_unique(Tracks, track);
|
||||
for (auto *track : simulation::Paths.sequence())
|
||||
if (false == track->m_editorremoved && track->rail_joints_moved())
|
||||
add_unique(Tracks, track);
|
||||
}
|
||||
|
||||
void editor_track::rebuild_geometry(TTrack &Track)
|
||||
{
|
||||
auto const rebuild = [](TTrack &Path) {
|
||||
|
||||
Reference in New Issue
Block a user