Example #1
0
File: win.c Project: gsrr/Python
void getwin_xy(int win, int *x, int *y)
{
	*y = 0;
	switch (win) {
	case 0:
		*x = 0;
		return;
	case 1:
	case 2:
		*x = board_x(win, 0);
		break;
	case WIN_NEXT:
	case WIN_NEXT+1:
		next_xy(1+win-WIN_NEXT, x, y);
		return;
	case WIN_PANEL:
		*x = TWOPLAYER_MODE ? 22 : 0;
		break;
	case WIN_TETROM_STATS:
		*y = 11;
	case WIN_TOP_SCORES:
		*x = board_x(1, 12);
		if (!*y && !_HEIGHT_24L)
			*y = 1;
	}
	if (_HEIGHT_24L)
		*y += 4;
}
Example #2
0
void next_xy(int pl, int *x, int *y)
{
	if (_HEIGHT_24L)
		*x = board_x(pl, 3);
	else if (TWOPLAYER_MODE)
		*x = (pl==1) ? -9 : board_x(2, 11);
	else {
		*x = 1;
		*y = 15;
		return;
	}
	*y = 1;
}
Example #3
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
}
Example #4
0
void print_game_message(int pl, const char *str, int bold)
{
	int x = board_x(pl, 4);
	int n = strlen(str);
	if (!(game->player[pl-1].rotationsys & ROT_LEFTHAND))
		x--;
	while (n >= 6) {
		x--;
		n -= 2;
	}
	setwcurs(0, x, _HEIGHT_24L ? 7 : 3);
	setattr_normal();
	if (bold)
		setcolorpair(MAGENTA_FG);
	printstr(str);
	refreshwin(0);
}
Example #5
0
static void drawpanel_1p()
{
	int h24 = _HEIGHT_24L;
	int clr = (player1.level % 6)+1;
	int i;
	setwcurs(WIN_PANEL, 0, 0);
	setblockcolor(clr);
	printstr_acs("lqNu", 8);
	for (i = 0; i <= 8; i += 4)
		drawstr("\\xhNx\\3tqNu", 8, 0, i);
	if (h24) {
		setcurs(0, 12);
		putch(LOWLEFT);
		drawpanel_labels("Score", 1);
	} else {
		setcurs(0, 13);
		printstr_acs("xhNx", 8);
		drawpanel_labels("Score", 1);
		setcurs(2, 13);
		printstr(" Next ");
	}
	printstat_1p();
	drawpanel_bordercolor(clr);
	if (h24)
		drawstr("\\x\\6x", 6, 9, 12);
	else {
		drawstr("\\x Nx\\3mqNu", 8, 0, 13);
		drawstr("\\x\\x", 0, 9, 17);
	}
	i = 0;
	if (h24)
		i = 4;
	setwcurs(0, 0, i);
	drawpanel_bordercolor(clr);
	draw_vline(board_x(1, 10)+1, i, 20);
}