diff options
Diffstat (limited to 'src/display.c')
| -rw-r--r-- | src/display.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/display.c b/src/display.c index a9fc405..7f35907 100644 --- a/src/display.c +++ b/src/display.c @@ -84,13 +84,18 @@ void delete_to_eol() { putbytes(bytes, 3); } -void display_update(struct display *display, struct render_cmd *cmds, - uint32_t ncmds, uint32_t currow, uint32_t curcol) { - for (uint64_t cmdi = 0; cmdi < ncmds; ++cmdi) { - struct render_cmd *cmd = &cmds[cmdi]; - display_move_cursor(display, cmd->row, cmd->col); - putbytes(cmd->data, cmd->len); - delete_to_eol(); +void display_update(struct display *display, struct render_cmd_buf *cmd_bufs, + uint32_t ncmd_bufs, uint32_t currow, uint32_t curcol) { + for (uint32_t bufi = 0; bufi < ncmd_bufs; ++bufi) { + uint64_t ncmds = cmd_bufs[bufi].ncmds; + struct render_cmd *cmds = cmd_bufs[bufi].cmds; + + for (uint64_t cmdi = 0; cmdi < ncmds; ++cmdi) { + struct render_cmd *cmd = &cmds[cmdi]; + display_move_cursor(display, cmd->row, cmd->col); + putbytes(cmd->data, cmd->len); + delete_to_eol(); + } } display_move_cursor(display, currow, curcol); |
