Skip to content

Commit

Permalink
1140
Browse files Browse the repository at this point in the history
Dump deprecated interface.
  • Loading branch information
akkartik committed Apr 23, 2015
1 parent 9a31c34 commit c04baba
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 42 deletions.
34 changes: 0 additions & 34 deletions cpp/termbox/termbox.c
Expand Up @@ -237,40 +237,6 @@ void tb_change_cell(int x, int y, uint32_t ch, uint16_t fg, uint16_t bg)
tb_put_cell(x, y, &c);
}

void tb_blit(int x, int y, int w, int h, const struct tb_cell *cells)
{
if (x + w < 0 || x >= back_buffer.width)
return;
if (y + h < 0 || y >= back_buffer.height)
return;
int xo = 0, yo = 0, ww = w, hh = h;
if (x < 0) {
xo = -x;
ww -= xo;
x = 0;
}
if (y < 0) {
yo = -y;
hh -= yo;
y = 0;
}
if (ww > back_buffer.width - x)
ww = back_buffer.width - x;
if (hh > back_buffer.height - y)
hh = back_buffer.height - y;

int sy;
struct tb_cell *dst = &CELL(&back_buffer, x, y);
const struct tb_cell *src = cells + yo * w + xo;
size_t size = sizeof(struct tb_cell) * ww;

for (sy = 0; sy < hh; ++sy) {
memcpy(dst, src, size);
dst += back_buffer.width;
src += w;
}
}

struct tb_cell *tb_cell_buffer()
{
return back_buffer.cells;
Expand Down
8 changes: 0 additions & 8 deletions cpp/termbox/termbox.h
Expand Up @@ -206,14 +206,6 @@ SO_IMPORT void tb_set_cursor(int cx, int cy);
SO_IMPORT void tb_put_cell(int x, int y, const struct tb_cell *cell);
SO_IMPORT void tb_change_cell(int x, int y, uint32_t ch, uint16_t fg, uint16_t bg);

/* Copies the buffer from 'cells' at the specified position, assuming the
* buffer is a two-dimensional array of size ('w' x 'h'), represented as a
* one-dimensional buffer containing lines of cells starting from the top.
*
* (DEPRECATED: use tb_cell_buffer() instead and copy memory on your own)
*/
SO_IMPORT void tb_blit(int x, int y, int w, int h, const struct tb_cell *cells);

/* Returns a pointer to internal cell back buffer. You can get its dimensions
* using tb_width() and tb_height() functions. The pointer stays valid as long
* as no tb_clear() and tb_present() calls are made. The buffer is
Expand Down

0 comments on commit c04baba

Please sign in to comment.