aboutsummaryrefslogtreecommitdiff
path: root/ps.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2009-02-22 12:05:38 +0000
committerSimon Tatham <anakin@pobox.com>2009-02-22 12:05:38 +0000
commit407f29c46f35910ce3d7ddd41f13e94213c2597e (patch)
treea276576d6d3161c345015f69447d474f5918a562 /ps.c
parent9249f096192b0a50e607024bf04736ef0506b5ea (diff)
downloadpuzzles-407f29c46f35910ce3d7ddd41f13e94213c2597e.zip
puzzles-407f29c46f35910ce3d7ddd41f13e94213c2597e.tar.gz
puzzles-407f29c46f35910ce3d7ddd41f13e94213c2597e.tar.bz2
puzzles-407f29c46f35910ce3d7ddd41f13e94213c2597e.tar.xz
Introduce some infrastructure to permit games' print functions to
draw dotted lines. No puzzle yet uses this, but one's about to. [originally from svn r8453]
Diffstat (limited to 'ps.c')
-rw-r--r--ps.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/ps.c b/ps.c
index 9f2c17f..f6a71bb 100644
--- a/ps.c
+++ b/ps.c
@@ -231,6 +231,17 @@ static void ps_line_width(void *handle, float width)
ps_printf(ps, "%g setlinewidth\n", width);
}
+static void ps_line_dotted(void *handle, int dotted)
+{
+ psdata *ps = (psdata *)handle;
+
+ if (dotted) {
+ ps_printf(ps, "[ currentlinewidth 3 mul ] 0 setdash\n");
+ } else {
+ ps_printf(ps, "[ ] 0 setdash\n");
+ }
+}
+
static void ps_begin_doc(void *handle, int pages)
{
psdata *ps = (psdata *)handle;
@@ -321,6 +332,7 @@ static const struct drawing_api ps_drawing = {
ps_end_page,
ps_end_doc,
ps_line_width,
+ ps_line_dotted,
};
psdata *ps_init(FILE *outfile, int colour)