Index: animator/hid_anim.c =================================================================== --- animator/hid_anim.c (revision 4736) +++ animator/hid_anim.c (revision 4737) @@ -48,6 +48,7 @@ typedef struct { unsigned in_use:1; + char color[16]; } gc_t; #define NUM_GC 32 @@ -87,6 +88,22 @@ } } +static void cmd_clr(proto_node_t *args) +{ + int idx; + proto_node_t *ch1 = child1(args); + char *gs = str(ch1), *cs = str(next(ch1)); + + if ((cs == NULL) || (gs == NULL)) + return; + idx = atoi(gs); + if ((idx < 0) || (idx >= NUM_GC) || !gc[idx].in_use) + return; + if ((strlen(cs) > 7) || (*cs != '#')) + return; + strcpy(gc[idx].color, cs); +} + static void read_netin(void) { P_size_t len, n; @@ -107,6 +124,7 @@ case cmds_ready: cmd_ready(pctx.targ); break; case cmds_makeGC: cmd_makeGC(pctx.targ); break; case cmds_delGC: cmd_delGC(pctx.targ); break; + case cmds_clr: cmd_clr(pctx.targ); break; /* ignore */ case cmds_inval: