From 9cd182ffa92e97609d562883a1c8e74949963ba0 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 29 May 2010 15:43:46 +0000 Subject: Patch from Mark Wooding to introduce a draw_thick_line() function in the drawing API, for use by Loopy. It's optional: drawing.c will construct an acceptable alternative using a filled polygon if the front end doesn't provide it. Net and Netslide previously had static functions called draw_thick_line(), whose claim to the name is less justified and so they've been renamed. [originally from svn r8962] --- loopy.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'loopy.c') diff --git a/loopy.c b/loopy.c index 488b507..d915ff7 100644 --- a/loopy.c +++ b/loopy.c @@ -3543,21 +3543,10 @@ static void game_redraw(drawing *dr, game_drawstate *ds, game_state *oldstate, if (draw_faint_lines) draw_line(dr, x1, y1, x2, y2, line_colour); } else { - /* (dx, dy) points roughly from (x1, y1) to (x2, y2). - * The line is then "fattened" in a (roughly) perpendicular - * direction to create a thin rectangle. */ - int dx = (x1 > x2) ? -1 : ((x1 < x2) ? 1 : 0); - int dy = (y1 > y2) ? -1 : ((y1 < y2) ? 1 : 0); - int points[8]; - points[0] = x1 + dy; - points[1] = y1 - dx; - points[2] = x1 - dy; - points[3] = y1 + dx; - points[4] = x2 - dy; - points[5] = y2 + dx; - points[6] = x2 + dy; - points[7] = y2 - dx; - draw_polygon(dr, points, 4, line_colour, line_colour); + draw_thick_line(dr, 3.0, + x1 + 0.5, y1 + 0.5, + x2 + 0.5, y2 + 0.5, + line_colour); } if (ds->started) { /* Draw dots at ends of the line */ -- cgit v1.1