jef@helios.ee.lbl.gov (Jef Poskanzer) (12/21/88)
I noticed that screenload has all sorts of options to set the background of a raster when the raster is smaller than the full screen, but it is missing the obvious one: tiling. So I added it, as -t. If you have the sources, apply the appended patch. --- Jef *** /tmp/,RCSt1a00751 Wed Dec 7 10:37:04 1988 --- screenload.c Wed Dec 7 10:36:25 1988 *************** *** 48,53 **** --- 48,54 ---- Pixrect *fill_pr = (Pixrect *) 0; char *display_device = (char *) 0; int pause_flag = 0; + int tile_flag = 0; int warn_flag = 0; FILE *input_file = stdin; *************** *** 62,68 **** opterr = 0; ! while ((c = getopt(argc, argv, "bdf:gh:i:npw")) != EOF) switch (c) { case 'b': --- 63,69 ---- opterr = 0; ! while ((c = getopt(argc, argv, "bdf:gh:i:nptw")) != EOF) switch (c) { case 'b': *************** *** 118,123 **** --- 119,128 ---- pause_flag = 1; break; + case 't': + tile_flag = 1; + break; + case 'w': fill_pr = (Pixrect *) 0; fill_color = 0; *************** *** 131,137 **** if (errflg) error((char *) 0, "Usage:\n\ ! %s [-dp] [-f display] [-i color] [-bgw] [-h count data ...] [file]", Progname); if (optind < argc && --- 136,142 ---- if (errflg) error((char *) 0, "Usage:\n\ ! %s [-dp] [-f display] [-i color] [-bgtw] [-h count data ...] [file]", Progname); if (optind < argc && *************** *** 196,212 **** dx = dx < 0 ? 0 : dx / 2; dy = dy < 0 ? 0 : dy / 2; ! if (fill && (dx > 0 || dy > 0)) ! (void) pr_replrop(disp_pr, 0, 0, ! disp_pr->pr_size.x, disp_pr->pr_size.y, PIX_SRC | PIX_COLOR(fill_color) | PIX_DONTCLIP, ! fill_pr, 0, 0); ! ! if (pr_rop(disp_pr, dx, dy, ! input_pr->pr_size.x, input_pr->pr_size.y, ! PIX_SRC | PIX_COLOR(fill_color), ! input_pr, 0, 0)) ! error(PR_IO_ERR_PIXRECT); /* * If pause option was given, wait for a newline to be typed on --- 201,226 ---- dx = dx < 0 ? 0 : dx / 2; dy = dy < 0 ? 0 : dy / 2; ! if (tile_flag) { ! if (pr_replrop(disp_pr, 0, 0, ! disp_pr->pr_size.x, disp_pr->pr_size.y, PIX_SRC | PIX_COLOR(fill_color) | PIX_DONTCLIP, ! input_pr, 0, 0)) ! error(PR_IO_ERR_PIXRECT); ! } else { ! ! if (fill && (dx > 0 || dy > 0)) ! (void) pr_replrop(disp_pr, 0, 0, ! disp_pr->pr_size.x, disp_pr->pr_size.y, ! PIX_SRC | PIX_COLOR(fill_color) | PIX_DONTCLIP, ! fill_pr, 0, 0); ! ! if (pr_rop(disp_pr, dx, dy, ! input_pr->pr_size.x, input_pr->pr_size.y, ! PIX_SRC | PIX_COLOR(fill_color), ! input_pr, 0, 0)) ! error(PR_IO_ERR_PIXRECT); ! } /* * If pause option was given, wait for a newline to be typed on