aboutsummaryrefslogtreecommitdiff
path: root/guess.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2005-07-03 09:35:29 +0000
committerSimon Tatham <anakin@pobox.com>2005-07-03 09:35:29 +0000
commit64e114cce121e55f0f90cb5692c5020d917aa202 (patch)
tree57186385bcb66066feff354d9f23c400d4e360e4 /guess.c
parent8dd7ee300726872072075a5cdb35ebe9497e3adb (diff)
downloadpuzzles-64e114cce121e55f0f90cb5692c5020d917aa202.zip
puzzles-64e114cce121e55f0f90cb5692c5020d917aa202.tar.gz
puzzles-64e114cce121e55f0f90cb5692c5020d917aa202.tar.bz2
puzzles-64e114cce121e55f0f90cb5692c5020d917aa202.tar.xz
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]
Diffstat (limited to 'guess.c')
-rw-r--r--guess.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/guess.c b/guess.c
index 12d8b1b..9b94123 100644
--- a/guess.c
+++ b/guess.c
@@ -1021,8 +1021,8 @@ static void draw_peg(frontend *fe, game_drawstate *ds, int cx, int cy,
draw_rect(fe, cx-CGAP, cy-CGAP, PEGSZ+CGAP*2, PEGSZ+CGAP*2,
COL_BACKGROUND);
if (PEGRAD > 0) {
- draw_circle(fe, cx+PEGRAD, cy+PEGRAD, PEGRAD, 1, COL_EMPTY + col);
- draw_circle(fe, cx+PEGRAD, cy+PEGRAD, PEGRAD, 0, COL_EMPTY + col);
+ draw_circle(fe, cx+PEGRAD, cy+PEGRAD, PEGRAD,
+ COL_EMPTY + col, COL_EMPTY + col);
} else
draw_rect(fe, cx, cy, PEGSZ, PEGSZ, COL_EMPTY + col);
draw_update(fe, cx-CGAP, cy-CGAP, PEGSZ+CGAP*2, PEGSZ+CGAP*2);
@@ -1030,7 +1030,7 @@ static void draw_peg(frontend *fe, game_drawstate *ds, int cx, int cy,
static void draw_cursor(frontend *fe, game_drawstate *ds, int x, int y)
{
- draw_circle(fe, x+PEGRAD, y+PEGRAD, PEGRAD+CGAP, 0, COL_CURSOR);
+ draw_circle(fe, x+PEGRAD, y+PEGRAD, PEGRAD+CGAP, -1, COL_CURSOR);
draw_update(fe, x-CGAP, y-CGAP, PEGSZ+CGAP*2, PEGSZ+CGAP*2);
}
@@ -1129,8 +1129,7 @@ static void hint_redraw(frontend *fe, game_drawstate *ds, int guess,
rowy += HINTOFF;
}
if (HINTRAD > 0) {
- draw_circle(fe, rowx+HINTRAD, rowy+HINTRAD, HINTRAD, 1, col);
- draw_circle(fe, rowx+HINTRAD, rowy+HINTRAD, HINTRAD, 0, col);
+ draw_circle(fe, rowx+HINTRAD, rowy+HINTRAD, HINTRAD, col, col);
} else {
draw_rect(fe, rowx, rowy, HINTSZ, HINTSZ, col);
}