From 4046be3966f95d54f06b6f18265edbde66e85ad7 Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Mon, 16 Dec 2019 18:46:03 -0800 Subject: [PATCH] start drawing agents in the minimap. theyre a bit big. --- game/src/common/minimap.rs | 11 +++++++++++ game/src/render/map.rs | 32 ++++++++++++++++++++------------ game/src/ui.rs | 10 +++++++++- 3 files changed, 40 insertions(+), 13 deletions(-) diff --git a/game/src/common/minimap.rs b/game/src/common/minimap.rs index a25902e30f..fe10d7b34c 100644 --- a/game/src/common/minimap.rs +++ b/game/src/common/minimap.rs @@ -127,6 +127,17 @@ impl Minimap { ); g.redraw_clipped(&ui.primary.draw_map.draw_all_buildings, &inner_rect); + let mut cache = ui.primary.draw_map.agents.borrow_mut(); + cache.draw_unzoomed_agents( + &ui.primary.sim, + &ui.primary.map, + ui.agent_cs, + &ui.cs, + g, + Some(&inner_rect), + zoom, + ); + // The cursor let (x1, y1) = { let pt = g.canvas.screen_to_map(ScreenPt::new(0.0, 0.0)); diff --git a/game/src/render/map.rs b/game/src/render/map.rs index 82998abcd3..863ef36fc3 100644 --- a/game/src/render/map.rs +++ b/game/src/render/map.rs @@ -11,7 +11,7 @@ use crate::render::Renderable; use crate::ui::Flags; use aabb_quadtree::QuadTree; use abstutil::{Cloneable, Timer}; -use ezgui::{Color, Drawable, EventCtx, GeomBatch, GfxCtx, Line, Text}; +use ezgui::{Color, Drawable, EventCtx, GeomBatch, GfxCtx, Line, ScreenRectangle, Text}; use geom::{Bounds, Circle, Distance, Duration, FindClosest, Time}; use map_model::{ AreaID, BuildingID, BusStopID, DirectedRoadID, Intersection, IntersectionID, LaneID, Map, Road, @@ -296,10 +296,11 @@ impl DrawMap { } pub struct AgentCache { + // This time applies to agents_per_on. unzoomed has its own possibly separate Time! time: Option