mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
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:
4
solo.c
4
solo.c
@ -2215,7 +2215,7 @@ static void draw_number(frontend *fe, game_drawstate *ds, game_state *state,
|
||||
coords[3] = cy;
|
||||
coords[4] = cx;
|
||||
coords[5] = cy+ch/2;
|
||||
draw_polygon(fe, coords, 3, TRUE, COL_HIGHLIGHT);
|
||||
draw_polygon(fe, coords, 3, COL_HIGHLIGHT, COL_HIGHLIGHT);
|
||||
}
|
||||
|
||||
/* new number needs drawing? */
|
||||
@ -2438,7 +2438,7 @@ void draw_text(frontend *fe, int x, int y, int fonttype, int fontsize,
|
||||
void draw_rect(frontend *fe, int x, int y, int w, int h, int colour) {}
|
||||
void draw_line(frontend *fe, int x1, int y1, int x2, int y2, int colour) {}
|
||||
void draw_polygon(frontend *fe, int *coords, int npoints,
|
||||
int fill, int colour) {}
|
||||
int fillcolour, int outlinecolour) {}
|
||||
void clip(frontend *fe, int x, int y, int w, int h) {}
|
||||
void unclip(frontend *fe) {}
|
||||
void start_draw(frontend *fe) {}
|
||||
|
Reference in New Issue
Block a user