Index: work/remote/animator/cmds =================================================================== --- work/remote/animator/cmds (revision 5130) +++ work/remote/animator/cmds (revision 5131) @@ -14,3 +14,4 @@ fcirc poly umask +exit Index: work/remote/animator/draw_helper.c =================================================================== --- work/remote/animator/draw_helper.c (revision 5130) +++ work/remote/animator/draw_helper.c (revision 5131) @@ -1,10 +1,11 @@ #include #include +#include /* draw a line with rounded ends do not draw end circles if omit_ends is non-zero extend both ends by length_bloat */ -void draw_rline(double x1, double y1, double x2, double y2, double width, int round_cap) +void draw_rline(P_net_socket sk, double x1, double y1, double x2, double y2, double width, int round_cap) { double nx = y2-y1; double ny = -1.0 * (x2-x1); @@ -33,14 +34,17 @@ y2 += (width/2) * vy; } - printf("poly %f %f %f %f %f %f %f %f\n", + P_net_printf(sk, "poly %f %f %f %f %f %f %f %f\n", x1+nx*width/2, y1+ny*width/2, x2+nx*width/2, y2+ny*width/2, x2-nx*width/2, y2-ny*width/2, x1-nx*width/2, y1-ny*width/2); } if (round_cap) { - printf("fillcircle %f %f %f %f\n", x1, y1, width/2, width/10); + int segs = width/10; + if (segs < 10) + segs = 10; + P_net_printf(sk, "fillcircle %f %f %f %d\n", x1, y1, width/2, segs); if ((x1 != x2) || (y1 != y2)) - printf("fillcircle %f %f %f %f\n", x2, y2, width/2, width/10); + P_net_printf(sk, "fillcircle %f %f %f %d\n", x2, y2, width/2, segs); } } Index: work/remote/animator/draw_helper.h =================================================================== --- work/remote/animator/draw_helper.h (revision 5130) +++ work/remote/animator/draw_helper.h (revision 5131) @@ -1,2 +1,4 @@ -void draw_rline(double x1, double y1, double x2, double y2, double width, int round_cap); +void draw_rline(P_net_socket sk, double x1, double y1, double x2, double y2, double width, int round_cap); + + Index: work/remote/animator/hid_anim.c =================================================================== --- work/remote/animator/hid_anim.c (revision 5130) +++ work/remote/animator/hid_anim.c (revision 5131) @@ -13,7 +13,7 @@ #include "draw_helper.h" static proto_ctx_t pctx; -P_net_socket s_netin, s_netout; +P_net_socket s_netin, s_netout, s_anim_out, s_anim_in; static char *current_unit = NULL; @@ -59,9 +59,7 @@ gc = use_gc(gci); if (gc == NULL) abort(); - if (strcmp(gc->name - - draw_rline(x1, y1, x2, y2, gc->width, gc->cap == 'r'); + draw_rline(s_anim_out, x1, y1, x2, y2, gc->width, gc->cap == 'r'); } static void cmd_ready(proto_node_t *args) @@ -98,6 +96,7 @@ case cmds_setxor: cmd_setxor(pctx.targ); break; case cmds_line: cmd_line(pctx.targ); break; + case cmds_exit: exit(0); /* ignore */ case cmds_inval: case cmds_umask: @@ -123,6 +122,8 @@ pfds[0].fd = s_netin; pfds[0].events = P_POLLIN; + s_anim_out = 2; + for(;;) { P_poll(pfds, 1, 100); if ((pfds[0].revents & P_POLLIN))