|
@@ -663,6 +663,29 @@ int pipi_command(pipi_context_t *ctx, char const *cmd, ...) |
|
|
(val - 1) * sizeof(*ctx->images)); |
|
|
(val - 1) * sizeof(*ctx->images)); |
|
|
ctx->images[ctx->nimages - 1] = tmp; |
|
|
ctx->images[ctx->nimages - 1] = tmp; |
|
|
} |
|
|
} |
|
|
|
|
|
else if(!strcmp(cmd, "line")) |
|
|
|
|
|
{ |
|
|
|
|
|
char const *arg; |
|
|
|
|
|
va_list ap; |
|
|
|
|
|
int x1, y1, x2, y2, aa = 0, ret; |
|
|
|
|
|
uint32_t color = 0; |
|
|
|
|
|
|
|
|
|
|
|
if(ctx->nimages < 1) |
|
|
|
|
|
return -1; |
|
|
|
|
|
|
|
|
|
|
|
va_start(ap, cmd); |
|
|
|
|
|
arg = va_arg(ap, char const *); |
|
|
|
|
|
va_end(ap); |
|
|
|
|
|
|
|
|
|
|
|
ret = sscanf(arg, "%d,%d,%d,%d,%08x,%d", |
|
|
|
|
|
&x1, &y1, &x2, &y2, &color, &aa); |
|
|
|
|
|
if(ret < 5) return -1; |
|
|
|
|
|
|
|
|
|
|
|
ctx->images[ctx->nimages] = pipi_copy(ctx->images[ctx->nimages - 1]); |
|
|
|
|
|
pipi_draw_line(ctx->images[ctx->nimages], |
|
|
|
|
|
x1, y1, x2, y2, color, aa); |
|
|
|
|
|
ctx->nimages++; |
|
|
|
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
return -1; |
|
|
return -1; |
|
|