draw_polygon() and draw_circle() have always had a portability

constraint: because some front ends interpret `draw filled shape' to
mean `including its boundary' while others interpret it to mean `not
including its boundary' (and X seems to vacillate between the two
opinions as it moves around the shape!), you MUST NOT draw a filled
shape only. You can fill in one colour and outline in another, you
can fill or outline in the same colour, or you can just outline, but
just filling is a no-no.

This leads to a _lot_ of double calls to these functions, so I've
changed the interface. draw_circle() and draw_polygon() now each
take two colour arguments, a fill colour (which can be -1 for none)
and an outline colour (which must be valid). This should simplify
code in the game back ends, while also reducing the possibility for
coding error.

[originally from svn r6047]
This commit is contained in:
Simon Tatham
2005-07-03 09:35:29 +00:00
parent 8dd7ee3007
commit 64e114cce1
16 changed files with 106 additions and 113 deletions

View File

@ -1436,8 +1436,7 @@ static void draw_tile(frontend *fe, game_drawstate *ds, game_state *state,
points[i+1] = by+(int)(cy+ey);
}
draw_polygon(fe, points, 4, TRUE, col);
draw_polygon(fe, points, 4, FALSE, COL_WIRE);
draw_polygon(fe, points, 4, col, COL_WIRE);
}
/*
@ -1533,8 +1532,7 @@ static void draw_arrow(frontend *fe, game_drawstate *ds,
POINT(5, 3 * TILE_SIZE / 8, TILE_SIZE / 2); /* left concave */
POINT(6, TILE_SIZE / 4, TILE_SIZE / 2); /* left corner */
draw_polygon(fe, coords, 7, TRUE, COL_LOWLIGHT);
draw_polygon(fe, coords, 7, FALSE, COL_TEXT);
draw_polygon(fe, coords, 7, COL_LOWLIGHT, COL_TEXT);
}
static void game_redraw(frontend *fe, game_drawstate *ds, game_state *oldstate,