diff options
Diffstat (limited to 'src/tool')
| -rw-r--r-- | src/tool/wall_tool.rs | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/src/tool/wall_tool.rs b/src/tool/wall_tool.rs index e6503ba..d86d0af 100644 --- a/src/tool/wall_tool.rs +++ b/src/tool/wall_tool.rs @@ -61,11 +61,11 @@ impl Tool for WallTool { fn draw(&self, map_data: &MapData, rld: &mut RaylibDrawHandle, transform: &Transform) { for &(pos1, pos2) in map_data.walls() { - let pos1: Vector2 = transform.point_m_to_px(&pos1).into(); - let pos2: Vector2 = transform.point_m_to_px(&pos2).into(); + let pos1_px = transform.point_m_to_px(&pos1); + let pos2_px = transform.point_m_to_px(&pos2); rld.draw_line_ex( - pos1, - pos2, + pos1_px, + pos2_px, transform.length_m_to_px(0.1) as f32, Color { r: 200, @@ -74,6 +74,32 @@ impl Tool for WallTool { a: 255, }, ); + + /* Find walls that end/start at the start or end of this wall and draw part of a circle + * to join these two walls more nicely. + */ + for &(other1, other2) in map_data.walls() { + // Ignore the line segment if it's the same wall + if pos1 == other1 && pos2 == other2 { + continue; + } + + // TODO: Only draw segments when introducing transparency. + for pos in [pos1, pos2].iter() { + if *pos == other1 || *pos == other2 { + rld.draw_circle_v( + transform.point_m_to_px(&pos), + transform.length_m_to_px(0.05) as f32, + Color { + r: 200, + g: 120, + b: 120, + a: 255, + }, + ); + } + } + } } if let Some((pos1, pos2)) = self.unfinished_wall { |
