mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-29 12:43:38 +03:00
redraw stop signs and traffic signals as changes happen
This commit is contained in:
parent
8c2d383fd7
commit
bd108b8d9a
@ -421,7 +421,7 @@ pub fn apply_map_edits(
|
||||
edits.dirty = true;
|
||||
let mut timer = Timer::new("apply map edits");
|
||||
|
||||
let (lanes_changed, roads_changed, turns_deleted, turns_added) =
|
||||
let (lanes_changed, roads_changed, turns_deleted, turns_added, mut modified_intersections) =
|
||||
bundle.map.apply_edits(edits, &mut timer);
|
||||
|
||||
for l in lanes_changed {
|
||||
@ -439,7 +439,6 @@ pub fn apply_map_edits(
|
||||
DrawRoad::new(bundle.map.get_r(r), &bundle.map, cs, ctx.prerender);
|
||||
}
|
||||
|
||||
let mut modified_intersections: BTreeSet<IntersectionID> = BTreeSet::new();
|
||||
let mut lanes_of_modified_turns: BTreeSet<LaneID> = BTreeSet::new();
|
||||
for t in turns_deleted {
|
||||
bundle.draw_map.turns.remove(&t);
|
||||
|
@ -642,7 +642,7 @@ impl Map {
|
||||
}
|
||||
|
||||
// new_edits assumed to be valid. Returns actual lanes that changed, roads changed, turns
|
||||
// deleted, turns added. Doesn't update pathfinding yet.
|
||||
// deleted, turns added, intersections modified. Doesn't update pathfinding yet.
|
||||
pub fn apply_edits(
|
||||
&mut self,
|
||||
mut new_edits: MapEdits,
|
||||
@ -652,6 +652,7 @@ impl Map {
|
||||
BTreeSet<RoadID>,
|
||||
BTreeSet<TurnID>,
|
||||
BTreeSet<TurnID>,
|
||||
BTreeSet<IntersectionID>,
|
||||
) {
|
||||
// TODO More efficient ways to do this: given two sets of edits, produce a smaller diff.
|
||||
// Simplest strategy: Remove common prefix.
|
||||
@ -710,6 +711,7 @@ impl Map {
|
||||
.into_iter()
|
||||
.filter(|t| self.turns.contains_key(t))
|
||||
.collect(),
|
||||
effects.changed_intersections,
|
||||
)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user