diff options
| author | Simon Tatham <anakin@pobox.com> | 2022-12-11 18:48:57 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2022-12-11 18:52:06 +0000 |
| commit | 676ec87b6d9ef1cf0adfe30af2df1e8a43c6523c (patch) | |
| tree | a9e3f57fe915698340a1062ff0aceb805b3581b3 /pearl.c | |
| parent | 3150d72800ec9f49001bf568df224375ea133747 (diff) | |
| download | puzzles-676ec87b6d9ef1cf0adfe30af2df1e8a43c6523c.zip puzzles-676ec87b6d9ef1cf0adfe30af2df1e8a43c6523c.tar.gz puzzles-676ec87b6d9ef1cf0adfe30af2df1e8a43c6523c.tar.bz2 puzzles-676ec87b6d9ef1cf0adfe30af2df1e8a43c6523c.tar.xz | |
Pearl: make PEARL_GUI_LOOPY affect printed output.
This display style is perfectly playable on paper (proof: it works for
Loopy), so there's no reason not to support both modes in both output
routines.
Diffstat (limited to 'pearl.c')
| -rw-r--r-- | pearl.c | 33 |
1 files changed, 26 insertions, 7 deletions
@@ -2619,17 +2619,36 @@ static void game_print(drawing *dr, const game_state *state, int tilesize) int black = print_mono_colour(dr, 0); int white = print_mono_colour(dr, 1); - /* No GUI_LOOPY here: only use the familiar masyu style. */ - /* Ick: fake up `ds->tilesize' for macro expansion purposes */ game_drawstate *ds = game_new_drawstate(dr, state); game_set_size(dr, ds, NULL, tilesize); - /* Draw grid outlines (black). */ - for (x = 0; x <= w; x++) - draw_line(dr, COORD(x), COORD(0), COORD(x), COORD(h), black); - for (y = 0; y <= h; y++) - draw_line(dr, COORD(0), COORD(y), COORD(w), COORD(y), black); + if (get_gui_style() == GUI_MASYU) { + /* Draw grid outlines (black). */ + for (x = 0; x <= w; x++) + draw_line(dr, COORD(x), COORD(0), COORD(x), COORD(h), black); + for (y = 0; y <= h; y++) + draw_line(dr, COORD(0), COORD(y), COORD(w), COORD(y), black); + } else { + /* Draw small dots, and dotted lines connecting them. For + * added clarity, try to start and end the dotted lines a + * little way away from the dots. */ + print_line_width(dr, TILE_SIZE / 40); + print_line_dotted(dr, true); + for (x = 0; x < w; x++) { + for (y = 0; y < h; y++) { + int cx = COORD(x) + HALFSZ, cy = COORD(y) + HALFSZ; + draw_circle(dr, cx, cy, tilesize/10, black, black); + if (x+1 < w) + draw_line(dr, cx+tilesize/5, cy, + cx+tilesize-tilesize/5, cy, black); + if (y+1 < h) + draw_line(dr, cx, cy+tilesize/5, + cx, cy+tilesize-tilesize/5, black); + } + } + print_line_dotted(dr, false); + } for (x = 0; x < w; x++) { for (y = 0; y < h; y++) { |