Fix a bug in efaf6085e4 that was using walking paths for vehicles. Now prebaked data doesn't budge.

And add some more timing to demonstrate why editing a single lane in a
huge map is so slow...
This commit is contained in:
Dustin Carlino 2021-07-02 11:25:02 -07:00
parent f4c8a508da
commit 866ecd5f88
2 changed files with 9 additions and 2 deletions

View File

@ -685,7 +685,9 @@ fn make_topcenter(ctx: &mut EventCtx, app: &App) -> Panel {
pub fn apply_map_edits(ctx: &mut EventCtx, app: &mut App, edits: MapEdits) {
let mut timer = Timer::new("apply map edits");
timer.start("edit map");
let effects = app.primary.map.must_apply_edits(edits);
timer.stop("edit map");
if !effects.changed_roads.is_empty() || !effects.changed_intersections.is_empty() {
app.primary
@ -715,11 +717,13 @@ pub fn apply_map_edits(ctx: &mut EventCtx, app: &mut App, edits: MapEdits) {
.recreate_intersection(i, &app.primary.map);
}
timer.start("resnap buildings");
if effects.resnapped_buildings {
app.primary
.draw_map
.recreate_building_driveways(ctx, &app.primary.map, &app.cs, &app.opts);
}
timer.stop("resnap buildings");
for pl in effects.changed_parking_lots {
app.primary.draw_map.get_pl(pl).clear_rendering();
}

View File

@ -201,8 +201,11 @@ impl TripManager {
} else {
PathConstraints::Car
};
let req =
PathRequest::walking(start_pos, goal.goal_pos(constraints, ctx.map).unwrap());
let req = PathRequest::vehicle(
start_pos,
goal.goal_pos(constraints, ctx.map).unwrap(),
constraints,
);
let person = person.id;
match self.maybe_spawn_car(ctx, now, trip, req, vehicle.id) {