X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/puzzles/blobdiff_plain/e2cbd23a0f724f7ec8da5112e184152586a87d36..81ff8295651d75cdd07ff6fbb5a52d8aebe84136:/windows.c diff --git a/windows.c b/windows.c index 7b3ef64..ae93983 100644 --- a/windows.c +++ b/windows.c @@ -33,7 +33,7 @@ #define HELP_FILE_NAME "puzzles.hlp" #define HELP_CNT_NAME "puzzles.cnt" -#ifdef DEBUG +#ifdef DEBUGGING static FILE *debug_fp = NULL; static HANDLE debug_hdl = INVALID_HANDLE_VALUE; static int debug_got_console = 0; @@ -330,6 +330,25 @@ void draw_line(frontend *fe, int x1, int y1, int x2, int y2, int colour) SelectObject(fe->hdc_bm, oldpen); } +void draw_circle(frontend *fe, int cx, int cy, int radius, + int fill, int colour) +{ + if (fill) { + HBRUSH oldbrush = SelectObject(fe->hdc_bm, fe->brushes[colour]); + HPEN oldpen = SelectObject(fe->hdc_bm, fe->pens[colour]); + Ellipse(fe->hdc_bm, cx - radius, cy - radius, + cx + radius + 1, cy + radius + 1); + SelectObject(fe->hdc_bm, oldbrush); + SelectObject(fe->hdc_bm, oldpen); + } else { + HPEN oldpen = SelectObject(fe->hdc_bm, fe->pens[colour]); + Arc(fe->hdc_bm, cx - radius, cy - radius, + cx + radius + 1, cy + radius + 1, + cx - radius, cy, cx - radius, cy); + SelectObject(fe->hdc_bm, oldpen); + } +} + void draw_polygon(frontend *fe, int *coords, int npoints, int fill, int colour) {