示例#1
0
文件: term.c 项目: kremlhi/tetris
void
drawpixel(int x, int y, enum colour_t colour)
{
	if(y < 4)
		return;
	posxy(x, y);
	printf(CSI "7;%dm" "  " CSI "0m", colour);
}
/* desenha bloco na tela */
void bloco(short ci, short cf, short li, short lf)
{
    ci--; cf--; li--; lf--; int to1 = (cf - ci);
    for(int i = li; i < lf; i++)
    {
        posxy(ci, i);
        for(int j = 0; j < to1; j++)
            cout << " ";
    }
}
示例#3
0
文件: term.c 项目: kremlhi/tetris
void
drawtext(char *fmt, ...)
{
	va_list ap;
	static char buf[MAXTEXTLEN];
	int len;

	va_start(ap, fmt);
	len = vsnprintf(buf, sizeof buf, fmt, ap);
	va_end(ap);
	posxy(WIDTH/2 - len/4, HEIGHT/2);
	printf("%s", buf);
	flush();
}