diff --git a/include/QF/console.h b/include/QF/console.h index 79aac8e69..8839f1b73 100644 --- a/include/QF/console.h +++ b/include/QF/console.h @@ -98,6 +98,7 @@ con_buffer_t *Con_CreateBuffer (size_t buffer_size, int max_lines); void Con_DestroyBuffer (con_buffer_t *buffer); void Con_BufferAddText (con_buffer_t *buf, const char *text); #define Con_BufferLine(b,l) ((b)->lines + ((l) + (b)->max_lines) % (b)->max_lines) +void Con_ClearBuffer (con_buffer_t *buffer); // init/shutdown functions void Con_Init (const char *plugin_name); diff --git a/libs/console/buffer.c b/libs/console/buffer.c index 006a2c7bb..9f0b08c5e 100644 --- a/libs/console/buffer.c +++ b/libs/console/buffer.c @@ -125,3 +125,12 @@ Con_BufferAddText (con_buffer_t *buf, const char *text) } } } + +VISIBLE void +Con_ClearBuffer (con_buffer_t *buffer) +{ + buffer->line_head = 1; + buffer->line_tail = 0; + buffer->lines[0].text = 0; + buffer->lines[0].len = 0; +}