diff --git a/convert_osm/src/osm_reader.rs b/convert_osm/src/osm_reader.rs index 776109de9d..d6e937fd15 100644 --- a/convert_osm/src/osm_reader.rs +++ b/convert_osm/src/osm_reader.rs @@ -329,6 +329,17 @@ fn get_area_type(tags: &BTreeMap) -> Option { if tags.get("natural") == Some(&"water".to_string()) { return Some(AreaType::Water); } + // TODO These just cover up poorly inferred road geometry now. Figure out how to use these. + if false { + if tags.get("traffic_calming") == Some(&"island".to_string()) { + return Some(AreaType::PedestrianIsland); + } + if tags.get("highway") == Some(&"pedestrian".to_string()) + && tags.get("area") == Some(&"yes".to_string()) + { + return Some(AreaType::PedestrianIsland); + } + } None } diff --git a/game/src/debug/mod.rs b/game/src/debug/mod.rs index 47f94ba2fe..144dffa5e2 100644 --- a/game/src/debug/mod.rs +++ b/game/src/debug/mod.rs @@ -336,6 +336,15 @@ fn search_osm(wiz: &mut Wizard, ctx: &mut EventCtx, ui: &mut UI) -> Option DrawArea { - match area.area_type { - AreaType::Park => { - all_park_areas.push( - ctx.canvas.texture("assets/grass_texture.png"), - area.polygon.clone(), - ); - } - AreaType::Water => { - all_water_areas.push( - ctx.canvas.texture("assets/water_texture.png"), - area.polygon.clone(), - ); - } - } + pub fn new(area: &Area, ctx: &EventCtx, all_areas: &mut GeomBatch) -> DrawArea { + let color = match area.area_type { + AreaType::Park => ctx.canvas.texture("assets/grass_texture.png"), + AreaType::Water => ctx.canvas.texture("assets/water_texture.png"), + AreaType::PedestrianIsland => Color::grey(0.3), + }; + all_areas.push(color, area.polygon.clone()); DrawArea { id: area.id } } } diff --git a/game/src/render/map.rs b/game/src/render/map.rs index 7062827b44..4b7cae36ba 100644 --- a/game/src/render/map.rs +++ b/game/src/render/map.rs @@ -209,21 +209,14 @@ impl DrawMap { } let mut areas: Vec = Vec::new(); - let mut all_park_areas = GeomBatch::new(); - let mut all_water_areas = GeomBatch::new(); + let mut all_areas = GeomBatch::new(); timer.start_iter("make DrawAreas", map.all_areas().len()); for a in map.all_areas() { timer.next(); - areas.push(DrawArea::new( - a, - ctx, - &mut all_park_areas, - &mut all_water_areas, - )); + areas.push(DrawArea::new(a, ctx, &mut all_areas)); } timer.start("upload all areas"); - all_park_areas.append(all_water_areas); - let draw_all_areas = ctx.prerender.upload(all_park_areas); + let draw_all_areas = ctx.prerender.upload(all_areas); timer.stop("upload all areas"); let boundary_polygon = ctx.prerender.upload_borrowed(vec![( diff --git a/map_model/src/area.rs b/map_model/src/area.rs index 3819622714..8e94baf3ba 100644 --- a/map_model/src/area.rs +++ b/map_model/src/area.rs @@ -18,6 +18,7 @@ impl fmt::Display for AreaID { pub enum AreaType { Park, Water, + PedestrianIsland, } #[derive(Serialize, Deserialize, Debug)]