예제 #1
0
파일: draw_menu.c 프로젝트: gsrr/Python
void print_vitetris_ver(int x, int y)
{
	setcurs(x, y);
	setattr_bold();
	printstr(VITETRIS_VER);
	setattr_normal();
}
예제 #2
0
static void printstat_1p()
{
	setattr_normal();
	if (!_WHITE_BG)
		setattr_bold();
	setcurs(1, 2);
	printlong(" %06ld ", player1.score % 1000000);
	setcurs(3, 6);
	printint(" %02d ", player1.level);
	setcurs(3, 10);
	printint(" %03d ", player1.lines);
}
예제 #3
0
파일: ansi.c 프로젝트: gsrr/Python
void set_color_pair(int clr)
{
	int bg = -1;
	char bold = '1';
	if (_MONOCHROME) {
		if (clr == MAGENTA_FG)
			setattr_bold();
		return;
	}
	switch (clr) {
	case 7:
		if (_WHITE_BG)
			clr = 0;
		bg = clr;
		break;
	case 0x17:
		printf("\033[m\033[1m");
		return;
	case MAGENTA_FG:
		clr = 5;
		break;
	case WHITE_ON_BLUE:
		clr = 7;
		bg = 4;
		break;
	case BOARD_BG_COLOR:
		clr = _WHITE_BG ? 6 : 4;
		bold = '0';
		break;
	case BOARD_FRAME_COLOR:
		clr = 4;
		bold = '0';
		break;
	case RED_FG:
		clr = 1;
		break;
	case YELLOW_ON_BLUE:
		clr = 3;
		bg = 4;
		break;
	case YELLOW_ON_GREEN:
		clr = 3;
		bg = 2;
		break;
	default:
		if (clr & 16)
			clr &= 7;
		else
			bg = clr;
	}
	set_ansi_color(bg, clr, bold);
}
예제 #4
0
파일: allegro.c 프로젝트: gsrr/Python
void set_color_pair(int clr)
{
	int bg = 0;
	int bold = 1;
	if (_MONOCHROME) {
		if (clr == MAGENTA_FG)
			setattr_bold();
		return;
	}
	if (clr & 64) {
		bg = clr & 7;
		clr = clr>>3 & 7;
	} else
예제 #5
0
void drawboard(int pl)
{
	int x = board_x(pl, 0);
	int i;
	char tmp[30];
	if (_HEIGHT_24L) {
		//i = x+5;
		//setwcurs(0, i, 0);
		if (!_MONOCHROME) {
			setcolorpair(BOARD_FRAME_COLOR);
			setattr_bold();
		}
		//i = x-5;
		//setwcurs(0, i, 0);
		//sprintf(tmp, "lqNk\\x Nx\\| N|");
		//drawstr(tmp, 8, i, 0);

		i = x+5;
		setwcurs(0, i, 0);
		drawstr("lqNk\\x Nx\\2|_N|", 8, i, 0);

		setcolorpair(BOARD_FRAME_COLOR);
		setcurs(x, 3);
		printstr("_____");
		movefwd(10);
		printstr("_____");
		i = 4;
	} else
		i = 0;
	x--;
	setwcurs(0, x, i);
	setcolorpair(BOARD_FRAME_COLOR);
	for (i = 0; i < 20; i++) {
		putch(VLINE);
		movefwd(20);
		putch(VLINE);
		if (i < 19)
			newln(x);
	}
	if (term_height > 20 && term_height != 24) {
		newln(x);
		printstr_acs("m*Nj", 20);
	} else {
		setcurs(0, term_height-2);
		newln(0);
	}
#ifdef TWOPLAYER
	board_bottom_color[pl-1] = BOARD_FRAME_COLOR;
#endif
}
예제 #6
0
static void printsavebutton(int sel)
{
	if (_MONOCHROME) {
		if (sel)
			setattr_standout();
		else
			setattr_bold();
	} else if (sel) {
		setcolorpair(YELLOW_ON_GREEN);
	} else {
		setcolorpair(4);
		putch('[');
		setcolorpair(YELLOW_ON_BLUE);
		printstr(" Save ");
		setcolorpair(4);
		putch(']');
		goto out;
	}
	printstr("[ Save ]");
out:	setattr_normal();
}